annotate src/portaudio_20140130/bindings/cpp/include/portaudiocpp/Device.hxx @ 39:7ddb4fc30dac

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