Go to the documentation of this file.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 PaHostApiTypeId hostApiType;
00156 } PaUtilStreamRepresentation;
00157
00158
00163 void PaUtil_InitializeStreamRepresentation(
00164 PaUtilStreamRepresentation *streamRepresentation,
00165 PaUtilStreamInterface *streamInterface,
00166 PaStreamCallback *streamCallback,
00167 void *userData );
00168
00169
00175 void PaUtil_TerminateStreamRepresentation( PaUtilStreamRepresentation *streamRepresentation );
00176
00177
00183 PaError PaUtil_ValidateStreamPointer( PaStream *stream );
00184
00185
00190 #define PA_STREAM_REP( stream )\
00191 ((PaUtilStreamRepresentation*) (stream) )
00192
00193
00198 #define PA_STREAM_INTERFACE( stream )\
00199 PA_STREAM_REP( (stream) )->streamInterface
00200
00201
00202
00203 #ifdef __cplusplus
00204 }
00205 #endif
00206 #endif