// 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();
- 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