00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __AU_System__
00020 #define __AU_System__
00021
00022 #include "AU_API.h"
00023 #include <UT/UT_SysClone.h>
00024 #include <UT/UT_PtrArray.h>
00025
00026 #ifdef WIN32
00027 #include <windows.h>
00028 #if !defined(IA64) && !defined(AMD64)
00029 #define DWORD_PTR DWORD
00030 #endif
00031 #endif
00032
00033 class AU_API AU_System
00034 {
00035 public:
00036 AU_System();
00037 ~AU_System();
00038
00039 protected:
00040 void stopDevice(int now);
00041 int isOpen();
00042 void setClosed();
00043 int bytesPerSample();
00044 void setFormatInfo( int channels, int rate, int bps );
00045
00046 static void addOpenDevice(int handle, bool input);
00047 static void removeOpenDevice(int handle, bool input);
00048
00049 int myInput;
00050
00051
00052
00053 int myDone;
00054
00055
00056
00057 int myCurrentQueueSize;
00058
00059
00060 char *myQueue;
00061
00062
00063 int myQueueSize;
00064
00065
00066
00067 int myQueuePos;
00068
00069
00070
00071 int my4Channel;
00072
00073
00074 CRITICAL_SECTION myCritSect;
00075
00076 HANDLE myHandle;
00077 WAVEFORMATEX myFormat;
00078
00079
00080 static void CALLBACK callbackFunc( HWAVEOUT hwo, UINT uMsg, DWORD dwInst,
00081 DWORD_PTR dwParam1, DWORD dwParam2 );
00082 private:
00083
00084 static DWORD WINAPI discardLoop( void *parm );
00085
00086 static int theDiscardLoopStarted;
00087 static UT_PtrArray< WAVEHDR * > theWaveHeaders;
00088 static CRITICAL_SECTION theDiscardCritSect;
00089 };
00090
00091 #endif // __AU_System