diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2015-10-03 11:40:34 +1000 |
---|---|---|
committer | Tim Mayberry <mojofunk@gmail.com> | 2015-10-06 13:29:57 +1000 |
commit | 1195aeb64e785aa9554e2ee3fb7e1b5092ec9bb7 (patch) | |
tree | 24e007c15366be4b672b99c2568cac80b0459bee /gtk2_ardour/engine_dialog.cc | |
parent | 4b9e7386360746232dbdf2609b4e23ef02b0c5e9 (diff) |
Handle all errors when starting backend in EngineDialog
Diffstat (limited to 'gtk2_ardour/engine_dialog.cc')
-rw-r--r-- | gtk2_ardour/engine_dialog.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index 0c172db1b2..f76008cc43 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -407,6 +407,18 @@ EngineControl::on_show () ok_button->grab_focus(); } +bool +EngineControl::start_engine () +{ + if (push_state_to_backend(true) != 0) { + MessageDialog msg(*this, + ARDOUR::AudioEngine::instance()->get_last_backend_error()); + msg.run(); + return false; + } + return true; +} + void EngineControl::on_response (int response_id) { @@ -414,7 +426,7 @@ EngineControl::on_response (int response_id) switch (response_id) { case RESPONSE_OK: - if (push_state_to_backend(true) != 0) { + if (!start_engine()) { return; } else { hide(); @@ -2327,7 +2339,7 @@ EngineControl::push_state_to_backend (bool start) } if (start || (was_running && restart_required)) { - if (ARDOUR_UI::instance()->reconnect_to_engine()) { + if (ARDOUR::AudioEngine::instance()->start()) { return -1; } } @@ -2501,7 +2513,7 @@ EngineControl::start_stop_button_clicked () if (ARDOUR::AudioEngine::instance()->running()) { ARDOUR::AudioEngine::instance()->stop (); } else { - push_state_to_backend (true); + start_engine (); } } |