summaryrefslogtreecommitdiff
path: root/libs/surfaces/mackie/pot.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-04-12 21:02:43 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-04-12 21:02:43 +0000
commit939801a8d87a56f98ffdc9bb96f1c11e299f4edf (patch)
treeabd5010e33426866d8cda99b5ac751e610edeeb1 /libs/surfaces/mackie/pot.cc
parentb4235221abb9708424b3baa1068e1e70765aa989 (diff)
MCP: start generalizing mapping between surface controls and ARDOUR::AutomationControl; simplify flip mode; more good stuff
git-svn-id: svn://localhost/ardour2/branches/3.0@11949 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces/mackie/pot.cc')
-rw-r--r--libs/surfaces/mackie/pot.cc15
1 files changed, 4 insertions, 11 deletions
diff --git a/libs/surfaces/mackie/pot.cc b/libs/surfaces/mackie/pot.cc
index d21a18f6ae..1320512e92 100644
--- a/libs/surfaces/mackie/pot.cc
+++ b/libs/surfaces/mackie/pot.cc
@@ -48,17 +48,10 @@ Pot::set_onoff (bool onoff)
return update_message ();
}
-MidiByteArray
-Pot::set_value (float normalized)
-{
- value = normalized;
- return update_message ();
-}
-
MidiByteArray
Pot::set_all (float val, bool onoff, Mode m)
{
- value = val;
+ position = val;
on = onoff;
mode = m;
return update_message ();
@@ -70,15 +63,15 @@ Pot::update_message ()
// TODO do an exact calc for 0.50? To allow manually re-centering the port.
// center on or off
- MIDI::byte msg = (value > 0.45 && value < 0.55 ? 1 : 0) << 6;
+ MIDI::byte msg = (position > 0.45 && position < 0.55 ? 1 : 0) << 6;
// mode
msg |= (mode << 4);
- // value, but only if off hasn't explicitly been set
+ // position, but only if off hasn't explicitly been set
if (on) {
- msg += (lrintf (value * 10.0) + 1) & 0x0f; // 0b00001111
+ msg += (lrintf (position * 10.0) + 1) & 0x0f; // 0b00001111
}
/* outbound LED message requires 0x20 to be added to the LED's id