summaryrefslogtreecommitdiff
path: root/gtk2_ardour/engine_dialog.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2015-08-08 10:54:22 +1000
committerTim Mayberry <mojofunk@gmail.com>2015-08-11 09:24:51 +1000
commitcaae165cd3a15a13903ddebf8375a6f4ed7b82f3 (patch)
tree0c7b2769087e39aaf2021131a92c9117ca06eda8 /gtk2_ardour/engine_dialog.cc
parent914495949dbca89c0074e064aa879358ac820672 (diff)
Defer to device_changed when input or output devices change
This reduces the amount of unnecessary querying of samplerate and buffersize for devices
Diffstat (limited to 'gtk2_ardour/engine_dialog.cc')
-rw-r--r--gtk2_ardour/engine_dialog.cc62
1 files changed, 4 insertions, 58 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc
index ecf38a7f62..45d49b40a3 100644
--- a/gtk2_ardour/engine_dialog.cc
+++ b/gtk2_ardour/engine_dialog.cc
@@ -331,8 +331,6 @@ EngineControl::on_show ()
backend_changed ();
}
device_changed ();
- input_device_changed ();
- output_device_changed ();
ok_button->grab_focus();
}
@@ -962,7 +960,7 @@ EngineControl::set_input_device_popdown_strings ()
input_device_combo.set_active_text (current_device);
}
- input_device_changed ();
+ device_changed ();
return true;
}
@@ -1009,7 +1007,7 @@ EngineControl::set_output_device_popdown_strings ()
output_device_combo.set_active_text (current_device);
}
- output_device_changed ();
+ device_changed ();
return true;
}
@@ -1238,63 +1236,13 @@ EngineControl::device_changed ()
void
EngineControl::input_device_changed ()
{
- boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
- assert (backend);
- string input_device_name = input_device_combo.get_active_text ();
-
- if (!ignore_changes && input_device_name != backend->input_device_name()) {
- queue_device_changed = true;
- }
-
- backend->set_input_device_name(input_device_name);
-
- {
- PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1);
-
- set_samplerate_popdown_strings (input_device_name);
- set_buffersize_popdown_strings (input_device_name);
- /* XXX theoretically need to set min + max channel counts here
- */
-
- manage_control_app_sensitivity ();
- }
-
- /* pick up any saved state for this device */
-
- if (!ignore_changes) {
- maybe_display_saved_state ();
- }
+ device_changed ();
}
void
EngineControl::output_device_changed ()
{
- boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
- assert (backend);
- string output_device_name = output_device_combo.get_active_text ();
-
- if (!ignore_changes && output_device_name != backend->output_device_name()) {
- queue_device_changed = true;
- }
-
- backend->set_output_device_name(output_device_name);
-
- {
- PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1);
-
- set_samplerate_popdown_strings (output_device_name);
- set_buffersize_popdown_strings (output_device_name);
- /* XXX theoretically need to set min + max channel counts here
- */
-
- manage_control_app_sensitivity ();
- }
-
- /* pick up any saved state for this device */
-
- if (!ignore_changes) {
- maybe_display_saved_state ();
- }
+ device_changed ();
}
string
@@ -2244,8 +2192,6 @@ EngineControl::set_desired_sample_rate (uint32_t sr)
{
_desired_sample_rate = sr;
device_changed ();
- input_device_changed ();
- output_device_changed ();
}
void