00001 #ifndef INCLUDED_PORTAUDIO_DEVICE_HXX 00002 #define INCLUDED_PORTAUDIO_DEVICE_HXX 00003 00004 // --------------------------------------------------------------------------------------- 00005 00006 #include <iterator> 00007 00008 #include "pa_common/portaudio.h" 00009 00010 #include "portaudiocpp/SampleDataFormat.hxx" 00011 00012 // --------------------------------------------------------------------------------------- 00013 00014 // Forward declaration(s): 00015 namespace portaudio 00016 { 00017 class System; 00018 class HostApi; 00019 } 00020 00021 // --------------------------------------------------------------------------------------- 00022 00023 // Declaration(s): 00024 namespace portaudio 00025 { 00026 00040 class Device 00041 { 00042 public: 00043 // query info: name, max in channels, max out channels, 00044 // default low/hight input/output latency, default sample rate 00045 PaDeviceIndex index() const; 00046 const char *name() const; 00047 int maxInputChannels() const; 00048 int maxOutputChannels() const; 00049 PaTime defaultLowInputLatency() const; 00050 PaTime defaultHighInputLatency() const; 00051 PaTime defaultLowOutputLatency() const; 00052 PaTime defaultHighOutputLatency() const; 00053 double defaultSampleRate() const; 00054 00055 bool isInputOnlyDevice() const; // extended 00056 bool isOutputOnlyDevice() const; // extended 00057 bool isFullDuplexDevice() const; // extended 00058 bool isSystemDefaultInputDevice() const; // extended 00059 bool isSystemDefaultOutputDevice() const; // extended 00060 bool isHostApiDefaultInputDevice() const; // extended 00061 bool isHostApiDefaultOutputDevice() const; // extended 00062 00063 bool operator==(const Device &rhs); 00064 bool operator!=(const Device &rhs); 00065 00066 // host api reference 00067 HostApi &hostApi(); 00068 const HostApi &hostApi() const; 00069 00070 private: 00071 PaDeviceIndex index_; 00072 const PaDeviceInfo *info_; 00073 00074 private: 00075 friend class System; 00076 00077 explicit Device(PaDeviceIndex index); 00078 ~Device(); 00079 00080 Device(const Device &); // non-copyable 00081 Device &operator=(const Device &); // non-copyable 00082 }; 00083 00084 // ----------------------------------------------------------------------------------- 00085 00086 } // namespace portaudio 00087 00088 // --------------------------------------------------------------------------------------- 00089 00090 #endif // INCLUDED_PORTAUDIO_DEVICE_HXX 00091