00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __AU_Device__
00020 #define __AU_Device__
00021
00022
00023 #include "AU_API.h"
00024 #if defined(WIN32)
00025 #include "AU_System.h"
00026 class AU_API AU_Device : public AU_System
00027 #elif defined(MBSD)
00028 class AU_MBSDUtilAudioInfo;
00029
00030 class AU_API AU_Device
00031 #elif defined(IRIX6)
00032 #include <dmedia/audio.h>
00033 class AU_API AU_Device
00034 #else
00035 #include <audio.h>
00036 class AU_API AU_Device
00037 #endif
00038 {
00039 public:
00040 AU_Device();
00041 ~AU_Device();
00042
00043 int startPlay( int queuesize, int channels, int rate );
00044
00045 bool isReadyToPlay();
00046 void stopPlay( int now );
00047 void clearPort(void);
00048 void setFillPoint( int size );
00049 void writeSamples( int rate, short *data, int size );
00050 int getPortFD(void);
00051 int setAudioRate( int rate );
00052
00053 #if defined(WIN32) || defined(MBSD)
00054 static int passedFillPoint( int fd );
00055 #endif
00056
00057 private:
00058 #if defined(WIN32)
00059 int passedFillPoint( );
00060
00061 int myFillSize;
00062
00063 #elif defined(MBSD)
00064 int getHasEnoughFreeSpace();
00065
00066
00067 int myRequestedFreeSpace;
00068
00069 int myDeviceID;
00070
00071 AU_MBSDUtilAudioInfo * myInfo;
00072
00073 #elif defined(LINUX)
00074 void restart();
00075
00076 int mySupportedChannels;
00077 int myFormat8Bit;
00078 int myPort;
00079
00080 int myAudioRate;
00081 int myQueueSize;
00082 int myNumChannels;
00083
00084 ALconfig myConfig;
00085 int myOldRate;
00086
00087 #elif defined(SOLARIS)
00088 int myPort;
00089 int myAudioRate;
00090 int myQueueSize;
00091 int myNumChannels;
00092 ALconfig myConfig;
00093 int myOldRate;
00094
00095 #else
00096 ALport myPort;
00097 ALconfig myConfig;
00098 int myOldRate;
00099
00100 #endif
00101 };
00102
00103 #endif // __AU_Device