Engine Dialog: fix various signal connections

connect/disconnect button was connected multiple times
Also the button allowed to start a backend with
invalid settings (after changing backend).

Q: does “Connect to” make sense? It’s redundant with 
“Apply”.
This commit is contained in:
Robin Gareus 2015-01-17 21:02:00 +01:00
parent f77c923bee
commit d2cbb28f79
2 changed files with 9 additions and 3 deletions

View File

@ -298,6 +298,10 @@ EngineControl::EngineControl ()
output_channels.signal_changed().connect (sigc::mem_fun (*this, &EngineControl::parameter_changed));
notebook.signal_switch_page().connect (sigc::mem_fun (*this, &EngineControl::on_switch_page));
connect_disconnect_button.signal_clicked().connect (sigc::mem_fun (*this, &EngineControl::connect_disconnect_click));
connect_disconnect_button.set_no_show_all();
}
void
@ -512,8 +516,6 @@ EngineControl::build_no_control_notebook ()
row++;
}
connect_disconnect_button.signal_clicked().connect (sigc::mem_fun (*this, &EngineControl::connect_disconnect_click));
basic_packer.attach (connect_disconnect_button, 0, 2, row, row+1, FILL, AttachOptions (0));
row++;
}
@ -759,6 +761,8 @@ EngineControl::backend_changed ()
}
}
connect_disconnect_button.hide();
midi_option_changed();
started_at_least_once = false;
@ -2109,6 +2113,7 @@ EngineControl::engine_running ()
sample_rate_combo.set_sensitive (true);
connect_disconnect_button.set_label (string_compose (_("Disconnect from %1"), backend->name()));
connect_disconnect_button.show();
started_at_least_once = true;
}
@ -2121,6 +2126,7 @@ EngineControl::engine_stopped ()
buffer_size_combo.set_sensitive (false);
connect_disconnect_button.set_label (string_compose (_("Connect to %1"), backend->name()));
connect_disconnect_button.show();
sample_rate_combo.set_sensitive (true);
buffer_size_combo.set_sensitive (true);

View File

@ -246,7 +246,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
void engine_running ();
void engine_stopped ();
PBD::ScopedConnection running_connection;
PBD::ScopedConnection stopped_connection;
PBD::ScopedConnectionList stopped_connection;
void connect_disconnect_click ();
void calibrate_audio_latency ();