PortAudio  2.0
Data Structures | Macros | Typedefs | Functions

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)
 

Detailed Description

Stream interfaces, representation structures and helper functions used to interface between pa_front.c host API implementations.

Macro Definition Documentation

#define PA_STREAM_INTERFACE (   stream)    PA_STREAM_REP( (stream) )->streamInterface
#define PA_STREAM_MAGIC   (0x18273645)
#define PA_STREAM_REP (   stream)    ((PaUtilStreamRepresentation*) (stream) )

Cast an opaque stream pointer into a pointer to a PaUtilStreamRepresentation.

See Also
PaUtilStreamRepresentation

Referenced by Pa_GetStreamInfo(), and Pa_SetStreamFinishedCallback().

Typedef Documentation

Non host specific data for a stream. This data is used by pa_front to forward to the appropriate functions in the streamInterface structure.

Function Documentation

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.

Returns
Returns 0.

Referenced by PaAlsa_Initialize(), PaAsiHpi_Initialize(), PaAsio_Initialize(), PaAudioIO_Initialize(), PaJack_Initialize(), PaMacCore_Initialize(), PaOSS_Initialize(), PaPulseAudio_Initialize(), PaSkeleton_Initialize(), PaSndio_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.

Returns
An error code indicating that the function has no effect because the stream is a callback stream.

References paCanNotReadFromACallbackStream.

Referenced by PaAlsa_Initialize(), PaAsiHpi_Initialize(), PaAsio_Initialize(), PaAudioIO_Initialize(), PaJack_Initialize(), PaMacCore_Initialize(), PaOSS_Initialize(), PaPulseAudio_Initialize(), PaSkeleton_Initialize(), PaSndio_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.

Returns
An error code indicating that the function has no effect because the stream is a callback stream.

References paCanNotWriteToACallbackStream.

Referenced by PaAlsa_Initialize(), PaAsiHpi_Initialize(), PaAsio_Initialize(), PaAudioIO_Initialize(), PaJack_Initialize(), PaMacCore_Initialize(), PaOSS_Initialize(), PaPulseAudio_Initialize(), PaSkeleton_Initialize(), PaSndio_Initialize(), PaWasapi_Initialize(), PaWinDs_Initialize(), PaWinMme_Initialize(), and PaWinWdm_Initialize().

PaError PaUtil_DummyRead ( PaStream stream,
void *  buffer,
unsigned long  frames 
)

Dummy Read function for use in interfaces to a callback based streams. Pass to the Read parameter of PaUtil_InitializeStreamInterface.

Returns
An error code indicating that the function has no effect because the stream is a callback stream.

References paCanNotReadFromACallbackStream.

Referenced by PaAlsa_Initialize(), PaAsiHpi_Initialize(), PaAsio_Initialize(), PaAudioIO_Initialize(), PaJack_Initialize(), PaMacCore_Initialize(), PaOSS_Initialize(), PaPulseAudio_Initialize(), PaSkeleton_Initialize(), PaSndio_Initialize(), PaWasapi_Initialize(), PaWinDs_Initialize(), PaWinMme_Initialize(), and PaWinWdm_Initialize().

PaError PaUtil_DummyWrite ( PaStream stream,
const void *  buffer,
unsigned long  frames 
)

Dummy Write function for use in an interfaces to callback based streams. Pass to the Write parameter of PaUtil_InitializeStreamInterface.

Returns
An error code indicating that the function has no effect because the stream is a callback stream.

References paCanNotWriteToACallbackStream.

Referenced by PaAlsa_Initialize(), PaAsiHpi_Initialize(), PaAsio_Initialize(), PaAudioIO_Initialize(), PaJack_Initialize(), PaMacCore_Initialize(), PaOSS_Initialize(), PaPulseAudio_Initialize(), PaSkeleton_Initialize(), PaSndio_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 
)
void PaUtil_TerminateStreamRepresentation ( PaUtilStreamRepresentation streamRepresentation)

Clean up a PaUtilStreamRepresentation structure previously initialized by a call to PaUtil_InitializeStreamRepresentation.

See Also
PaUtil_InitializeStreamRepresentation

References PaUtilStreamRepresentation::magic.

Referenced by PaPulseAudio_CloseStreamCb().

PaError PaUtil_ValidateStreamPointer ( PaStream stream)

Check that the stream pointer is valid.

Returns
Returns paNoError if the stream pointer appears to be OK, otherwise returns an error indicating the cause of failure.

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().