summaryrefslogtreecommitdiff
path: root/libs/surfaces
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-06-16 03:10:26 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-06-16 03:10:26 +0000
commit9429401f11ffa0ee1729dbdc5e14e87cf06e2dc1 (patch)
tree88ca24008c171c01e7cc7fd4f12498be18de3ca7 /libs/surfaces
parent5b1da330a4eedcece28cc5e040c90663b8b607d5 (diff)
MCP: patch from seablade to fix pot displays (both absolute value and negative values)
git-svn-id: svn://localhost/ardour2/branches/3.0@12739 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces')
-rw-r--r--libs/surfaces/mackie/pot.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/libs/surfaces/mackie/pot.cc b/libs/surfaces/mackie/pot.cc
index 838753bf31..8f0298ea72 100644
--- a/libs/surfaces/mackie/pot.cc
+++ b/libs/surfaces/mackie/pot.cc
@@ -47,11 +47,20 @@ Pot::set (float val, bool onoff, Mode mode)
// Pot/LED mode
msg |= (mode << 4);
+
+ /*
+ * Even though a width value may be negative, there is
+ * technically still width there, it is just reversed,
+ * so make sure to show it on the LED ring appropriately.
+ */
+ if (val < 0){
+ val = val * -1;
+ }
// val, but only if off hasn't explicitly been set
if (onoff) {
if (mode == spread) {
- msg |= (lrintf (val * 6) + 1) & 0x0f; // 0b00001111
+ msg |= (lrintf (val * 6)) & 0x0f; // 0b00001111
} else {
msg |= (lrintf (val * 10.0) + 1) & 0x0f; // 0b00001111
}