diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-09-09 13:27:48 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-09-09 15:17:43 -0400 |
commit | a228643e402d8f1fb07da88eba960ec368e23dda (patch) | |
tree | d24a26577250a6f79d4d64a44ce3e0f9b992be90 | |
parent | 56465fda106a7350741d476282abee68da94b9bb (diff) |
add can_change_{sample_rate,buffer_size}_while_running() methods to an AudioBackend
Allows the GUI and other stuff to know whether or not changing the SR/bufsize is possible while running, which is about to become useful
-rw-r--r-- | libs/ardour/ardour/audio_backend.h | 11 | ||||
-rw-r--r-- | libs/backends/jack/jack_audiobackend.cc | 12 | ||||
-rw-r--r-- | libs/backends/jack/jack_audiobackend.h | 3 |
3 files changed, 26 insertions, 0 deletions
diff --git a/libs/ardour/ardour/audio_backend.h b/libs/ardour/ardour/audio_backend.h index 77b7eadb48..4192f0ea8b 100644 --- a/libs/ardour/ardour/audio_backend.h +++ b/libs/ardour/ardour/audio_backend.h @@ -147,6 +147,17 @@ class AudioBackend { */ virtual uint32_t available_output_channel_count (const std::string& device) const = 0; + /* Return true if the derived class can change the sample rate of the + * device in use while the device is already being used. Return false + * otherwise. (example: JACK cannot do this as of September 2013) + */ + virtual bool can_change_sample_rate_when_running () const = 0; + /* Return true if the derived class can change the buffer size of the + * device in use while the device is already being used. Return false + * otherwise. + */ + virtual bool can_change_buffer_size_when_running () const = 0; + /* Set the hardware parameters. * * If called when the current state is stopped or paused, diff --git a/libs/backends/jack/jack_audiobackend.cc b/libs/backends/jack/jack_audiobackend.cc index 22e5a525ea..f452a78d49 100644 --- a/libs/backends/jack/jack_audiobackend.cc +++ b/libs/backends/jack/jack_audiobackend.cc @@ -935,3 +935,15 @@ JACKAudioBackend::n_physical (unsigned long flags) const return c; } + +bool +JACKAudioBackend::can_change_sample_rate_when_running () const +{ + return false; +} + +bool +JACKAudioBackend::can_change_buffer_size_when_running () const +{ + return true; +} diff --git a/libs/backends/jack/jack_audiobackend.h b/libs/backends/jack/jack_audiobackend.h index 5ba9ee63d7..f47b630f49 100644 --- a/libs/backends/jack/jack_audiobackend.h +++ b/libs/backends/jack/jack_audiobackend.h @@ -61,6 +61,9 @@ class JACKAudioBackend : public AudioBackend { uint32_t available_input_channel_count (const std::string& device) const; uint32_t available_output_channel_count (const std::string& device) const; + bool can_change_sample_rate_when_running() const; + bool can_change_buffer_size_when_running() const; + int set_device_name (const std::string&); int set_sample_rate (float); int set_buffer_size (uint32_t); |