mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 09:36:33 +01:00
end latency detection if AMS window closed while running detection (plus some non-functioning changes to try to get spinbutton text entry to work
This commit is contained in:
parent
2a3dfb5e82
commit
cb31e34a5c
2 changed files with 55 additions and 19 deletions
|
|
@ -67,7 +67,7 @@ EngineControl::EngineControl ()
|
||||||
, output_channels (output_channels_adjustment)
|
, output_channels (output_channels_adjustment)
|
||||||
, ports_adjustment (128, 8, 1024, 1, 16)
|
, ports_adjustment (128, 8, 1024, 1, 16)
|
||||||
, ports_spinner (ports_adjustment)
|
, ports_spinner (ports_adjustment)
|
||||||
, control_app_button (_("Launch Control App"))
|
, control_app_button (_("Device Control Panel"))
|
||||||
, lm_start_stop_label (_("Measure latency"))
|
, lm_start_stop_label (_("Measure latency"))
|
||||||
, lm_use_button (_("Use results"))
|
, lm_use_button (_("Use results"))
|
||||||
, lm_table (5, 2)
|
, lm_table (5, 2)
|
||||||
|
|
@ -113,6 +113,13 @@ EngineControl::on_response (int response_id)
|
||||||
push_state_to_backend (true);
|
push_state_to_backend (true);
|
||||||
hide ();
|
hide ();
|
||||||
break;
|
break;
|
||||||
|
case RESPONSE_DELETE_EVENT: {
|
||||||
|
GdkEventButton ev;
|
||||||
|
ev.type = GDK_BUTTON_PRESS;
|
||||||
|
ev.button = 1;
|
||||||
|
on_delete_event ((GdkEventAny*) &ev);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
hide ();
|
hide ();
|
||||||
}
|
}
|
||||||
|
|
@ -171,17 +178,22 @@ EngineControl::build_notebook ()
|
||||||
row++;
|
row++;
|
||||||
|
|
||||||
|
|
||||||
|
input_channels.set_editable (true);
|
||||||
|
|
||||||
label = manage (left_aligned_label (_("Input Channels:")));
|
label = manage (left_aligned_label (_("Input Channels:")));
|
||||||
basic_packer.attach (*label, 0, 1, row, row+1, xopt, (AttachOptions) 0);
|
basic_packer.attach (*label, 0, 1, row, row+1, xopt, (AttachOptions) 0);
|
||||||
basic_packer.attach (input_channels, 1, 2, row, row+1, xopt, (AttachOptions) 0);
|
basic_packer.attach (input_channels, 1, 2, row, row+1, xopt, (AttachOptions) 0);
|
||||||
++row;
|
++row;
|
||||||
|
|
||||||
|
output_channels.set_editable (true);
|
||||||
|
|
||||||
label = manage (left_aligned_label (_("Output Channels:")));
|
label = manage (left_aligned_label (_("Output Channels:")));
|
||||||
basic_packer.attach (*label, 0, 1, row, row+1, xopt, (AttachOptions) 0);
|
basic_packer.attach (*label, 0, 1, row, row+1, xopt, (AttachOptions) 0);
|
||||||
basic_packer.attach (output_channels, 1, 2, row, row+1, xopt, (AttachOptions) 0);
|
basic_packer.attach (output_channels, 1, 2, row, row+1, xopt, (AttachOptions) 0);
|
||||||
++row;
|
++row;
|
||||||
|
|
||||||
|
input_latency.set_numeric (true);
|
||||||
|
input_latency.set_editable (true);
|
||||||
|
|
||||||
label = manage (left_aligned_label (_("Hardware input latency:")));
|
label = manage (left_aligned_label (_("Hardware input latency:")));
|
||||||
basic_packer.attach (*label, 0, 1, row, row+1, xopt, (AttachOptions) 0);
|
basic_packer.attach (*label, 0, 1, row, row+1, xopt, (AttachOptions) 0);
|
||||||
|
|
@ -1125,10 +1137,8 @@ EngineControl::check_latency_measurement ()
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EngineControl::latency_button_toggled ()
|
EngineControl::start_latency_detection ()
|
||||||
{
|
{
|
||||||
if (lm_measure_button.get_active ()) {
|
|
||||||
|
|
||||||
ARDOUR::AudioEngine::instance()->set_latency_input_port (lm_input_channel_combo.get_active_text());
|
ARDOUR::AudioEngine::instance()->set_latency_input_port (lm_input_channel_combo.get_active_text());
|
||||||
ARDOUR::AudioEngine::instance()->set_latency_output_port (lm_output_channel_combo.get_active_text());
|
ARDOUR::AudioEngine::instance()->set_latency_output_port (lm_output_channel_combo.get_active_text());
|
||||||
ARDOUR::AudioEngine::instance()->start_latency_detection ();
|
ARDOUR::AudioEngine::instance()->start_latency_detection ();
|
||||||
|
|
@ -1138,7 +1148,11 @@ EngineControl::latency_button_toggled ()
|
||||||
have_lm_results = false;
|
have_lm_results = false;
|
||||||
lm_input_channel_combo.set_sensitive (false);
|
lm_input_channel_combo.set_sensitive (false);
|
||||||
lm_output_channel_combo.set_sensitive (false);
|
lm_output_channel_combo.set_sensitive (false);
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EngineControl::end_latency_detection ()
|
||||||
|
{
|
||||||
ARDOUR::AudioEngine::instance()->stop_latency_detection ();
|
ARDOUR::AudioEngine::instance()->stop_latency_detection ();
|
||||||
latency_timeout.disconnect ();
|
latency_timeout.disconnect ();
|
||||||
lm_start_stop_label.set_text (_("Measure latency"));
|
lm_start_stop_label.set_text (_("Measure latency"));
|
||||||
|
|
@ -1147,6 +1161,15 @@ EngineControl::latency_button_toggled ()
|
||||||
}
|
}
|
||||||
lm_input_channel_combo.set_sensitive (true);
|
lm_input_channel_combo.set_sensitive (true);
|
||||||
lm_output_channel_combo.set_sensitive (true);
|
lm_output_channel_combo.set_sensitive (true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
EngineControl::latency_button_toggled ()
|
||||||
|
{
|
||||||
|
if (lm_measure_button.get_active ()) {
|
||||||
|
start_latency_detection ();
|
||||||
|
} else {
|
||||||
|
end_latency_detection ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1166,3 +1189,13 @@ EngineControl::use_latency_button_clicked ()
|
||||||
input_latency_adjustment.set_value (one_way);
|
input_latency_adjustment.set_value (one_way);
|
||||||
output_latency_adjustment.set_value (one_way);
|
output_latency_adjustment.set_value (one_way);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
EngineControl::on_delete_event (GdkEventAny* ev)
|
||||||
|
{
|
||||||
|
if (notebook.get_current_page() == 2) {
|
||||||
|
/* currently on latency tab - be sure to clean up */
|
||||||
|
end_latency_detection ();
|
||||||
|
}
|
||||||
|
return ArdourDialog::on_delete_event (ev);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -181,8 +181,11 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
|
||||||
sigc::connection latency_timeout;
|
sigc::connection latency_timeout;
|
||||||
void enable_latency_tab ();
|
void enable_latency_tab ();
|
||||||
void disable_latency_tab ();
|
void disable_latency_tab ();
|
||||||
|
void start_latency_detection ();
|
||||||
|
void end_latency_detection ();
|
||||||
|
|
||||||
void on_switch_page (GtkNotebookPage*, guint page_num);
|
void on_switch_page (GtkNotebookPage*, guint page_num);
|
||||||
|
bool on_delete_event (GdkEventAny*);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __gtk2_ardour_engine_dialog_h__ */
|
#endif /* __gtk2_ardour_engine_dialog_h__ */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue