From 1de68d791725ca80da08261676a4edbe96600ed4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 28 Mar 2018 00:13:30 +0200 Subject: [PATCH] Sparse update for granular controls on sliders Don't call ::set_value() if the actual value has not changed. e.g. MIDI-CC or integer controls. Moving the Bar-controller was able to create events even though the actual value remained unchanged. This check has to be done UI-side, since the underlying API is also used for state-restore and automation. e.g. "old value" (user-set) may be default "0", "new value" may also be "0" but libardour still needs to send an event (a synth's internal state may not default to "0") --- gtk2_ardour/automation_controller.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index 5502cf5001..0b040a30d9 100644 --- a/gtk2_ardour/automation_controller.cc +++ b/gtk2_ardour/automation_controller.cc @@ -177,7 +177,10 @@ void AutomationController::value_adjusted () { if (!_ignore_change) { - _controllable->set_value (_controllable->interface_to_internal(_adjustment->get_value()), Controllable::NoGroup); + const double new_val = _controllable->interface_to_internal(_adjustment->get_value()); + if (_controllable->user_double() != new_val) { + _controllable->set_value (new_val, Controllable::NoGroup); + } } /* A bar controller will automatically follow the adjustment, but for a