diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-26 03:46:18 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-04-26 03:46:18 +0000 |
commit | ec97b8e58d4d476cd340cddfabc388505fb1ef7e (patch) | |
tree | ec3eaa1084dafe54a08d3c453de91b48a4711e9c /libs/surfaces/mackie/pot.cc | |
parent | 2bae75fa0b3d10b844738e0cb5d03c5de23d0c49 (diff) |
MCP: lots of good stuff - recenable bug fixed, cursor keys for vertical scroll work, loop button lights/unlightspan pots don't adjust if there is no panner, etc.
git-svn-id: svn://localhost/ardour2/branches/3.0@12093 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces/mackie/pot.cc')
-rw-r--r-- | libs/surfaces/mackie/pot.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/libs/surfaces/mackie/pot.cc b/libs/surfaces/mackie/pot.cc index 78973b40df..838753bf31 100644 --- a/libs/surfaces/mackie/pot.cc +++ b/libs/surfaces/mackie/pot.cc @@ -42,19 +42,18 @@ Pot::set (float val, bool onoff, Mode mode) { // TODO do an exact calc for 0.50? To allow manually re-centering the port. - // center on or off - MIDI::byte msg = (val > 0.45 && val < 0.55 ? 1 : 0) << 6; + // center on if val is "very close" to 0.50 + MIDI::byte msg = (val > 0.48 && val < 0.58 ? 1 : 0) << 6; - // mode + // Pot/LED mode msg |= (mode << 4); // val, but only if off hasn't explicitly been set - - if (onoff) { + if (onoff) { if (mode == spread) { - msg += (lrintf (val * 6) + 1) & 0x0f; // 0b00001111 + msg |= (lrintf (val * 6) + 1) & 0x0f; // 0b00001111 } else { - msg += (lrintf (val * 10.0) + 1) & 0x0f; // 0b00001111 + msg |= (lrintf (val * 10.0) + 1) & 0x0f; // 0b00001111 } } |