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")
This commit is contained in:
Robin Gareus 2018-03-28 00:13:30 +02:00
parent 9840f84830
commit 1de68d7917

View File

@ -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