summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-12-04 17:34:46 +0100
committerRobin Gareus <robin@gareus.org>2015-12-04 17:34:46 +0100
commit2529b9db963b1dba66cdfeda94d938cf09ab4873 (patch)
tree5391c63f5db5948990a633720689c27ac4eb4878
parent95f91d9dbd5cbd801c3cb7f0c277fea94f289342 (diff)
GUI handling for live latency-measurement
-rw-r--r--gtk2_ardour/engine_dialog.cc14
-rw-r--r--gtk2_ardour/engine_dialog.h2
2 files changed, 10 insertions, 6 deletions
diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc
index 3019c169d8..8c0694713d 100644
--- a/gtk2_ardour/engine_dialog.cc
+++ b/gtk2_ardour/engine_dialog.cc
@@ -421,9 +421,9 @@ EngineControl::start_engine ()
}
bool
-EngineControl::stop_engine ()
+EngineControl::stop_engine (bool for_latency)
{
- if (ARDOUR::AudioEngine::instance()->stop()) {
+ if (ARDOUR::AudioEngine::instance()->stop(for_latency)) {
MessageDialog msg(*this,
ARDOUR::AudioEngine::instance()->get_last_backend_error());
msg.run();
@@ -2301,7 +2301,8 @@ EngineControl::push_state_to_backend (bool start)
/* determine if we need to stop the backend before changing parameters */
- if (change_driver || change_device || change_channels || change_latency ||
+ if (change_driver || change_device || change_channels ||
+ (change_latency && !backend->can_change_systemic_latency_when_running ()) ||
(change_rate && !backend->can_change_sample_rate_when_running()) ||
change_midi ||
(change_bufsize && !backend->can_change_buffer_size_when_running())) {
@@ -2379,6 +2380,10 @@ EngineControl::push_state_to_backend (bool start)
} else {
backend->set_midi_device_enabled ((*p)->name, false);
}
+ if (backend->can_change_systemic_latency_when_running ()) {
+ backend->set_systemic_midi_input_latency ((*p)->name, 0);
+ backend->set_systemic_midi_output_latency ((*p)->name, 0);
+ }
continue;
}
backend->set_midi_device_enabled ((*p)->name, (*p)->enabled);
@@ -2630,8 +2635,7 @@ EngineControl::on_switch_page (GtkNotebookPage*, guint page_num)
/* latency tab */
if (ARDOUR::AudioEngine::instance()->running()) {
- // TODO - mark as 'stopped for latency
- stop_engine ();
+ stop_engine (true);
}
{
diff --git a/gtk2_ardour/engine_dialog.h b/gtk2_ardour/engine_dialog.h
index bfb094deea..aa768bc890 100644
--- a/gtk2_ardour/engine_dialog.h
+++ b/gtk2_ardour/engine_dialog.h
@@ -304,7 +304,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
void post_push ();
void update_sensitivity ();
bool start_engine ();
- bool stop_engine ();
+ bool stop_engine (bool for_latency = false);
/* latency measurement */
void latency_button_clicked ();