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
00050 #include "portaudio.h"
00051
00052 #ifdef __cplusplus
00053 extern "C"
00054 {
00055 #endif
00056
00057
00058 #define PA_STREAM_MAGIC (0x18273645)
00059
00060
00067 typedef struct {
00068 PaError (*Close)( PaStream* stream );
00069 PaError (*Start)( PaStream *stream );
00070 PaError (*Stop)( PaStream *stream );
00071 PaError (*Abort)( PaStream *stream );
00072 PaError (*IsStopped)( PaStream *stream );
00073 PaError (*IsActive)( PaStream *stream );
00074 PaTime (*GetTime)( PaStream *stream );
00075 double (*GetCpuLoad)( PaStream* stream );
00076 PaError (*Read)( PaStream* stream, void *buffer, unsigned long frames );
00077 PaError (*Write)( PaStream* stream, const void *buffer, unsigned long frames );
00078 signed long (*GetReadAvailable)( PaStream* stream );
00079 signed long (*GetWriteAvailable)( PaStream* stream );
00080 } PaUtilStreamInterface;
00081
00082
00085 void PaUtil_InitializeStreamInterface( PaUtilStreamInterface *streamInterface,
00086 PaError (*Close)( PaStream* ),
00087 PaError (*Start)( PaStream* ),
00088 PaError (*Stop)( PaStream* ),
00089 PaError (*Abort)( PaStream* ),
00090 PaError (*IsStopped)( PaStream* ),
00091 PaError (*IsActive)( PaStream* ),
00092 PaTime (*GetTime)( PaStream* ),
00093 double (*GetCpuLoad)( PaStream* ),
00094 PaError (*Read)( PaStream* stream, void *buffer, unsigned long frames ),
00095 PaError (*Write)( PaStream* stream, const void *buffer, unsigned long frames ),
00096 signed long (*GetReadAvailable)( PaStream* stream ),
00097 signed long (*GetWriteAvailable)( PaStream* stream ) );
00098
00099
00105 PaError PaUtil_DummyRead( PaStream* stream,
00106 void *buffer,
00107 unsigned long frames );
00108
00109
00115 PaError PaUtil_DummyWrite( PaStream* stream,
00116 const void *buffer,
00117 unsigned long frames );
00118
00119
00125 signed long PaUtil_DummyGetReadAvailable( PaStream* stream );
00126
00127
00133 signed long PaUtil_DummyGetWriteAvailable( PaStream* stream );
00134
00135
00136
00141 double PaUtil_DummyGetCpuLoad( PaStream* stream );
00142
00143
00147 typedef struct PaUtilStreamRepresentation {
00148 unsigned long magic;
00149 struct PaUtilStreamRepresentation *nextOpenStream;
00150 PaUtilStreamInterface *streamInterface;
00151 PaStreamCallback *streamCallback;
00152 PaStreamFinishedCallback *streamFinishedCallback;
00153 void *userData;
00154 PaStreamInfo streamInfo;
00155 } PaUtilStreamRepresentation;
00156
00157
00162 void PaUtil_InitializeStreamRepresentation(
00163 PaUtilStreamRepresentation *streamRepresentation,
00164 PaUtilStreamInterface *streamInterface,
00165 PaStreamCallback *streamCallback,
00166 void *userData );
00167
00168
00174 void PaUtil_TerminateStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation );
00175
00176
00182 PaError PaUtil_ValidateStreamPointer( PaStream *stream );
00183
00184
00189 #define PA_STREAM_REP( stream )\
00190 ((PaUtilStreamRepresentation*) (stream) )
00191
00192
00197 #define PA_STREAM_INTERFACE( stream )\
00198 PA_STREAM_REP( (stream) )->streamInterface
00199
00200
00201
00202 #ifdef __cplusplus
00203 }
00204 #endif
00205 #endif