00001 #ifndef PA_STREAM_H
00002 #define PA_STREAM_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00048 #include "portaudio.h"
00049
00050 #ifdef __cplusplus
00051 extern "C"
00052 {
00053 #endif
00054
00055
00056 #define PA_STREAM_MAGIC (0x18273645)
00057
00058
00065 typedef struct {
00066 PaError (*Close)( PaStream* stream );
00067 PaError (*Start)( PaStream *stream );
00068 PaError (*Stop)( PaStream *stream );
00069 PaError (*Abort)( PaStream *stream );
00070 PaError (*IsStopped)( PaStream *stream );
00071 PaError (*IsActive)( PaStream *stream );
00072 PaTime (*GetTime)( PaStream *stream );
00073 double (*GetCpuLoad)( PaStream* stream );
00074 PaError (*Read)( PaStream* stream, void *buffer, unsigned long frames );
00075 PaError (*Write)( PaStream* stream, const void *buffer, unsigned long frames );
00076 signed long (*GetReadAvailable)( PaStream* stream );
00077 signed long (*GetWriteAvailable)( PaStream* stream );
00078 } PaUtilStreamInterface;
00079
00080
00083 void PaUtil_InitializeStreamInterface( PaUtilStreamInterface *streamInterface,
00084 PaError (*Close)( PaStream* ),
00085 PaError (*Start)( PaStream* ),
00086 PaError (*Stop)( PaStream* ),
00087 PaError (*Abort)( PaStream* ),
00088 PaError (*IsStopped)( PaStream* ),
00089 PaError (*IsActive)( PaStream* ),
00090 PaTime (*GetTime)( PaStream* ),
00091 double (*GetCpuLoad)( PaStream* ),
00092 PaError (*Read)( PaStream* stream, void *buffer, unsigned long frames ),
00093 PaError (*Write)( PaStream* stream, const void *buffer, unsigned long frames ),
00094 signed long (*GetReadAvailable)( PaStream* stream ),
00095 signed long (*GetWriteAvailable)( PaStream* stream ) );
00096
00097
00103 PaError PaUtil_DummyRead( PaStream* stream,
00104 void *buffer,
00105 unsigned long frames );
00106
00107
00113 PaError PaUtil_DummyWrite( PaStream* stream,
00114 const void *buffer,
00115 unsigned long frames );
00116
00117
00123 signed long PaUtil_DummyGetReadAvailable( PaStream* stream );
00124
00125
00131 signed long PaUtil_DummyGetWriteAvailable( PaStream* stream );
00132
00133
00134
00139 double PaUtil_DummyGetCpuLoad( PaStream* stream );
00140
00141
00145 typedef struct PaUtilStreamRepresentation {
00146 unsigned long magic;
00147 struct PaUtilStreamRepresentation *nextOpenStream;
00148 PaUtilStreamInterface *streamInterface;
00149 PaStreamCallback *streamCallback;
00150 PaStreamFinishedCallback *streamFinishedCallback;
00151 void *userData;
00152 PaStreamInfo streamInfo;
00153 } PaUtilStreamRepresentation;
00154
00155
00160 void PaUtil_InitializeStreamRepresentation(
00161 PaUtilStreamRepresentation *streamRepresentation,
00162 PaUtilStreamInterface *streamInterface,
00163 PaStreamCallback *streamCallback,
00164 void *userData );
00165
00166
00172 void PaUtil_TerminateStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation );
00173
00174
00180 PaError PaUtil_ValidateStreamPointer( PaStream *stream );
00181
00182
00187 #define PA_STREAM_REP( stream )\
00188 ((PaUtilStreamRepresentation*) (stream) )
00189
00190
00195 #define PA_STREAM_INTERFACE( stream )\
00196 PA_STREAM_REP( (stream) )->streamInterface
00197
00198
00199
00200 #ifdef __cplusplus
00201 }
00202 #endif
00203 #endif