PortAudio
2.0
|
Stream interfaces, representation structures and helper functions used to interface between pa_front.c host API implementations. More...
#include "portaudio.h"
Go to the source code of this file.
Data Structures | |
struct | PaUtilStreamInterface |
struct | PaUtilStreamRepresentation |
Macros | |
#define | PA_STREAM_MAGIC (0x18273645) |
#define | PA_STREAM_REP(stream) ((PaUtilStreamRepresentation*) (stream) ) |
#define | PA_STREAM_INTERFACE(stream) PA_STREAM_REP( (stream) )->streamInterface |
Typedefs | |
typedef struct PaUtilStreamRepresentation | PaUtilStreamRepresentation |
Functions | |
void | PaUtil_InitializeStreamInterface (PaUtilStreamInterface *streamInterface, PaError(*Close)(PaStream *), PaError(*Start)(PaStream *), PaError(*Stop)(PaStream *), PaError(*Abort)(PaStream *), PaError(*IsStopped)(PaStream *), PaError(*IsActive)(PaStream *), PaTime(*GetTime)(PaStream *), double(*GetCpuLoad)(PaStream *), PaError(*Read)(PaStream *stream, void *buffer, unsigned long frames), PaError(*Write)(PaStream *stream, const void *buffer, unsigned long frames), signed long(*GetReadAvailable)(PaStream *stream), signed long(*GetWriteAvailable)(PaStream *stream)) |
PaError | PaUtil_DummyRead (PaStream *stream, void *buffer, unsigned long frames) |
PaError | PaUtil_DummyWrite (PaStream *stream, const void *buffer, unsigned long frames) |
signed long | PaUtil_DummyGetReadAvailable (PaStream *stream) |
signed long | PaUtil_DummyGetWriteAvailable (PaStream *stream) |
double | PaUtil_DummyGetCpuLoad (PaStream *stream) |
void | PaUtil_InitializeStreamRepresentation (PaUtilStreamRepresentation *streamRepresentation, PaUtilStreamInterface *streamInterface, PaStreamCallback *streamCallback, void *userData) |
void | PaUtil_TerminateStreamRepresentation (PaUtilStreamRepresentation *streamRepresentation) |
PaError | PaUtil_ValidateStreamPointer (PaStream *stream) |
Stream interfaces, representation structures and helper functions used to interface between pa_front.c host API implementations.
#define PA_STREAM_INTERFACE | ( | stream | ) | PA_STREAM_REP( (stream) )->streamInterface |
Cast an opaque stream pointer into a pointer to a PaUtilStreamInterface.
Referenced by Pa_AbortStream(), Pa_GetStreamCpuLoad(), Pa_GetStreamReadAvailable(), Pa_GetStreamTime(), Pa_GetStreamWriteAvailable(), Pa_IsStreamActive(), Pa_IsStreamStopped(), Pa_ReadStream(), Pa_SetStreamFinishedCallback(), Pa_StartStream(), Pa_StopStream(), and Pa_WriteStream().
#define PA_STREAM_MAGIC (0x18273645) |
Referenced by PaUtil_InitializeStreamRepresentation(), and PaUtil_ValidateStreamPointer().
#define PA_STREAM_REP | ( | stream | ) | ((PaUtilStreamRepresentation*) (stream) ) |
Cast an opaque stream pointer into a pointer to a PaUtilStreamRepresentation.
Referenced by Pa_GetStreamInfo(), and Pa_SetStreamFinishedCallback().
typedef struct PaUtilStreamRepresentation PaUtilStreamRepresentation |
Non host specific data for a stream. This data is used by pa_front to forward to the appropriate functions in the streamInterface structure.
double PaUtil_DummyGetCpuLoad | ( | PaStream * | stream | ) |
Dummy GetCpuLoad function for use in an interface to a read/write stream. Pass to the GetCpuLoad parameter of PaUtil_InitializeStreamInterface.
Referenced by PaAlsa_Initialize(), PaAsiHpi_Initialize(), PaAsio_Initialize(), PaJack_Initialize(), PaMacCore_Initialize(), PaOSS_Initialize(), PaSkeleton_Initialize(), PaWasapi_Initialize(), PaWinDs_Initialize(), PaWinMme_Initialize(), and PaWinWdm_Initialize().
signed long PaUtil_DummyGetReadAvailable | ( | PaStream * | stream | ) |
Dummy GetReadAvailable function for use in interfaces to callback based streams. Pass to the GetReadAvailable parameter of PaUtil_InitializeStreamInterface.
References paCanNotReadFromACallbackStream.
Referenced by PaAlsa_Initialize(), PaAsiHpi_Initialize(), PaAsio_Initialize(), PaJack_Initialize(), PaMacCore_Initialize(), PaOSS_Initialize(), PaSkeleton_Initialize(), PaWasapi_Initialize(), PaWinDs_Initialize(), PaWinMme_Initialize(), and PaWinWdm_Initialize().
signed long PaUtil_DummyGetWriteAvailable | ( | PaStream * | stream | ) |
Dummy GetWriteAvailable function for use in interfaces to callback based streams. Pass to the GetWriteAvailable parameter of PaUtil_InitializeStreamInterface.
References paCanNotWriteToACallbackStream.
Referenced by PaAlsa_Initialize(), PaAsiHpi_Initialize(), PaAsio_Initialize(), PaJack_Initialize(), PaMacCore_Initialize(), PaOSS_Initialize(), PaSkeleton_Initialize(), PaWasapi_Initialize(), PaWinDs_Initialize(), PaWinMme_Initialize(), and PaWinWdm_Initialize().
Dummy Read function for use in interfaces to a callback based streams. Pass to the Read parameter of PaUtil_InitializeStreamInterface.
References paCanNotReadFromACallbackStream.
Referenced by PaAlsa_Initialize(), PaAsiHpi_Initialize(), PaAsio_Initialize(), PaJack_Initialize(), PaMacCore_Initialize(), PaOSS_Initialize(), PaSkeleton_Initialize(), PaWasapi_Initialize(), PaWinDs_Initialize(), PaWinMme_Initialize(), and PaWinWdm_Initialize().
Dummy Write function for use in an interfaces to callback based streams. Pass to the Write parameter of PaUtil_InitializeStreamInterface.
References paCanNotWriteToACallbackStream.
Referenced by PaAlsa_Initialize(), PaAsiHpi_Initialize(), PaAsio_Initialize(), PaJack_Initialize(), PaMacCore_Initialize(), PaOSS_Initialize(), PaSkeleton_Initialize(), PaWasapi_Initialize(), PaWinDs_Initialize(), PaWinMme_Initialize(), and PaWinWdm_Initialize().
void PaUtil_InitializeStreamInterface | ( | PaUtilStreamInterface * | streamInterface, |
PaError(*)(PaStream *) | Close, | ||
PaError(*)(PaStream *) | Start, | ||
PaError(*)(PaStream *) | Stop, | ||
PaError(*)(PaStream *) | Abort, | ||
PaError(*)(PaStream *) | IsStopped, | ||
PaError(*)(PaStream *) | IsActive, | ||
PaTime(*)(PaStream *) | GetTime, | ||
double(*)(PaStream *) | GetCpuLoad, | ||
PaError(*)(PaStream *stream, void *buffer, unsigned long frames) | Read, | ||
PaError(*)(PaStream *stream, const void *buffer, unsigned long frames) | Write, | ||
signed long(*)(PaStream *stream) | GetReadAvailable, | ||
signed long(*)(PaStream *stream) | GetWriteAvailable | ||
) |
Initialize the fields of a PaUtilStreamInterface structure.
void PaUtil_InitializeStreamRepresentation | ( | PaUtilStreamRepresentation * | streamRepresentation, |
PaUtilStreamInterface * | streamInterface, | ||
PaStreamCallback * | streamCallback, | ||
void * | userData | ||
) |
Initialize a PaUtilStreamRepresentation structure.
References PaStreamInfo::inputLatency, PaUtilStreamRepresentation::magic, PaUtilStreamRepresentation::nextOpenStream, PaStreamInfo::outputLatency, PA_STREAM_MAGIC, PaStreamInfo::sampleRate, PaUtilStreamRepresentation::streamCallback, PaUtilStreamRepresentation::streamFinishedCallback, PaUtilStreamRepresentation::streamInfo, PaUtilStreamRepresentation::streamInterface, and PaUtilStreamRepresentation::userData.
void PaUtil_TerminateStreamRepresentation | ( | PaUtilStreamRepresentation * | streamRepresentation | ) |
Clean up a PaUtilStreamRepresentation structure previously initialized by a call to PaUtil_InitializeStreamRepresentation.
References PaUtilStreamRepresentation::magic.
Check that the stream pointer is valid.
References PA_IS_INITIALISED_, PA_STREAM_MAGIC, paBadStreamPtr, paNoError, and paNotInitialized.
Referenced by Pa_AbortStream(), Pa_CloseStream(), Pa_GetStreamCpuLoad(), Pa_GetStreamInfo(), Pa_GetStreamReadAvailable(), Pa_GetStreamTime(), Pa_GetStreamWriteAvailable(), Pa_IsStreamActive(), Pa_IsStreamStopped(), Pa_ReadStream(), Pa_SetStreamFinishedCallback(), Pa_StartStream(), Pa_StopStream(), and Pa_WriteStream().