annotate src/portaudio/bindings/cpp/include/portaudiocpp/Device.hxx @ 107:71c914cf6201

Portaudio: add missed file
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 26 Mar 2013 12:14:11 +0000
parents 8a15ff55d9af
children
rev   line source
cannam@89 1 #ifndef INCLUDED_PORTAUDIO_DEVICE_HXX
cannam@89 2 #define INCLUDED_PORTAUDIO_DEVICE_HXX
cannam@89 3
cannam@89 4 // ---------------------------------------------------------------------------------------
cannam@89 5
cannam@89 6 #include <iterator>
cannam@89 7
cannam@89 8 #include "portaudio.h"
cannam@89 9
cannam@89 10 #include "portaudiocpp/SampleDataFormat.hxx"
cannam@89 11
cannam@89 12 // ---------------------------------------------------------------------------------------
cannam@89 13
cannam@89 14 // Forward declaration(s):
cannam@89 15 namespace portaudio
cannam@89 16 {
cannam@89 17 class System;
cannam@89 18 class HostApi;
cannam@89 19 }
cannam@89 20
cannam@89 21 // ---------------------------------------------------------------------------------------
cannam@89 22
cannam@89 23 // Declaration(s):
cannam@89 24 namespace portaudio
cannam@89 25 {
cannam@89 26
cannam@89 27 //////
cannam@89 28 /// @brief Class which represents a PortAudio device in the System.
cannam@89 29 ///
cannam@89 30 /// A single physical device in the system may have multiple PortAudio
cannam@89 31 /// Device representations using different HostApi 's though. A Device
cannam@89 32 /// can be half-duplex or full-duplex. A half-duplex Device can be used
cannam@89 33 /// to create a half-duplex Stream. A full-duplex Device can be used to
cannam@89 34 /// create a full-duplex Stream. If supported by the HostApi, two
cannam@89 35 /// half-duplex Devices can even be used to create a full-duplex Stream.
cannam@89 36 ///
cannam@89 37 /// Note that Device objects are very light-weight and can be passed around
cannam@89 38 /// by-value.
cannam@89 39 //////
cannam@89 40 class Device
cannam@89 41 {
cannam@89 42 public:
cannam@89 43 // query info: name, max in channels, max out channels,
cannam@89 44 // default low/hight input/output latency, default sample rate
cannam@89 45 PaDeviceIndex index() const;
cannam@89 46 const char *name() const;
cannam@89 47 int maxInputChannels() const;
cannam@89 48 int maxOutputChannels() const;
cannam@89 49 PaTime defaultLowInputLatency() const;
cannam@89 50 PaTime defaultHighInputLatency() const;
cannam@89 51 PaTime defaultLowOutputLatency() const;
cannam@89 52 PaTime defaultHighOutputLatency() const;
cannam@89 53 double defaultSampleRate() const;
cannam@89 54
cannam@89 55 bool isInputOnlyDevice() const; // extended
cannam@89 56 bool isOutputOnlyDevice() const; // extended
cannam@89 57 bool isFullDuplexDevice() const; // extended
cannam@89 58 bool isSystemDefaultInputDevice() const; // extended
cannam@89 59 bool isSystemDefaultOutputDevice() const; // extended
cannam@89 60 bool isHostApiDefaultInputDevice() const; // extended
cannam@89 61 bool isHostApiDefaultOutputDevice() const; // extended
cannam@89 62
cannam@89 63 bool operator==(const Device &rhs);
cannam@89 64 bool operator!=(const Device &rhs);
cannam@89 65
cannam@89 66 // host api reference
cannam@89 67 HostApi &hostApi();
cannam@89 68 const HostApi &hostApi() const;
cannam@89 69
cannam@89 70 private:
cannam@89 71 PaDeviceIndex index_;
cannam@89 72 const PaDeviceInfo *info_;
cannam@89 73
cannam@89 74 private:
cannam@89 75 friend class System;
cannam@89 76
cannam@89 77 explicit Device(PaDeviceIndex index);
cannam@89 78 ~Device();
cannam@89 79
cannam@89 80 Device(const Device &); // non-copyable
cannam@89 81 Device &operator=(const Device &); // non-copyable
cannam@89 82 };
cannam@89 83
cannam@89 84 // -----------------------------------------------------------------------------------
cannam@89 85
cannam@89 86 } // namespace portaudio
cannam@89 87
cannam@89 88 // ---------------------------------------------------------------------------------------
cannam@89 89
cannam@89 90 #endif // INCLUDED_PORTAUDIO_DEVICE_HXX
cannam@89 91