Skip to content

Commit

Permalink
Updated source, added Csound Android modules, added netbeans project …
Browse files Browse the repository at this point in the history
…for processing PDE.jar
  • Loading branch information
rorywalsh committed Jan 2, 2013
1 parent 628615a commit cc0f4f0
Show file tree
Hide file tree
Showing 1,175 changed files with 46,576 additions and 597 deletions.
519 changes: 519 additions & 0 deletions AndroidBuild.java

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions CsoundAndroid/.classpath
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
10 changes: 10 additions & 0 deletions CsoundAndroid/.gitignore
@@ -0,0 +1,10 @@
*DS_Store
obj
libs
bin
gen
src/csnd*
*swp
jni/csound_orc*
jni/csound_prelex.c
jni/java_interface*
33 changes: 33 additions & 0 deletions CsoundAndroid/.project
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>CsoundAndroid</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
4 changes: 4 additions & 0 deletions CsoundAndroid/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.source=1.5
15 changes: 15 additions & 0 deletions CsoundAndroid/AndroidManifest.xml
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.csounds"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto">

<uses-sdk android:minSdkVersion="9" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<!-- MODIFY_AUDIO_SETTINGS is needed to use audio effects such as environmental reverb -->
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"></uses-permission>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
</manifest>
504 changes: 504 additions & 0 deletions CsoundAndroid/COPYING

Large diffs are not rendered by default.

73 changes: 73 additions & 0 deletions CsoundAndroid/android_interface.i
@@ -0,0 +1,73 @@
/*
* C S O U N D
*
* External language interfaces for the "C" Csound API.
*
* L I C E N S E
*
* This software is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

%module(directors="1") csnd

%feature("director") CsoundCallbackWrapper;
%feature("nodirector") Csound;
%include "typemaps.i"
%include "std_string.i"
%include "std_vector.i"
%feature("autodoc", "1");
%{
#include "csound.h"
#include "cfgvar.h"
#include "csound.hpp"
#include "AndroidCsound.hpp"
#include "cs_glue.hpp"
#include "csPerfThread.hpp"
#include "CsoundFile.hpp"
#include "CppSound.hpp"
#include "Soundfile.hpp"
%}

%apply int { size_t };
typedef unsigned int uint32_t;

/* %typemap(freearg) char ** {
free((char *) $1);
} */

// Enable the JNI class to load the required native library.
%pragma(java) jniclasscode=%{
static {
try {
java.lang.System.loadLibrary("csoundandroid");
} catch (UnsatisfiedLinkError e) {
java.lang.System.err.println("csoundandroid native code library failed to load.\n" + e);
java.lang.System.exit(1);
}
}
%}

%include "exclusions.i"

%include "csound.h"
%include "cfgvar.h"
%include "csound.hpp"
%include "AndroidCsound.hpp"
%include "cs_glue.hpp"
%include "csPerfThread.hpp"
%include "CsoundFile.hpp"
%include "CppSound.hpp"
%include "Soundfile.hpp"

20 changes: 20 additions & 0 deletions CsoundAndroid/build.sh
@@ -0,0 +1,20 @@
#!/bin/sh

export ANDROID_NDK_ROOT=$HOME/work/android-ndk-r8b
export NDK_MODULE_PATH=../../../android
flex -B -t ../../Engine/csound_orc.l > jni/csound_orclex.c
flex -B ../../Engine/csound_pre.lex > jni/csound_prelex.c
bison -d -pcsound_orc --report=itemset -o jni/csound_orcparse.c ../../Engine/csound_orc.y

rm -rf src/csnd
mkdir -p src/csnd

swig -java -package csnd -D__BUILDING_LIBCSOUND -DENABLE_NEW_PARSER -DPARCS -DHAVE_DIRENT_H -DHAVE_FCNTL_H -DHAVE_UNISTD_H -DHAVE_STDINT_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TYPES_H -DHAVE_TERMIOS_H -includeall -verbose -outdir src/csnd -c++ -I/usr/local/include -I../../H -I../../Engine -I../.. -I../../interfaces -I/System/Library/Frameworks/Python.framework/Headers -I/System/Library/Frameworks/JavaVM.framework/Headers -I./jni -o jni/java_interfaceJAVA_wrap.cpp android_interface.i

# ADJUST SWIG CODE FOR ANDROID and DIRECTORS
sed -i "" 's/AttachCurrentThread((void \*\*)/AttachCurrentThread(/' jni/java_interfaceJAVA_wrap.cpp

$ANDROID_NDK_ROOT/ndk-build TARGET_PLATFORM=android-9



92 changes: 92 additions & 0 deletions CsoundAndroid/build.xml
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="CsoundAndroid" default="help">

<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />

<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />

<!-- if sdk.dir was not set from one of the property file, then
get it from the ANDROID_HOME env var.
This must be done before we load project.properties since
the proguard config can use sdk.dir -->
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>

<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />

<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
unless="sdk.dir"
/>

<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />

<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />

</project>

0 comments on commit cc0f4f0

Please sign in to comment.