summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-03-28 00:13:30 +0200
committerRobin Gareus <robin@gareus.org>2018-03-28 00:18:13 +0200
commit1de68d791725ca80da08261676a4edbe96600ed4 (patch)
treeeab187c28f0bb7073f6cc80cc36871a702e09654
parent9840f848301aec81241b63b597c871a12cfcf571 (diff)
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")
-rw-r--r--gtk2_ardour/automation_controller.cc5
1 files changed, 4 insertions, 1 deletions
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