]> Repos - portaudio/commitdiff
Modified to JPortAudio to support builds on Macintosh.
authorphilburk <philburk@0f58301d-fd10-0410-b4af-bbb618454e57>
Sun, 2 Sep 2012 01:43:30 +0000 (01:43 +0000)
committerphilburk <philburk@0f58301d-fd10-0410-b4af-bbb618454e57>
Sun, 2 Sep 2012 01:43:30 +0000 (01:43 +0000)
bindings/java/c/src/com_portaudio_BlockingStream.h
bindings/java/c/src/com_portaudio_PortAudio.h
bindings/java/c/src/jpa_tools.c
bindings/java/jportaudio.dox

index c42421cc3876846f71400634c9dfee840c84cbb2..b1621b4ab67d8dde4bb6e5aa48c7ecca48b47841 100644 (file)
@@ -1,5 +1,10 @@
 /* DO NOT EDIT THIS FILE - it is machine generated */
+#if defined(__APPLE__)
+#include <JavaVM/jni.h>
+#else
 #include <jni.h>
+#endif
+
 /* Header for class com_portaudio_BlockingStream */
 
 #ifndef _Included_com_portaudio_BlockingStream
index 67c13a08dff207e9d2fa053d71b2e51fc46aed0f..cf565c8c8d8f7d6963e86503fecde331d68e9df6 100644 (file)
@@ -1,5 +1,5 @@
 /* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
+#include <JavaVM/jni.h>
 /* Header for class com_portaudio_PortAudio */
 
 #ifndef _Included_com_portaudio_PortAudio
index 9754470581c5b8268cd8986f9700e8e20adf378b..e3f903aa8283888871b1322f725cc17eb92f39bd 100644 (file)
@@ -178,8 +178,12 @@ jint jpa_ThrowError( JNIEnv *env, const char *message )
 // Throw an exception on error.
 jint jpa_CheckError( JNIEnv *env, PaError err )
 {
-       if( err < 0 )
+       if( err == -1 )
        {
+        return jpa_ThrowError( env, "-1, possibly no available default device" );
+    }
+    else if( err < 0 )
+    {
                if( err == paUnanticipatedHostError )
                {
                        const PaHostErrorInfo *hostErrorInfo = Pa_GetLastHostErrorInfo();
index d0f463954cc3468b294fa46e3e3741b149bae3ef..4d88d2a95298d0113116ab4f70587d48ff4e0550 100644 (file)
@@ -34,4 +34,28 @@ Place the following libraries where they can be found, typically in the same fol
 - jportaudio_x86.dll\r
 - jportaudio_x64.dll\r
 \r
-*/
\ No newline at end of file
+@section java_comp_max Building JPortAudio on Mac\r
+\r
+These are notes from building JPortAudio on a Mac with 10.6.8 and XCode 4.\r
+\r
+I created a target of type 'C' library.\r
+\r
+I added the regular PortAudio frameworks plus the JavaVM framework.\r
+\r
+I modified com_portaudio_PortAudio.h and com_portaudio_BlockingStream.h so that jni.h could found.\r
+\r
+@code\r
+#if defined(__APPLE__)\r
+#include <JavaVM/jni.h>\r
+#else\r
+#include <jni.h>\r
+#endif\r
+@endcode\r
+\r
+This is bad because those header files are autogenerated and will be overwritten.\r
+We need a better solution for this.\r
+\r
+I had trouble finding the "libjportaudio.jnilib". So I added a Build Phase that copied the library to "/Users/phil/Library/Java/Extensions".\r
+\r
+On the Mac we can create a universal library for both 32 and 64-bit JVMs. So in the JAR file I will open "jportaudio" on Apple. ON WIndows I will continue to open "jportaudio_x64" and "jportaudio_x86".\r
+*/\r