annotate src/portaudio/bindings/cpp/include/portaudiocpp/Device.hxx @ 4:e13257ea84a4

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