diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2019-10-10 16:50:57 -0600 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2019-10-10 16:52:00 -0600 |
commit | 03a248d51774e62744ae6fd00c7e5df2720acf31 (patch) | |
tree | 3bbdfaf88c2d4db3bd365a2f7409d63e6efc7bb9 /gtk2_ardour/engine_dialog.cc | |
parent | 20b38ad8ea53b1832b9ad1db2bdcb7d0f2dae9c9 (diff) |
make EngineDialog behavior more appropriate for use in both startup and non-startup conditions
Diffstat (limited to 'gtk2_ardour/engine_dialog.cc')
-rw-r--r-- | gtk2_ardour/engine_dialog.cc | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index 0a02782489..82136ace0f 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -485,9 +485,8 @@ EngineControl::try_autostart () bool EngineControl::start_engine () { - if (push_state_to_backend(true) != 0) { - MessageDialog msg(*this, - ARDOUR::AudioEngine::instance()->get_last_backend_error()); + if (push_state_to_backend (true) != 0) { + MessageDialog msg (*this, ARDOUR::AudioEngine::instance()->get_last_backend_error()); msg.run(); return false; } @@ -2757,6 +2756,14 @@ EngineControl::control_app_button_clicked () } void +EngineControl::on_response (int) +{ + /* we do nothing when our response signal is emitted ... that's the + * responsibility of whoever displayed us. + */ +} + +void EngineControl::start_stop_button_clicked () { boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend(); @@ -2768,16 +2775,13 @@ EngineControl::start_stop_button_clicked () if (ARDOUR::AudioEngine::instance()->running()) { ARDOUR::AudioEngine::instance()->stop (); } else { - if (!ARDOUR_UI::instance()->the_session ()) { - pop_splash (); - hide (); - ARDOUR::GUIIdle (); - } + /* whoever displayed this dialog is expected to do its own + check on whether or not the engine is running. + */ start_engine (); - if (!ARDOUR_UI::instance()->the_session ()) { - ArdourDialog::on_response (RESPONSE_OK); - } } + + response (RESPONSE_OK); } void @@ -3139,22 +3143,6 @@ EngineControl::use_latency_button_clicked () } } -void -EngineControl::on_response (int rid) -{ - /* this gets called if this Dialog is running under gtk_dialog_run() - rather than in the toplevel loop. This happens during program - startup. - */ - - if (rid == RESPONSE_DELETE_EVENT) { - on_delete_event ((GdkEventAny*) 0); - return; - } - - ArdourDialog::on_response (rid); -} - bool EngineControl::on_delete_event (GdkEventAny* ev) { |