13
0

Add API to enforce valid device selection.

This commit is contained in:
Robin Gareus 2016-11-26 14:30:46 +01:00
parent 5bf8a5537b
commit 335debfa2f
3 changed files with 10 additions and 0 deletions

View File

@ -202,6 +202,14 @@ class LIBARDOUR_API AudioBackend : public PortEngine {
*/
virtual bool use_separate_input_and_output_devices () const { return false; }
/* Return true if the backend uses separate I/O devices only for the case
* of allowing one to be "None".
*
* ie. Input Device must match Output Device, except if either of them
* is get_standard_device_name (DeviceNone).
*/
virtual bool match_input_output_devices_or_none () const { return false; }
/** Returns a collection of DeviceStatuses identifying devices discovered
* by this backend since the start of the process.
*

View File

@ -172,6 +172,7 @@ class AlsaAudioBackend : public AudioBackend {
bool is_realtime () const;
bool use_separate_input_and_output_devices () const { return true; }
bool match_input_output_devices_or_none () const { return true; }
bool can_set_period_size () const { return true; }
std::vector<DeviceStatus> enumerate_devices () const;

View File

@ -179,6 +179,7 @@ class PortAudioBackend : public AudioBackend {
bool get_use_buffered_io () { return _use_blocking_api; }
bool use_separate_input_and_output_devices () const;
bool match_input_output_devices_or_none () const { return true; }
std::vector<DeviceStatus> enumerate_devices () const;
std::vector<DeviceStatus> enumerate_input_devices () const;
std::vector<DeviceStatus> enumerate_output_devices () const;