Fix MIDI latency measurement
* Restore active state of devices after measurement * Don't manually set latencies for measurement (backend handles this) * remove superfluous call to stop measurement
This commit is contained in:
parent
837678bdcc
commit
ae181f5f66
|
@ -2516,15 +2516,13 @@ EngineControl::push_state_to_backend (bool start)
|
||||||
if (1 /* TODO */) {
|
if (1 /* TODO */) {
|
||||||
for (vector<MidiDeviceSettings>::const_iterator p = _midi_devices.begin(); p != _midi_devices.end(); ++p) {
|
for (vector<MidiDeviceSettings>::const_iterator p = _midi_devices.begin(); p != _midi_devices.end(); ++p) {
|
||||||
if (_measure_midi) {
|
if (_measure_midi) {
|
||||||
|
/* Disable other MIDI devices while measuring.
|
||||||
|
* This is a hack to only show ports from the selected device */
|
||||||
if (*p == _measure_midi) {
|
if (*p == _measure_midi) {
|
||||||
backend->set_midi_device_enabled ((*p)->name, true);
|
backend->set_midi_device_enabled ((*p)->name, true);
|
||||||
} else {
|
} else {
|
||||||
backend->set_midi_device_enabled ((*p)->name, false);
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
backend->set_midi_device_enabled ((*p)->name, (*p)->enabled);
|
backend->set_midi_device_enabled ((*p)->name, (*p)->enabled);
|
||||||
|
@ -2805,6 +2803,17 @@ EngineControl::on_switch_page (GtkNotebookPage*, guint page_num)
|
||||||
if (page_num == midi_tab) {
|
if (page_num == midi_tab) {
|
||||||
/* MIDI tab */
|
/* MIDI tab */
|
||||||
refresh_midi_display ();
|
refresh_midi_display ();
|
||||||
|
|
||||||
|
/* undo special case from push_state_to_backend() when measuring midi latency */
|
||||||
|
if (_measure_midi && ARDOUR::AudioEngine::instance()->running ()) {
|
||||||
|
boost::shared_ptr<ARDOUR::AudioBackend> backend = ARDOUR::AudioEngine::instance()->current_backend();
|
||||||
|
if (backend->can_change_systemic_latency_when_running ()) {
|
||||||
|
for (vector<MidiDeviceSettings>::const_iterator p = _midi_devices.begin(); p != _midi_devices.end(); ++p) {
|
||||||
|
backend->set_midi_device_enabled ((*p)->name, (*p)->enabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_measure_midi.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page_num == latency_tab) {
|
if (page_num == latency_tab) {
|
||||||
|
@ -2850,7 +2859,6 @@ EngineControl::on_switch_page (GtkNotebookPage*, guint page_num)
|
||||||
} else {
|
} else {
|
||||||
if (lm_running) {
|
if (lm_running) {
|
||||||
end_latency_detection ();
|
end_latency_detection ();
|
||||||
ARDOUR::AudioEngine::instance()->stop_latency_detection();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user