00001 #ifndef INCLUDED_PORTAUDIO_SYSTEM_HXX 00002 #define INCLUDED_PORTAUDIO_SYSTEM_HXX 00003 00004 // --------------------------------------------------------------------------------------- 00005 00006 #include "pa_common/portaudio.h" 00007 00008 // --------------------------------------------------------------------------------------- 00009 00010 // Forward declaration(s): 00011 namespace portaudio 00012 { 00013 class Device; 00014 class Stream; 00015 class HostApi; 00016 } 00017 00018 // --------------------------------------------------------------------------------------- 00019 00020 // Declaration(s): 00021 namespace portaudio 00022 { 00023 00024 00038 class System 00039 { 00040 public: 00041 class HostApiIterator; // forward declaration 00042 class DeviceIterator; // forward declaration 00043 00044 // ------------------------------------------------------------------------------- 00045 00046 static int version(); 00047 static const char *versionText(); 00048 00049 static void initialize(); 00050 static void terminate(); 00051 00052 static System &instance(); 00053 static bool exists(); 00054 00055 // ------------------------------------------------------------------------------- 00056 00057 // host apis: 00058 HostApiIterator hostApisBegin(); 00059 HostApiIterator hostApisEnd(); 00060 00061 HostApi &defaultHostApi(); 00062 00063 HostApi &hostApiByTypeId(PaHostApiTypeId type); 00064 HostApi &hostApiByIndex(PaHostApiIndex index); 00065 00066 int hostApiCount(); 00067 00068 // ------------------------------------------------------------------------------- 00069 00070 // devices: 00071 DeviceIterator devicesBegin(); 00072 DeviceIterator devicesEnd(); 00073 00074 Device &defaultInputDevice(); 00075 Device &defaultOutputDevice(); 00076 00077 Device &deviceByIndex(PaDeviceIndex index); 00078 00079 int deviceCount(); 00080 00081 static Device &nullDevice(); 00082 00083 // ------------------------------------------------------------------------------- 00084 00085 // misc: 00086 void sleep(long msec); 00087 int sizeOfSample(PaSampleFormat format); 00088 00089 private: 00090 System(); 00091 ~System(); 00092 00093 static System *instance_; 00094 static int initCount_; 00095 00096 static HostApi **hostApis_; 00097 static Device **devices_; 00098 00099 static Device *nullDevice_; 00100 }; 00101 00102 00103 } // namespace portaudio 00104 00105 00106 #endif // INCLUDED_PORTAUDIO_SYSTEM_HXX 00107