summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-01-31 22:43:21 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2016-01-31 22:43:21 -0500
commit55967972b6dceb38a46f971267466d66a2670862 (patch)
tree962086fc1007c66edb784f405f5cff95b30075ed
parentc66d7e8cf94417666332456beea1ff75e9a82ff0 (diff)
mackie: slightly less fragile/more readable code for compute new controllable values from vpot events
This is still not really right - it doesn't do the right thing, i think, for trim controls
-rw-r--r--libs/surfaces/mackie/strip.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/libs/surfaces/mackie/strip.cc b/libs/surfaces/mackie/strip.cc
index 805a215481..e7f928f02f 100644
--- a/libs/surfaces/mackie/strip.cc
+++ b/libs/surfaces/mackie/strip.cc
@@ -1232,19 +1232,21 @@ Strip::handle_pot (Pot& pot, float delta)
*/
if (delta > 0) {
- ac->set_value (min (ac->upper(), ac->get_value() + 1.0), Controllable::UseGroup);
+ ac->set_value (min (ac->upper(), ac->get_value() + 1.0), gcd);
} else {
- ac->set_value (max (ac->lower(), ac->get_value() - 1.0), Controllable::UseGroup);
+ ac->set_value (max (ac->lower(), ac->get_value() - 1.0), gcd);
}
} else {
- double p = pot.get_value ();
+ double p = ac->get_value();
+
p += delta;
- // fader and pot should be the same and fader is hard coded 0 -> 1
- p = max (0.0, p);
- p = min (1.0, p);
- pot.set_value (p);
+
+ p = max (ac->lower(), p);
+ p = min (ac->upper(), p);
+
+ ac->set_value (p, gcd);
}
}