13
0

Handle all errors when starting backend in EngineDialog

This commit is contained in:
Tim Mayberry 2015-10-03 11:40:34 +10:00
parent 4b9e738636
commit 1195aeb64e
2 changed files with 16 additions and 3 deletions

View File

@ -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 ();
}
}

View File

@ -299,6 +299,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
int push_state_to_backend (bool start);
void post_push ();
void update_sensitivity ();
bool start_engine ();
/* latency measurement */
void latency_button_clicked ();