diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2015-05-09 11:35:27 +1000 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-05-31 20:02:07 +0200 |
commit | bb3b15ef96ed76dd47c0563644d20b68da340037 (patch) | |
tree | 409bf6c46fe6d39d208c45ddb690dc4e2d2d6bd8 /libs/ardour/ardour/audio_backend.h | |
parent | 86f56de6564728d0715191756373f48d983f4328 (diff) |
Add API to ARDOUR::AudioBackend to allow different input and output devices
Used spaces instead of tabs for whitespace consistancy with rest of header
Diffstat (limited to 'libs/ardour/ardour/audio_backend.h')
-rw-r--r-- | libs/ardour/ardour/audio_backend.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/libs/ardour/ardour/audio_backend.h b/libs/ardour/ardour/audio_backend.h index e0e7d8e904..8ce99c4e93 100644 --- a/libs/ardour/ardour/audio_backend.h +++ b/libs/ardour/ardour/audio_backend.h @@ -143,6 +143,16 @@ class LIBARDOUR_API AudioBackend : public PortEngine { DeviceStatus (const std::string& s, bool avail) : name (s), available (avail) {} }; + /** An optional alternate interface for backends to provide a facility to + * select separate input and output devices. + * + * If a backend returns true then enumerate_input_devices() and + * enumerate_output_devices() will be used instead of enumerate_devices() + * to enumerate devices. Similarly set_input/output_device_name() should + * be used to set devices instead of set_device_name(). + */ + virtual bool use_separate_input_and_output_devices () const { return false; } + /** Returns a collection of DeviceStatuses identifying devices discovered * by this backend since the start of the process. * @@ -152,6 +162,26 @@ class LIBARDOUR_API AudioBackend : public PortEngine { */ virtual std::vector<DeviceStatus> enumerate_devices () const = 0; + /** Returns a collection of DeviceStatuses identifying input devices + * discovered by this backend since the start of the process. + * + * Any of the names in each DeviceStatus may be used to identify a + * device in other calls to the backend, though any of them may become + * invalid at any time. + */ + virtual std::vector<DeviceStatus> enumerate_input_devices () const + { return std::vector<DeviceStatus>(); } + + /** Returns a collection of DeviceStatuses identifying output devices + * discovered by this backend since the start of the process. + * + * Any of the names in each DeviceStatus may be used to identify a + * device in other calls to the backend, though any of them may become + * invalid at any time. + */ + virtual std::vector<DeviceStatus> enumerate_output_devices () const + { return std::vector<DeviceStatus>(); } + /** Returns a collection of float identifying sample rates that are * potentially usable with the hardware identified by @param device. * Any of these values may be supplied in other calls to this backend @@ -231,6 +261,21 @@ class LIBARDOUR_API AudioBackend : public PortEngine { /** Set the name of the device to be used */ virtual int set_device_name (const std::string&) = 0; + + /** Set the name of the input device to be used if using separate + * input/output devices. + * + * @see use_separate_input_and_output_devices() + */ + virtual int set_input_device_name (const std::string&) { return 0;} + + /** Set the name of the output device to be used if using separate + * input/output devices. + * + * @see use_separate_input_and_output_devices() + */ + virtual int set_output_device_name (const std::string&) { return 0;} + /** Deinitialize and destroy current device */ virtual int drop_device() {return 0;}; @@ -283,6 +328,8 @@ class LIBARDOUR_API AudioBackend : public PortEngine { /* Retrieving parameters */ virtual std::string device_name () const = 0; + virtual std::string input_device_name () const { return std::string(); } + virtual std::string output_device_name () const { return std::string(); } virtual float sample_rate () const = 0; virtual uint32_t buffer_size () const = 0; virtual bool interleaved () const = 0; |