Whitespace cleanup in Java and C++ bindings#458)
This commit is contained in:
parent
3e782f2494
commit
a563f2d39d
43 changed files with 2918 additions and 2950 deletions
|
|
@ -26,13 +26,13 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* the PortAudio community also makes the following non-binding requests:
|
||||
*
|
||||
* Any person wishing to distribute modifications to the Software is
|
||||
* requested to send the modifications to the original developer so that
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* license above.
|
||||
*/
|
||||
|
||||
|
|
@ -55,9 +55,9 @@
|
|||
JNIEXPORT jint JNICALL Java_com_portaudio_BlockingStream_getReadAvailable
|
||||
(JNIEnv *env, jobject blockingStream)
|
||||
{
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( stream == NULL ) return 0;
|
||||
return Pa_GetStreamReadAvailable( stream );
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( stream == NULL ) return 0;
|
||||
return Pa_GetStreamReadAvailable( stream );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -68,9 +68,9 @@ JNIEXPORT jint JNICALL Java_com_portaudio_BlockingStream_getReadAvailable
|
|||
JNIEXPORT jint JNICALL Java_com_portaudio_BlockingStream_getWriteAvailable
|
||||
(JNIEnv *env, jobject blockingStream)
|
||||
{
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( stream == NULL ) return 0;
|
||||
return Pa_GetStreamWriteAvailable( stream );
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( stream == NULL ) return 0;
|
||||
return Pa_GetStreamWriteAvailable( stream );
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -82,33 +82,33 @@ JNIEXPORT jint JNICALL Java_com_portaudio_BlockingStream_getWriteAvailable
|
|||
JNIEXPORT jboolean JNICALL Java_com_portaudio_BlockingStream_writeFloats
|
||||
(JNIEnv *env, jobject blockingStream, jfloatArray buffer, jint numFrames)
|
||||
{
|
||||
jfloat *carr;
|
||||
jint err;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( buffer == NULL )
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
jfloat *carr;
|
||||
jint err;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( buffer == NULL )
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
"null stream buffer");
|
||||
return FALSE;
|
||||
}
|
||||
carr = (*env)->GetFloatArrayElements(env, buffer, NULL);
|
||||
if (carr == NULL)
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
return FALSE;
|
||||
}
|
||||
carr = (*env)->GetFloatArrayElements(env, buffer, NULL);
|
||||
if (carr == NULL)
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
"invalid stream buffer");
|
||||
return FALSE;
|
||||
}
|
||||
err = Pa_WriteStream( stream, carr, numFrames );
|
||||
(*env)->ReleaseFloatArrayElements(env, buffer, carr, 0);
|
||||
if( err == paOutputUnderflowed )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
jpa_CheckError( env, err );
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
err = Pa_WriteStream( stream, carr, numFrames );
|
||||
(*env)->ReleaseFloatArrayElements(env, buffer, carr, 0);
|
||||
if( err == paOutputUnderflowed )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
jpa_CheckError( env, err );
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -119,33 +119,33 @@ JNIEXPORT jboolean JNICALL Java_com_portaudio_BlockingStream_writeFloats
|
|||
JNIEXPORT jboolean JNICALL Java_com_portaudio_BlockingStream_readFloats
|
||||
(JNIEnv *env, jobject blockingStream, jfloatArray buffer, jint numFrames)
|
||||
{
|
||||
jfloat *carr;
|
||||
jint err;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( buffer == NULL )
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
jfloat *carr;
|
||||
jint err;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( buffer == NULL )
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
"null stream buffer");
|
||||
return FALSE;
|
||||
}
|
||||
carr = (*env)->GetFloatArrayElements(env, buffer, NULL);
|
||||
if (carr == NULL)
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
return FALSE;
|
||||
}
|
||||
carr = (*env)->GetFloatArrayElements(env, buffer, NULL);
|
||||
if (carr == NULL)
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
"invalid stream buffer");
|
||||
return FALSE;
|
||||
}
|
||||
err = Pa_ReadStream( stream, carr, numFrames );
|
||||
(*env)->ReleaseFloatArrayElements(env, buffer, carr, 0);
|
||||
if( err == paInputOverflowed )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
jpa_CheckError( env, err );
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
err = Pa_ReadStream( stream, carr, numFrames );
|
||||
(*env)->ReleaseFloatArrayElements(env, buffer, carr, 0);
|
||||
if( err == paInputOverflowed )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
jpa_CheckError( env, err );
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -156,33 +156,33 @@ JNIEXPORT jboolean JNICALL Java_com_portaudio_BlockingStream_readFloats
|
|||
JNIEXPORT jboolean JNICALL Java_com_portaudio_BlockingStream_writeShorts
|
||||
(JNIEnv *env, jobject blockingStream, jfloatArray buffer, jint numFrames)
|
||||
{
|
||||
jshort *carr;
|
||||
jint err;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( buffer == NULL )
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
jshort *carr;
|
||||
jint err;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( buffer == NULL )
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
"null stream buffer");
|
||||
return FALSE;
|
||||
}
|
||||
carr = (*env)->GetShortArrayElements(env, buffer, NULL);
|
||||
if (carr == NULL)
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
return FALSE;
|
||||
}
|
||||
carr = (*env)->GetShortArrayElements(env, buffer, NULL);
|
||||
if (carr == NULL)
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
"invalid stream buffer");
|
||||
return FALSE;
|
||||
}
|
||||
err = Pa_WriteStream( stream, carr, numFrames );
|
||||
(*env)->ReleaseShortArrayElements(env, buffer, carr, 0);
|
||||
if( err == paOutputUnderflowed )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
jpa_CheckError( env, err );
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
err = Pa_WriteStream( stream, carr, numFrames );
|
||||
(*env)->ReleaseShortArrayElements(env, buffer, carr, 0);
|
||||
if( err == paOutputUnderflowed )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
jpa_CheckError( env, err );
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -193,33 +193,33 @@ JNIEXPORT jboolean JNICALL Java_com_portaudio_BlockingStream_writeShorts
|
|||
JNIEXPORT jboolean JNICALL Java_com_portaudio_BlockingStream_readShorts
|
||||
(JNIEnv *env, jobject blockingStream, jfloatArray buffer, jint numFrames)
|
||||
{
|
||||
jshort *carr;
|
||||
jint err;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( buffer == NULL )
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
jshort *carr;
|
||||
jint err;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( buffer == NULL )
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
"null stream buffer");
|
||||
return FALSE;
|
||||
}
|
||||
carr = (*env)->GetShortArrayElements(env, buffer, NULL);
|
||||
if (carr == NULL)
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
return FALSE;
|
||||
}
|
||||
carr = (*env)->GetShortArrayElements(env, buffer, NULL);
|
||||
if (carr == NULL)
|
||||
{
|
||||
(*env)->ThrowNew( env, (*env)->FindClass(env,"java/lang/RuntimeException"),
|
||||
"invalid stream buffer");
|
||||
return FALSE;
|
||||
}
|
||||
err = Pa_ReadStream( stream, carr, numFrames );
|
||||
(*env)->ReleaseShortArrayElements(env, buffer, carr, 0);
|
||||
if( err == paInputOverflowed )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
jpa_CheckError( env, err );
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
err = Pa_ReadStream( stream, carr, numFrames );
|
||||
(*env)->ReleaseShortArrayElements(env, buffer, carr, 0);
|
||||
if( err == paInputOverflowed )
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
jpa_CheckError( env, err );
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -230,9 +230,9 @@ JNIEXPORT jboolean JNICALL Java_com_portaudio_BlockingStream_readShorts
|
|||
JNIEXPORT void JNICALL Java_com_portaudio_BlockingStream_start
|
||||
(JNIEnv *env, jobject blockingStream )
|
||||
{
|
||||
PaStream *stream = jpa_GetStreamPointer( env, blockingStream );
|
||||
int err = Pa_StartStream( stream );
|
||||
jpa_CheckError( env, err );
|
||||
PaStream *stream = jpa_GetStreamPointer( env, blockingStream );
|
||||
int err = Pa_StartStream( stream );
|
||||
jpa_CheckError( env, err );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -243,9 +243,9 @@ JNIEXPORT void JNICALL Java_com_portaudio_BlockingStream_start
|
|||
JNIEXPORT void JNICALL Java_com_portaudio_BlockingStream_stop
|
||||
(JNIEnv *env, jobject blockingStream )
|
||||
{
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
int err = Pa_StopStream( stream );
|
||||
jpa_CheckError( env, err );
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
int err = Pa_StopStream( stream );
|
||||
jpa_CheckError( env, err );
|
||||
}
|
||||
/*
|
||||
* Class: com_portaudio_BlockingStream
|
||||
|
|
@ -255,9 +255,9 @@ JNIEXPORT void JNICALL Java_com_portaudio_BlockingStream_stop
|
|||
JNIEXPORT void JNICALL Java_com_portaudio_BlockingStream_abort
|
||||
(JNIEnv *env, jobject blockingStream )
|
||||
{
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
int err = Pa_AbortStream( stream );
|
||||
jpa_CheckError( env, err );
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
int err = Pa_AbortStream( stream );
|
||||
jpa_CheckError( env, err );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -268,15 +268,15 @@ JNIEXPORT void JNICALL Java_com_portaudio_BlockingStream_abort
|
|||
JNIEXPORT void JNICALL Java_com_portaudio_BlockingStream_close
|
||||
(JNIEnv *env, jobject blockingStream )
|
||||
{
|
||||
jclass cls;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( stream != NULL )
|
||||
{
|
||||
int err = Pa_CloseStream( stream );
|
||||
jpa_CheckError( env, err );
|
||||
cls = (*env)->GetObjectClass(env, blockingStream);
|
||||
jpa_SetLongField( env, cls, blockingStream, "nativeStream", (jlong) 0 );
|
||||
}
|
||||
jclass cls;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( stream != NULL )
|
||||
{
|
||||
int err = Pa_CloseStream( stream );
|
||||
jpa_CheckError( env, err );
|
||||
cls = (*env)->GetObjectClass(env, blockingStream);
|
||||
jpa_SetLongField( env, cls, blockingStream, "nativeStream", (jlong) 0 );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -287,11 +287,11 @@ JNIEXPORT void JNICALL Java_com_portaudio_BlockingStream_close
|
|||
JNIEXPORT jboolean JNICALL Java_com_portaudio_BlockingStream_isStopped
|
||||
(JNIEnv *env, jobject blockingStream )
|
||||
{
|
||||
int err;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( stream == NULL ) return 1;
|
||||
err = Pa_IsStreamStopped( stream );
|
||||
return (jpa_CheckError( env, err ) > 0);
|
||||
int err;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( stream == NULL ) return 1;
|
||||
err = Pa_IsStreamStopped( stream );
|
||||
return (jpa_CheckError( env, err ) > 0);
|
||||
}
|
||||
/*
|
||||
* Class: com_portaudio_BlockingStream
|
||||
|
|
@ -301,11 +301,11 @@ JNIEXPORT jboolean JNICALL Java_com_portaudio_BlockingStream_isStopped
|
|||
JNIEXPORT jboolean JNICALL Java_com_portaudio_BlockingStream_isActive
|
||||
(JNIEnv *env, jobject blockingStream )
|
||||
{
|
||||
int err;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( stream == NULL ) return 0;
|
||||
err = Pa_IsStreamActive( stream );
|
||||
return (jpa_CheckError( env, err ) > 0);
|
||||
int err;
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( stream == NULL ) return 0;
|
||||
err = Pa_IsStreamActive( stream );
|
||||
return (jpa_CheckError( env, err ) > 0);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -317,9 +317,9 @@ JNIEXPORT jboolean JNICALL Java_com_portaudio_BlockingStream_isActive
|
|||
JNIEXPORT jdouble JNICALL Java_com_portaudio_BlockingStream_getTime
|
||||
(JNIEnv *env, jobject blockingStream )
|
||||
{
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( stream == NULL ) return 0.0;
|
||||
return Pa_GetStreamTime( stream );
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
if( stream == NULL ) return 0.0;
|
||||
return Pa_GetStreamTime( stream );
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -331,22 +331,21 @@ JNIEXPORT jdouble JNICALL Java_com_portaudio_BlockingStream_getTime
|
|||
JNIEXPORT void JNICALL Java_com_portaudio_BlockingStream_getInfo
|
||||
(JNIEnv *env, jobject blockingStream, jobject streamInfo)
|
||||
{
|
||||
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
const PaStreamInfo *info = Pa_GetStreamInfo( stream );
|
||||
if( streamInfo == NULL )
|
||||
{
|
||||
jpa_ThrowError( env, "Invalid stream." );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get a reference to obj's class */
|
||||
jclass cls = (*env)->GetObjectClass(env, streamInfo);
|
||||
|
||||
jpa_SetIntField( env, cls, streamInfo, "structVersion", info->structVersion );
|
||||
jpa_SetDoubleField( env, cls, streamInfo, "inputLatency", info->inputLatency );
|
||||
jpa_SetDoubleField( env, cls, streamInfo, "outputLatency", info->outputLatency );
|
||||
jpa_SetDoubleField( env, cls, streamInfo, "sampleRate", info->sampleRate );
|
||||
}
|
||||
}
|
||||
|
||||
PaStream *stream =jpa_GetStreamPointer( env, blockingStream );
|
||||
const PaStreamInfo *info = Pa_GetStreamInfo( stream );
|
||||
if( streamInfo == NULL )
|
||||
{
|
||||
jpa_ThrowError( env, "Invalid stream." );
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get a reference to obj's class */
|
||||
jclass cls = (*env)->GetObjectClass(env, streamInfo);
|
||||
|
||||
jpa_SetIntField( env, cls, streamInfo, "structVersion", info->structVersion );
|
||||
jpa_SetDoubleField( env, cls, streamInfo, "inputLatency", info->inputLatency );
|
||||
jpa_SetDoubleField( env, cls, streamInfo, "outputLatency", info->outputLatency );
|
||||
jpa_SetDoubleField( env, cls, streamInfo, "sampleRate", info->sampleRate );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,13 +26,13 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* the PortAudio community also makes the following non-binding requests:
|
||||
*
|
||||
* Any person wishing to distribute modifications to the Software is
|
||||
* requested to send the modifications to the original developer so that
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* license above.
|
||||
*/
|
||||
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_getVersion
|
||||
(JNIEnv *env, jclass clazz)
|
||||
{
|
||||
return Pa_GetVersion();
|
||||
return Pa_GetVersion();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -59,7 +59,7 @@ JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_getVersion
|
|||
JNIEXPORT jstring JNICALL Java_com_portaudio_PortAudio_getVersionText
|
||||
(JNIEnv *env, jclass clazz)
|
||||
{
|
||||
return (*env)->NewStringUTF(env, Pa_GetVersionText() );
|
||||
return (*env)->NewStringUTF(env, Pa_GetVersionText() );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -70,8 +70,8 @@ JNIEXPORT jstring JNICALL Java_com_portaudio_PortAudio_getVersionText
|
|||
JNIEXPORT void JNICALL Java_com_portaudio_PortAudio_initialize
|
||||
(JNIEnv *env, jclass clazz)
|
||||
{
|
||||
PaError err = Pa_Initialize();
|
||||
jpa_CheckError( env, err );
|
||||
PaError err = Pa_Initialize();
|
||||
jpa_CheckError( env, err );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -82,8 +82,8 @@ JNIEXPORT void JNICALL Java_com_portaudio_PortAudio_initialize
|
|||
JNIEXPORT void JNICALL Java_com_portaudio_PortAudio_terminate
|
||||
(JNIEnv *env, jclass clazz)
|
||||
{
|
||||
PaError err = Pa_Terminate();
|
||||
jpa_CheckError( env, err );
|
||||
PaError err = Pa_Terminate();
|
||||
jpa_CheckError( env, err );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -94,8 +94,8 @@ JNIEXPORT void JNICALL Java_com_portaudio_PortAudio_terminate
|
|||
JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_getDeviceCount
|
||||
(JNIEnv *env, jclass clazz)
|
||||
{
|
||||
jint count = Pa_GetDeviceCount();
|
||||
return jpa_CheckError( env, count );
|
||||
jint count = Pa_GetDeviceCount();
|
||||
return jpa_CheckError( env, count );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -106,27 +106,27 @@ JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_getDeviceCount
|
|||
JNIEXPORT void JNICALL Java_com_portaudio_PortAudio_getDeviceInfo
|
||||
(JNIEnv *env, jclass clazz, jint index, jobject deviceInfo)
|
||||
{
|
||||
const PaDeviceInfo *info;
|
||||
/* Get a reference to obj's class */
|
||||
jclass cls = (*env)->GetObjectClass(env, deviceInfo);
|
||||
|
||||
info = Pa_GetDeviceInfo( index );
|
||||
if( info == NULL )
|
||||
{
|
||||
jpa_ThrowError( env, "Pa_GetDeviceInfo returned NULL." );
|
||||
}
|
||||
else
|
||||
{
|
||||
jpa_SetStringField( env, cls, deviceInfo, "name", info->name );
|
||||
jpa_SetIntField( env, cls, deviceInfo, "maxInputChannels", info->maxInputChannels );
|
||||
jpa_SetIntField( env, cls, deviceInfo, "maxOutputChannels", info->maxOutputChannels );
|
||||
jpa_SetIntField( env, cls, deviceInfo, "hostApi", info->hostApi );
|
||||
jpa_SetDoubleField( env, cls, deviceInfo, "defaultSampleRate", info->defaultSampleRate );
|
||||
jpa_SetDoubleField( env, cls, deviceInfo, "defaultLowInputLatency", info->defaultLowInputLatency );
|
||||
jpa_SetDoubleField( env, cls, deviceInfo, "defaultLowInputLatency", info->defaultHighInputLatency );
|
||||
jpa_SetDoubleField( env, cls, deviceInfo, "defaultLowOutputLatency", info->defaultLowOutputLatency );
|
||||
jpa_SetDoubleField( env, cls, deviceInfo, "defaultHighOutputLatency", info->defaultHighOutputLatency );
|
||||
}
|
||||
const PaDeviceInfo *info;
|
||||
/* Get a reference to obj's class */
|
||||
jclass cls = (*env)->GetObjectClass(env, deviceInfo);
|
||||
|
||||
info = Pa_GetDeviceInfo( index );
|
||||
if( info == NULL )
|
||||
{
|
||||
jpa_ThrowError( env, "Pa_GetDeviceInfo returned NULL." );
|
||||
}
|
||||
else
|
||||
{
|
||||
jpa_SetStringField( env, cls, deviceInfo, "name", info->name );
|
||||
jpa_SetIntField( env, cls, deviceInfo, "maxInputChannels", info->maxInputChannels );
|
||||
jpa_SetIntField( env, cls, deviceInfo, "maxOutputChannels", info->maxOutputChannels );
|
||||
jpa_SetIntField( env, cls, deviceInfo, "hostApi", info->hostApi );
|
||||
jpa_SetDoubleField( env, cls, deviceInfo, "defaultSampleRate", info->defaultSampleRate );
|
||||
jpa_SetDoubleField( env, cls, deviceInfo, "defaultLowInputLatency", info->defaultLowInputLatency );
|
||||
jpa_SetDoubleField( env, cls, deviceInfo, "defaultLowInputLatency", info->defaultHighInputLatency );
|
||||
jpa_SetDoubleField( env, cls, deviceInfo, "defaultLowOutputLatency", info->defaultLowOutputLatency );
|
||||
jpa_SetDoubleField( env, cls, deviceInfo, "defaultHighOutputLatency", info->defaultHighOutputLatency );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -137,8 +137,8 @@ JNIEXPORT void JNICALL Java_com_portaudio_PortAudio_getDeviceInfo
|
|||
JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_getHostApiCount
|
||||
(JNIEnv *env, jclass clazz)
|
||||
{
|
||||
jint count = Pa_GetHostApiCount();
|
||||
return jpa_CheckError( env, count );
|
||||
jint count = Pa_GetHostApiCount();
|
||||
return jpa_CheckError( env, count );
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_getHostApiCount
|
|||
JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_hostApiTypeIdToHostApiIndex
|
||||
(JNIEnv *env, jclass clazz, jint hostApiType)
|
||||
{
|
||||
return Pa_HostApiTypeIdToHostApiIndex( (PaHostApiTypeId) hostApiType );
|
||||
return Pa_HostApiTypeIdToHostApiIndex( (PaHostApiTypeId) hostApiType );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -161,7 +161,7 @@ JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_hostApiTypeIdToHostApiIndex
|
|||
JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_hostApiDeviceIndexToDeviceIndex
|
||||
(JNIEnv *env, jclass clazz, jint hostApiIndex, jint apiDeviceIndex)
|
||||
{
|
||||
return Pa_HostApiDeviceIndexToDeviceIndex( hostApiIndex, apiDeviceIndex );
|
||||
return Pa_HostApiDeviceIndexToDeviceIndex( hostApiIndex, apiDeviceIndex );
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -173,24 +173,24 @@ JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_hostApiDeviceIndexToDeviceIn
|
|||
JNIEXPORT void JNICALL Java_com_portaudio_PortAudio_getHostApiInfo
|
||||
(JNIEnv *env, jclass clazz, jint index, jobject hostApiInfo)
|
||||
{
|
||||
const PaHostApiInfo *info;
|
||||
/* Get a reference to obj's class */
|
||||
jclass cls = (*env)->GetObjectClass(env, hostApiInfo);
|
||||
|
||||
info = Pa_GetHostApiInfo( index );
|
||||
if( info == NULL )
|
||||
{
|
||||
jpa_ThrowError( env, "Pa_GetHostApiInfo returned NULL." );
|
||||
}
|
||||
else
|
||||
{
|
||||
jpa_SetIntField( env, cls, hostApiInfo, "version", info->structVersion );
|
||||
jpa_SetIntField( env, cls, hostApiInfo, "type", info->type );
|
||||
jpa_SetStringField( env, cls, hostApiInfo, "name", info->name );
|
||||
jpa_SetIntField( env, cls, hostApiInfo, "deviceCount", info->deviceCount );
|
||||
jpa_SetIntField( env, cls, hostApiInfo, "defaultInputDevice", info->defaultInputDevice );
|
||||
jpa_SetIntField( env, cls, hostApiInfo, "defaultOutputDevice", info->defaultOutputDevice );
|
||||
}
|
||||
const PaHostApiInfo *info;
|
||||
/* Get a reference to obj's class */
|
||||
jclass cls = (*env)->GetObjectClass(env, hostApiInfo);
|
||||
|
||||
info = Pa_GetHostApiInfo( index );
|
||||
if( info == NULL )
|
||||
{
|
||||
jpa_ThrowError( env, "Pa_GetHostApiInfo returned NULL." );
|
||||
}
|
||||
else
|
||||
{
|
||||
jpa_SetIntField( env, cls, hostApiInfo, "version", info->structVersion );
|
||||
jpa_SetIntField( env, cls, hostApiInfo, "type", info->type );
|
||||
jpa_SetStringField( env, cls, hostApiInfo, "name", info->name );
|
||||
jpa_SetIntField( env, cls, hostApiInfo, "deviceCount", info->deviceCount );
|
||||
jpa_SetIntField( env, cls, hostApiInfo, "defaultInputDevice", info->defaultInputDevice );
|
||||
jpa_SetIntField( env, cls, hostApiInfo, "defaultOutputDevice", info->defaultOutputDevice );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -201,8 +201,8 @@ JNIEXPORT void JNICALL Java_com_portaudio_PortAudio_getHostApiInfo
|
|||
JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_getDefaultInputDevice
|
||||
(JNIEnv *env, jclass clazz)
|
||||
{
|
||||
jint deviceId = Pa_GetDefaultInputDevice();
|
||||
return jpa_CheckError( env, deviceId );
|
||||
jint deviceId = Pa_GetDefaultInputDevice();
|
||||
return jpa_CheckError( env, deviceId );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -213,8 +213,8 @@ JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_getDefaultInputDevice
|
|||
JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_getDefaultOutputDevice
|
||||
(JNIEnv *env, jclass clazz)
|
||||
{
|
||||
jint deviceId = Pa_GetDefaultOutputDevice();
|
||||
return jpa_CheckError( env, deviceId );
|
||||
jint deviceId = Pa_GetDefaultOutputDevice();
|
||||
return jpa_CheckError( env, deviceId );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -225,8 +225,8 @@ JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_getDefaultOutputDevice
|
|||
JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_getDefaultHostApi
|
||||
(JNIEnv *env, jclass clazz)
|
||||
{
|
||||
jint deviceId = Pa_GetDefaultHostApi();
|
||||
return jpa_CheckError( env, deviceId );
|
||||
jint deviceId = Pa_GetDefaultHostApi();
|
||||
return jpa_CheckError( env, deviceId );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -237,13 +237,13 @@ JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_getDefaultHostApi
|
|||
JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_isFormatSupported
|
||||
(JNIEnv *env, jclass clazz, jobject inParams, jobject outParams, jint sampleRate )
|
||||
{
|
||||
PaStreamParameters myInParams, *paInParams;
|
||||
PaStreamParameters myOutParams, *paOutParams;
|
||||
|
||||
paInParams = jpa_FillStreamParameters( env, inParams, &myInParams );
|
||||
paOutParams = jpa_FillStreamParameters( env, outParams, &myOutParams );
|
||||
|
||||
return Pa_IsFormatSupported( paInParams, paOutParams, sampleRate );
|
||||
PaStreamParameters myInParams, *paInParams;
|
||||
PaStreamParameters myOutParams, *paOutParams;
|
||||
|
||||
paInParams = jpa_FillStreamParameters( env, inParams, &myInParams );
|
||||
paOutParams = jpa_FillStreamParameters( env, outParams, &myOutParams );
|
||||
|
||||
return Pa_IsFormatSupported( paInParams, paOutParams, sampleRate );
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -255,25 +255,25 @@ JNIEXPORT jint JNICALL Java_com_portaudio_PortAudio_isFormatSupported
|
|||
JNIEXPORT void JNICALL Java_com_portaudio_PortAudio_openStream
|
||||
(JNIEnv *env, jclass clazz, jobject blockingStream, jobject inParams, jobject outParams, jint sampleRate, jint framesPerBuffer, jint flags )
|
||||
{
|
||||
int err;
|
||||
PaStreamParameters myInParams, *paInParams;
|
||||
PaStreamParameters myOutParams, *paOutParams;
|
||||
PaStream *stream;
|
||||
|
||||
paInParams = jpa_FillStreamParameters( env, inParams, &myInParams );
|
||||
paOutParams = jpa_FillStreamParameters( env, outParams, &myOutParams );
|
||||
err = Pa_OpenStream( &stream, paInParams, paOutParams, sampleRate, framesPerBuffer, flags, NULL, NULL );
|
||||
if( jpa_CheckError( env, err ) == 0 )
|
||||
{
|
||||
jclass cls = (*env)->GetObjectClass(env, blockingStream);
|
||||
jpa_SetLongField( env, cls, blockingStream, "nativeStream", (jlong) stream );
|
||||
if( paInParams != NULL )
|
||||
{
|
||||
jpa_SetIntField( env, cls, blockingStream, "inputFormat", paInParams->sampleFormat );
|
||||
}
|
||||
if( paOutParams != NULL )
|
||||
{
|
||||
jpa_SetIntField( env, cls, blockingStream, "outputFormat", paOutParams->sampleFormat );
|
||||
}
|
||||
}
|
||||
int err;
|
||||
PaStreamParameters myInParams, *paInParams;
|
||||
PaStreamParameters myOutParams, *paOutParams;
|
||||
PaStream *stream;
|
||||
|
||||
paInParams = jpa_FillStreamParameters( env, inParams, &myInParams );
|
||||
paOutParams = jpa_FillStreamParameters( env, outParams, &myOutParams );
|
||||
err = Pa_OpenStream( &stream, paInParams, paOutParams, sampleRate, framesPerBuffer, flags, NULL, NULL );
|
||||
if( jpa_CheckError( env, err ) == 0 )
|
||||
{
|
||||
jclass cls = (*env)->GetObjectClass(env, blockingStream);
|
||||
jpa_SetLongField( env, cls, blockingStream, "nativeStream", (jlong) stream );
|
||||
if( paInParams != NULL )
|
||||
{
|
||||
jpa_SetIntField( env, cls, blockingStream, "inputFormat", paInParams->sampleFormat );
|
||||
}
|
||||
if( paOutParams != NULL )
|
||||
{
|
||||
jpa_SetIntField( env, cls, blockingStream, "outputFormat", paOutParams->sampleFormat );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,13 +26,13 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* the PortAudio community also makes the following non-binding requests:
|
||||
*
|
||||
* Any person wishing to distribute modifications to the Software is
|
||||
* requested to send the modifications to the original developer so that
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* license above.
|
||||
*/
|
||||
|
||||
|
|
@ -45,14 +45,14 @@ jint jpa_GetIntField( JNIEnv *env, jclass cls, jobject obj, const char *fieldNam
|
|||
/* Look for the instance field maxInputChannels in cls */
|
||||
jfieldID fid = (*env)->GetFieldID(env, cls, fieldName, "I");
|
||||
if (fid == NULL)
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find integer JNI field." );
|
||||
return 0;
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find integer JNI field." );
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (*env)->GetIntField(env, obj, fid );
|
||||
}
|
||||
else
|
||||
{
|
||||
return (*env)->GetIntField(env, obj, fid );
|
||||
}
|
||||
}
|
||||
|
||||
void jpa_SetIntField( JNIEnv *env, jclass cls, jobject obj, const char *fieldName, jint value )
|
||||
|
|
@ -60,13 +60,13 @@ void jpa_SetIntField( JNIEnv *env, jclass cls, jobject obj, const char *fieldNam
|
|||
/* Look for the instance field maxInputChannels in cls */
|
||||
jfieldID fid = (*env)->GetFieldID(env, cls, fieldName, "I");
|
||||
if (fid == NULL)
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find integer JNI field." );
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find integer JNI field." );
|
||||
}
|
||||
else
|
||||
{
|
||||
(*env)->SetIntField(env, obj, fid, value );
|
||||
}
|
||||
else
|
||||
{
|
||||
(*env)->SetIntField(env, obj, fid, value );
|
||||
}
|
||||
}
|
||||
|
||||
jlong jpa_GetLongField( JNIEnv *env, jclass cls, jobject obj, const char *fieldName )
|
||||
|
|
@ -74,14 +74,14 @@ jlong jpa_GetLongField( JNIEnv *env, jclass cls, jobject obj, const char *fieldN
|
|||
/* Look for the instance field maxInputChannels in cls */
|
||||
jfieldID fid = (*env)->GetFieldID(env, cls, fieldName, "J");
|
||||
if (fid == NULL)
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find long JNI field." );
|
||||
return 0L;
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find long JNI field." );
|
||||
return 0L;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (*env)->GetLongField(env, obj, fid );
|
||||
}
|
||||
else
|
||||
{
|
||||
return (*env)->GetLongField(env, obj, fid );
|
||||
}
|
||||
}
|
||||
|
||||
void jpa_SetLongField( JNIEnv *env, jclass cls, jobject obj, const char *fieldName, jlong value )
|
||||
|
|
@ -89,13 +89,13 @@ void jpa_SetLongField( JNIEnv *env, jclass cls, jobject obj, const char *fieldNa
|
|||
/* Look for the instance field maxInputChannels in cls */
|
||||
jfieldID fid = (*env)->GetFieldID(env, cls, fieldName, "J");
|
||||
if (fid == NULL)
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find long JNI field." );
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find long JNI field." );
|
||||
}
|
||||
else
|
||||
{
|
||||
(*env)->SetLongField(env, obj, fid, value );
|
||||
}
|
||||
else
|
||||
{
|
||||
(*env)->SetLongField(env, obj, fid, value );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -104,13 +104,13 @@ void jpa_SetDoubleField( JNIEnv *env, jclass cls, jobject obj, const char *field
|
|||
/* Look for the instance field maxInputChannels in cls */
|
||||
jfieldID fid = (*env)->GetFieldID(env, cls, fieldName, "D");
|
||||
if (fid == NULL)
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find double JNI field." );
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find double JNI field." );
|
||||
}
|
||||
else
|
||||
{
|
||||
(*env)->SetDoubleField(env, obj, fid, value );
|
||||
}
|
||||
else
|
||||
{
|
||||
(*env)->SetDoubleField(env, obj, fid, value );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -119,14 +119,14 @@ jdouble jpa_GetDoubleField( JNIEnv *env, jclass cls, jobject obj, const char *fi
|
|||
/* Look for the instance field maxInputChannels in cls */
|
||||
jfieldID fid = (*env)->GetFieldID(env, cls, fieldName, "D");
|
||||
if (fid == NULL)
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find double JNI field." );
|
||||
return 0;
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find double JNI field." );
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (*env)->GetDoubleField(env, obj, fid );
|
||||
}
|
||||
else
|
||||
{
|
||||
return (*env)->GetDoubleField(env, obj, fid );
|
||||
}
|
||||
}
|
||||
|
||||
void jpa_SetStringField( JNIEnv *env, jclass cls, jobject obj, const char *fieldName, const char *value )
|
||||
|
|
@ -134,75 +134,75 @@ void jpa_SetStringField( JNIEnv *env, jclass cls, jobject obj, const char *field
|
|||
/* Look for the instance field maxInputChannels in cls */
|
||||
jfieldID fid = (*env)->GetFieldID(env, cls, fieldName, "Ljava/lang/String;");
|
||||
if (fid == NULL)
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find String JNI field." );
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot find String JNI field." );
|
||||
}
|
||||
else
|
||||
{
|
||||
jstring jstr = (*env)->NewStringUTF(env, value);
|
||||
if (jstr == NULL)
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot create new String." );
|
||||
}
|
||||
else
|
||||
{
|
||||
(*env)->SetObjectField(env, obj, fid, jstr );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jstring jstr = (*env)->NewStringUTF(env, value);
|
||||
if (jstr == NULL)
|
||||
{
|
||||
jpa_ThrowError( env, "Cannot create new String." );
|
||||
}
|
||||
else
|
||||
{
|
||||
(*env)->SetObjectField(env, obj, fid, jstr );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PaStreamParameters *jpa_FillStreamParameters( JNIEnv *env, jobject jstreamParam, PaStreamParameters *myParams )
|
||||
{
|
||||
jclass cls;
|
||||
|
||||
if( jstreamParam == NULL ) return NULL; // OK, not an error
|
||||
jclass cls;
|
||||
|
||||
cls = (*env)->GetObjectClass(env, jstreamParam);
|
||||
|
||||
myParams->channelCount = jpa_GetIntField( env, cls, jstreamParam, "channelCount" );
|
||||
myParams->device = jpa_GetIntField( env, cls, jstreamParam, "device" );
|
||||
myParams->sampleFormat = jpa_GetIntField( env, cls, jstreamParam, "sampleFormat" );
|
||||
myParams->suggestedLatency = jpa_GetDoubleField( env, cls, jstreamParam, "suggestedLatency" );
|
||||
myParams->hostApiSpecificStreamInfo = NULL;
|
||||
if( jstreamParam == NULL ) return NULL; // OK, not an error
|
||||
|
||||
return myParams;
|
||||
cls = (*env)->GetObjectClass(env, jstreamParam);
|
||||
|
||||
myParams->channelCount = jpa_GetIntField( env, cls, jstreamParam, "channelCount" );
|
||||
myParams->device = jpa_GetIntField( env, cls, jstreamParam, "device" );
|
||||
myParams->sampleFormat = jpa_GetIntField( env, cls, jstreamParam, "sampleFormat" );
|
||||
myParams->suggestedLatency = jpa_GetDoubleField( env, cls, jstreamParam, "suggestedLatency" );
|
||||
myParams->hostApiSpecificStreamInfo = NULL;
|
||||
|
||||
return myParams;
|
||||
}
|
||||
|
||||
// Create an exception that will be thrown when we return from the JNI call.
|
||||
jint jpa_ThrowError( JNIEnv *env, const char *message )
|
||||
{
|
||||
return (*env)->ThrowNew(env, (*env)->FindClass( env, "java/lang/RuntimeException"),
|
||||
return (*env)->ThrowNew(env, (*env)->FindClass( env, "java/lang/RuntimeException"),
|
||||
message );
|
||||
}
|
||||
|
||||
// Throw an exception on error.
|
||||
jint jpa_CheckError( JNIEnv *env, PaError err )
|
||||
{
|
||||
if( err == -1 )
|
||||
{
|
||||
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();
|
||||
return jpa_ThrowError( env, hostErrorInfo->errorText );
|
||||
}
|
||||
else
|
||||
{
|
||||
return jpa_ThrowError( env, Pa_GetErrorText( err ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return err;
|
||||
}
|
||||
if( err == paUnanticipatedHostError )
|
||||
{
|
||||
const PaHostErrorInfo *hostErrorInfo = Pa_GetLastHostErrorInfo();
|
||||
return jpa_ThrowError( env, hostErrorInfo->errorText );
|
||||
}
|
||||
else
|
||||
{
|
||||
return jpa_ThrowError( env, Pa_GetErrorText( err ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
// Get the stream pointer from a BlockingStream long field.
|
||||
PaStream *jpa_GetStreamPointer( JNIEnv *env, jobject blockingStream )
|
||||
{
|
||||
jclass cls = (*env)->GetObjectClass(env, blockingStream);
|
||||
return (PaStream *) jpa_GetLongField( env, cls, blockingStream, "nativeStream" );
|
||||
jclass cls = (*env)->GetObjectClass(env, blockingStream);
|
||||
return (PaStream *) jpa_GetLongField( env, cls, blockingStream, "nativeStream" );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,13 +26,13 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* The text above constitutes the entire PortAudio license; however,
|
||||
* the PortAudio community also makes the following non-binding requests:
|
||||
*
|
||||
* Any person wishing to distribute modifications to the Software is
|
||||
* requested to send the modifications to the original developer so that
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* they can be incorporated into the canonical version. It is also
|
||||
* requested that these non-binding requests be included along with the
|
||||
* license above.
|
||||
*/
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue