diff options
author | Robin Gareus <robin@gareus.org> | 2018-11-11 19:51:56 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-11-11 19:51:56 +0100 |
commit | 8f216afa245da108d1617dedb2a0a5197250eb18 (patch) | |
tree | 05b20f0234d8e40c39a5698e857fa18e65efeb12 /gtk2_ardour/engine_dialog.cc | |
parent | 38301c808c2b60ac1b78f097f078964dfde84f7e (diff) |
Another engine dialog edge-case fix to set the samplerate
Honor the sesssion's sample-rate when showing the dialog with the engine
stopped. This can happen when then engine dies or hide/show the dialog
after manually stopping the engine.
Diffstat (limited to 'gtk2_ardour/engine_dialog.cc')
-rw-r--r-- | gtk2_ardour/engine_dialog.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index f82f45bce7..69dc179798 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -1364,8 +1364,15 @@ EngineControl::set_samplerate_popdown_strings () if (!s.empty()) { if (ARDOUR::AudioEngine::instance()->running()) { sample_rate_combo.set_active_text (rate_as_string (backend->sample_rate())); - } - else if (desired.empty ()) { + } else if (ARDOUR_UI::instance()->session_loaded) { + float active_sr = ARDOUR_UI::instance()->the_session()->nominal_sample_rate (); + + if (std::find (sr.begin (), sr.end (), active_sr) == sr.end ()) { + active_sr = sr.front (); + } + + sample_rate_combo.set_active_text (rate_as_string (active_sr)); + } else if (desired.empty ()) { float new_active_sr = backend->default_sample_rate (); if (std::find (sr.begin (), sr.end (), new_active_sr) == sr.end ()) { @@ -1376,7 +1383,6 @@ EngineControl::set_samplerate_popdown_strings () } else { sample_rate_combo.set_active_text (desired); } - } update_sensitivity (); } |