diff --git a/include/portaudio.h b/include/portaudio.h index 6131be09b..770aa6f03 100644 --- a/include/portaudio.h +++ b/include/portaudio.h @@ -636,7 +636,7 @@ PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters, Pa_GetStreamTime, Pa_GetStreamCpuLoad */ -typedef struct PaStream PaStream; +typedef struct PaUtilStreamRepresentation PaStream; /** Can be passed as the framesPerBuffer parameter to Pa_OpenStream() diff --git a/src/common/pa_front.c b/src/common/pa_front.c index 2d126a4ca..1ab46edde 100644 --- a/src/common/pa_front.c +++ b/src/common/pa_front.c @@ -1394,7 +1394,7 @@ PaError Pa_CloseStream( PaStream* stream ) if( result == paNoError ) { - interface = PA_STREAM_INTERFACE(stream); + interface = stream->streamInterface; /* abort the stream if it isn't stopped */ result = interface->IsStopped( stream ); @@ -1423,14 +1423,14 @@ PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback if( result == paNoError ) { - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + result = stream->streamInterface->IsStopped( stream ); if( result == 0 ) { result = paStreamIsNotStopped ; } if( result == 1 ) { - PA_STREAM_REP( stream )->streamFinishedCallback = streamFinishedCallback; + stream->streamFinishedCallback = streamFinishedCallback; result = paNoError; } } @@ -1451,14 +1451,14 @@ PaError Pa_StartStream( PaStream *stream ) if( result == paNoError ) { - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + result = stream->streamInterface->IsStopped( stream ); if( result == 0 ) { result = paStreamIsNotStopped ; } else if( result == 1 ) { - result = PA_STREAM_INTERFACE(stream)->Start( stream ); + result = stream->streamInterface->Start( stream ); } } @@ -1477,10 +1477,10 @@ PaError Pa_StopStream( PaStream *stream ) if( result == paNoError ) { - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + result = stream->streamInterface->IsStopped( stream ); if( result == 0 ) { - result = PA_STREAM_INTERFACE(stream)->Stop( stream ); + result = stream->streamInterface->Stop( stream ); } else if( result == 1 ) { @@ -1503,10 +1503,10 @@ PaError Pa_AbortStream( PaStream *stream ) if( result == paNoError ) { - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + result = stream->streamInterface->IsStopped( stream ); if( result == 0 ) { - result = PA_STREAM_INTERFACE(stream)->Abort( stream ); + result = stream->streamInterface->Abort( stream ); } else if( result == 1 ) { @@ -1528,7 +1528,7 @@ PaError Pa_IsStreamStopped( PaStream *stream ) PA_LOGAPI(("\tPaStream* stream: 0x%p\n", stream )); if( result == paNoError ) - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + result = stream->streamInterface->IsStopped( stream ); PA_LOGAPI_EXIT_PAERROR( "Pa_IsStreamStopped", result ); @@ -1544,7 +1544,7 @@ PaError Pa_IsStreamActive( PaStream *stream ) PA_LOGAPI(("\tPaStream* stream: 0x%p\n", stream )); if( result == paNoError ) - result = PA_STREAM_INTERFACE(stream)->IsActive( stream ); + result = stream->streamInterface->IsActive( stream ); PA_LOGAPI_EXIT_PAERROR( "Pa_IsStreamActive", result ); @@ -1571,7 +1571,7 @@ const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ) } else { - result = &PA_STREAM_REP( stream )->streamInfo; + result = &stream->streamInfo; PA_LOGAPI(("Pa_GetStreamInfo returned:\n" )); PA_LOGAPI(("\tconst PaStreamInfo*: 0x%p:\n", result )); @@ -1607,7 +1607,7 @@ PaTime Pa_GetStreamTime( PaStream *stream ) } else { - result = PA_STREAM_INTERFACE(stream)->GetTime( stream ); + result = stream->streamInterface->GetTime( stream ); PA_LOGAPI(("Pa_GetStreamTime returned:\n" )); PA_LOGAPI(("\tPaTime: %g\n", result )); @@ -1637,7 +1637,7 @@ double Pa_GetStreamCpuLoad( PaStream* stream ) } else { - result = PA_STREAM_INTERFACE(stream)->GetCpuLoad( stream ); + result = stream->streamInterface->GetCpuLoad( stream ); PA_LOGAPI(("Pa_GetStreamCpuLoad returned:\n" )); PA_LOGAPI(("\tdouble: %g\n", result )); @@ -1670,10 +1670,10 @@ PaError Pa_ReadStream( PaStream* stream, } else { - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + result = stream->streamInterface->IsStopped( stream ); if( result == 0 ) { - result = PA_STREAM_INTERFACE(stream)->Read( stream, buffer, frames ); + result = stream->streamInterface->Read( stream, buffer, frames ); } else if( result == 1 ) { @@ -1710,10 +1710,10 @@ PaError Pa_WriteStream( PaStream* stream, } else { - result = PA_STREAM_INTERFACE(stream)->IsStopped( stream ); + result = stream->streamInterface->IsStopped( stream ); if( result == 0 ) { - result = PA_STREAM_INTERFACE(stream)->Write( stream, buffer, frames ); + result = stream->streamInterface->Write( stream, buffer, frames ); } else if( result == 1 ) { @@ -1745,7 +1745,7 @@ signed long Pa_GetStreamReadAvailable( PaStream* stream ) } else { - result = PA_STREAM_INTERFACE(stream)->GetReadAvailable( stream ); + result = stream->streamInterface->GetReadAvailable( stream ); PA_LOGAPI(("Pa_GetStreamReadAvailable returned:\n" )); PA_LOGAPI(("\tPaError: %d ( %s )\n", result, Pa_GetErrorText( result ) )); @@ -1774,7 +1774,7 @@ signed long Pa_GetStreamWriteAvailable( PaStream* stream ) } else { - result = PA_STREAM_INTERFACE(stream)->GetWriteAvailable( stream ); + result = stream->streamInterface->GetWriteAvailable( stream ); PA_LOGAPI(("Pa_GetStreamWriteAvailable returned:\n" )); PA_LOGAPI(("\tPaError: %d ( %s )\n", result, Pa_GetErrorText( result ) )); diff --git a/src/common/pa_stream.h b/src/common/pa_stream.h index 4afda399b..0d15dc586 100644 --- a/src/common/pa_stream.h +++ b/src/common/pa_stream.h @@ -182,22 +182,6 @@ void PaUtil_TerminateStreamRepresentation( PaUtilStreamRepresentation *streamRep PaError PaUtil_ValidateStreamPointer( PaStream *stream ); -/** Cast an opaque stream pointer into a pointer to a PaUtilStreamRepresentation. - - @see PaUtilStreamRepresentation -*/ -#define PA_STREAM_REP( stream )\ - ((PaUtilStreamRepresentation*) (stream) ) - - -/** Cast an opaque stream pointer into a pointer to a PaUtilStreamInterface. - - @see PaUtilStreamRepresentation, PaUtilStreamInterface -*/ -#define PA_STREAM_INTERFACE( stream )\ - PA_STREAM_REP( (stream) )->streamInterface - - #ifdef __cplusplus } diff --git a/src/hostapi/wmme/pa_win_wmme.c b/src/hostapi/wmme/pa_win_wmme.c index 3639d6d2e..c96a7d2ae 100644 --- a/src/hostapi/wmme/pa_win_wmme.c +++ b/src/hostapi/wmme/pa_win_wmme.c @@ -3966,8 +3966,8 @@ static PaError GetWinMMEStreamPointer( PaWinMmeStream **stream, PaStream *s ) /* note, the following would be easier if there was a generic way of testing that a stream belongs to a specific host API */ - if( PA_STREAM_REP( s )->streamInterface == &winMmeHostApi->callbackStreamInterface - || PA_STREAM_REP( s )->streamInterface == &winMmeHostApi->blockingStreamInterface ) + if( s->streamInterface == &winMmeHostApi->callbackStreamInterface + || s->streamInterface == &winMmeHostApi->blockingStreamInterface ) { /* s is a WinMME stream */ *stream = (PaWinMmeStream *)s;