From 4c8f562053e20e926d750cea85cf5d257475c3e6 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 18 May 2020 23:01:44 +0200 Subject: Better version of 24ca53f97 (engine dialog, MIDI calibration) --- gtk2_ardour/engine_dialog.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index f71941fe04..cdb2bdfbd1 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -1033,6 +1033,11 @@ EngineControl::refresh_midi_display (std::string focus) midi_device_table.attach (*l, 2, 3, row, row + 1, xopt, AttachOptions (0)); row++; + /* Don't autostart engine for MIDI latency compensation, only allow to configure when running + * or when the engine is stopped after calibration (otherwise ardour proceeds to load session). + */ + bool allow_calibration = ARDOUR::AudioEngine::instance()->running() || !backend->can_change_systemic_latency_when_running (); + for (vector::const_iterator p = _midi_devices.begin(); p != _midi_devices.end(); ++p) { ArdourButton *m; Gtk::Button* b; @@ -1067,14 +1072,9 @@ EngineControl::refresh_midi_display (std::string focus) b = manage (new Button (_("Calibrate"))); b->signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &EngineControl::calibrate_midi_latency), *p)); - b->set_sensitive (_can_set_midi_latencies && enabled); + b->set_sensitive (_can_set_midi_latencies && enabled && allow_calibration); midi_device_table.attach (*b, 3, 4, row, row + 1, xopt, AttachOptions (0)); b->show (); - /* Don't autostart engine for MIDI latency compensation, only allow to configure when running - * or when the engine is stopped after calibration (otherwise ardour proceeds to load session). - */ - b->set_sensitive (ARDOUR::AudioEngine::instance()->running() || !backend->can_change_systemic_latency_when_running ()); - row++; } } -- cgit v1.2.3