summaryrefslogtreecommitdiff
path: root/gtk2_ardour/engine_dialog.cc
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2015-02-24 14:29:02 -0600
committerBen Loftis <ben@harrisonconsoles.com>2015-02-24 14:29:02 -0600
commitfbdf6a815165e45ed63081cc919a8d8f7e24234b (patch)
tree779d219811254bcf31ed1984a7bc541a016bda73 /gtk2_ardour/engine_dialog.cc
parent6774aef41277c72627700eda0fe8c6ed65e272b1 (diff)
recover the most recent audio setup settings from config
Diffstat (limited to 'gtk2_ardour/engine_dialog.cc')
-rw-r--r--gtk2_ardour/engine_dialog.cc28
1 files changed, 18 insertions, 10 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc
index a32ccf146e..a78b85e719 100644
--- a/gtk2_ardour/engine_dialog.cc
+++ b/gtk2_ardour/engine_dialog.cc
@@ -117,7 +117,6 @@ EngineControl::EngineControl ()
}
set_popdown_strings (backend_combo, strings);
- backend_combo.set_active_text (strings.front());
backend_combo.signal_changed().connect (sigc::mem_fun (*this, &EngineControl::backend_changed));
/* setup basic packing characteristics for the table used on the main
@@ -279,10 +278,12 @@ EngineControl::EngineControl ()
ARDOUR::AudioEngine::instance()->Stopped.connect (stopped_connection, MISSING_INVALIDATOR, boost::bind (&EngineControl::engine_stopped, this), gui_context());
ARDOUR::AudioEngine::instance()->Halted.connect (stopped_connection, MISSING_INVALIDATOR, boost::bind (&EngineControl::engine_stopped, this), gui_context());
- if (audio_setup)
- {
+ if (audio_setup) {
set_state (*audio_setup);
+ } else {
+ backend_combo.set_active_text (strings.front());
}
+
{
/* ignore: don't save state */
PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1);
@@ -825,15 +826,22 @@ EngineControl::list_devices ()
update_sensitivity ();
{
- string current_device;
- current_device = backend->device_name ();
+ string current_device, found_device;
+ current_device = device_combo.get_active_text ();
if (current_device == "") {
- // device might not have been set yet
- current_device = device_combo.get_active_text ();
- if (current_device == "")
- // device has never been set, make sure it's not blank
- current_device = available_devices.front ();
+ current_device = backend->device_name ();
+ }
+
+ // Make sure that the active text is still relevant for this
+ // device (it might only be relevant to the previous device!!)
+ for (vector<string>::const_iterator i = available_devices.begin(); i != available_devices.end(); ++i) {
+ if (*i == current_device)
+ found_device = current_device;
}
+ if (found_device == "")
+ // device has never been set (or was not relevant
+ // for this backend) Let's make sure it's not blank
+ current_device = available_devices.front ();
PBD::Unwinder<uint32_t> protect_ignore_changes (ignore_changes, ignore_changes + 1);
set_popdown_strings (device_combo, available_devices);