13
0

try to prevent crash if running latency calibration with JACK setup that is lacking input or output ports (re: #5721 and #5719)

This commit is contained in:
Paul Davis 2013-10-15 13:15:03 -04:00
parent df13a8c0b1
commit 6e0a3c4853
2 changed files with 35 additions and 7 deletions

View File

@ -336,7 +336,7 @@ EngineControl::EngineControl ()
basic_packer.attach (*label, 0, 1, 0, 1, xopt, (AttachOptions) 0);
basic_packer.attach (backend_combo, 1, 2, 0, 1, xopt, (AttachOptions) 0);
lm_button.signal_clicked.connect (sigc::bind (sigc::mem_fun (notebook, &Gtk::Notebook::set_current_page), latency_tab));
lm_button.signal_clicked.connect (sigc::mem_fun (*this, &EngineControl::calibrate_latency));
lm_button.set_name ("record enable button");
if (_have_control) {
build_full_control_notebook ();
@ -514,14 +514,34 @@ EngineControl::EngineControl ()
EngineControl::enable_latency_tab ()
{
vector<string> outputs;
ARDOUR::AudioEngine::instance()->get_physical_outputs (ARDOUR::DataType::AUDIO, outputs);
set_popdown_strings (lm_output_channel_combo, outputs);
lm_output_channel_combo.set_active_text (outputs.front());
vector<string> inputs;
ARDOUR::AudioEngine::instance()->get_physical_outputs (ARDOUR::DataType::AUDIO, outputs);
ARDOUR::AudioEngine::instance()->get_physical_inputs (ARDOUR::DataType::AUDIO, inputs);
set_popdown_strings (lm_input_channel_combo, inputs);
lm_input_channel_combo.set_active_text (inputs.front());
if (inputs.empty() || outputs.empty()) {
MessageDialog msg (_("Your selected audio configuration is playback- or capture-only.\n\nLatency calibration requires playback and capture"));
lm_measure_button.set_sensitive (false);
notebook.set_current_page (0);
msg.run ();
return;
}
if (!outputs.empty()) {
set_popdown_strings (lm_output_channel_combo, outputs);
lm_output_channel_combo.set_active_text (outputs.front());
lm_output_channel_combo.set_sensitive (true);
} else {
lm_output_channel_combo.set_sensitive (false);
}
if (!inputs.empty()) {
set_popdown_strings (lm_input_channel_combo, inputs);
lm_input_channel_combo.set_active_text (inputs.front());
lm_input_channel_combo.set_sensitive (true);
} else {
lm_input_channel_combo.set_sensitive (false);
}
lm_measure_button.set_sensitive (true);
}
@ -1795,3 +1815,10 @@ EngineControl::connect_disconnect_click()
ARDOUR_UI::instance()->reconnect_to_engine ();
}
}
void
EngineControl::calibrate_latency ()
{
notebook.set_current_page (latency_tab);
}

View File

@ -212,6 +212,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
PBD::ScopedConnection stopped_connection;
void connect_disconnect_click ();
void calibrate_latency ();
};
#endif /* __gtk2_ardour_engine_dialog_h__ */