diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-08-08 22:28:31 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-08-08 22:28:31 -0400 |
commit | ab39a09b862a3a59cda9d155750bf3bf8c5fa5af (patch) | |
tree | 0bd1d2c3548371afde7f6c5fac38a9712d042a0d /gtk2_ardour | |
parent | fcb76c8c052e92366bac06446d19b72c1420e514 (diff) |
temporarily ignore AudioEngine::Halted when GUI asks to disconnect from JACK, to avoid warning dialog
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/ardour_ui.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 00767b7988..3c2ed85276 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -398,7 +398,7 @@ ARDOUR_UI::attach_to_engine () engine->Running.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::engine_running, this), gui_context()); engine->SampleRateChanged.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::update_sample_rate, this, _1), gui_context()); - engine->Halted.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false)); + engine->Halted.connect_same_thread (halt_connection, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false)); ARDOUR::Port::set_connecting_blocked (ARDOUR_COMMAND_LINE::no_connect_ports); @@ -1019,6 +1019,7 @@ If you still wish to quit, please use the\n\n\ _session = 0; } + halt_connection.disconnect (); engine->stop (); quit (); } @@ -3822,9 +3823,16 @@ void ARDOUR_UI::disconnect_from_jack () { if (engine) { + /* drop connection to AudioEngine::Halted so that we don't act + * as if the engine unexpectedly shut down + */ + halt_connection.disconnect (); + if (engine->stop ()) { MessageDialog msg (*editor, _("Could not disconnect from JACK")); msg.run (); + } else { + engine->Halted.connect_same_thread (halt_connection, boost::bind (&ARDOUR_UI::engine_halted, this, _1, false)); } update_sample_rate (0); diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index e784b5a994..f8b47bd3e8 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -711,6 +711,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr void loading_message (const std::string& msg); PBD::ScopedConnectionList forever_connections; + PBD::ScopedConnection halt_connection; void step_edit_status_change (bool); |