diff options
author | Robin Gareus <robin@gareus.org> | 2020-04-09 23:31:15 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-09 23:31:45 +0200 |
commit | e6febe040af3c305a71b0ffdc10e9f9cd9a98e6b (patch) | |
tree | 376295f582da3e67f76cf87b8f10025b476f146c /gtk2_ardour/engine_dialog.cc | |
parent | 661609f2c06ff4047b071e7b7069de5d338e6731 (diff) |
Continue to load session after latency calibration #7998
Diffstat (limited to 'gtk2_ardour/engine_dialog.cc')
-rw-r--r-- | gtk2_ardour/engine_dialog.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index c6ba4f42cb..a45c97aa05 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -2869,6 +2869,8 @@ EngineControl::set_desired_sample_rate (uint32_t sr) void EngineControl::on_switch_page (GtkNotebookPage*, guint page_num) { + bool was_calibrating_midi = _measure_midi != 0; + if (page_num == 0) { _measure_midi.reset(); update_sensitivity (); @@ -2935,6 +2937,17 @@ EngineControl::on_switch_page (GtkNotebookPage*, guint page_num) end_latency_detection (); } } + + /* after latency calibration the engine is running, continue to load session. + * RESPONSE_OK is a NO-OP when the dialog is displayed as Window + * from a running instance. + */ + if (page_num == 0 && _have_control && was_calibrating_midi && ARDOUR::AudioEngine::instance()->running()) { + boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend(); + if (backend && backend->can_change_systemic_latency_when_running ()) { + response (RESPONSE_OK); + } + } } /* latency measurement */ @@ -3166,6 +3179,14 @@ EngineControl::use_latency_button_clicked () if (backend->can_change_systemic_latency_when_running ()) { backend->set_systemic_input_latency (one_way); backend->set_systemic_output_latency (one_way); + + /* engine is running, continue to load session. + * RESPONSE_OK is a NO-OP when the dialog is displayed as Window + * from a running instance. + */ + notebook.set_current_page (0); + response (RESPONSE_OK); + return; } /* back to settings page */ |