summaryrefslogtreecommitdiff
path: root/libs/surfaces/generic_midi/midicontrollable.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-01-17 14:48:17 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2013-01-17 14:48:17 +0000
commit5adcb61f6059bb5554ee6da7a7dba6c65b6100f0 (patch)
tree6cf248d039a0bd6639238ceb046fe6e869ef1c36 /libs/surfaces/generic_midi/midicontrollable.cc
parent4ecb07aaee57e72aedb744f0cce885f418320e70 (diff)
a few small fixes that help pitchbend control of things, notably the shuttle controller. but note that basically, teh shuttle controller is completely and hopelessly broken through excess complexity and incorrect design
git-svn-id: svn://localhost/ardour2/branches/3.0@13870 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/surfaces/generic_midi/midicontrollable.cc')
-rw-r--r--libs/surfaces/generic_midi/midicontrollable.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc
index 71021e9c84..488ac557bb 100644
--- a/libs/surfaces/generic_midi/midicontrollable.cc
+++ b/libs/surfaces/generic_midi/midicontrollable.cc
@@ -122,6 +122,8 @@ MIDIControllable::set_controllable (Controllable* c)
controllable = c;
+ last_controllable_value = controllable->get_value();
+
if (controllable) {
controllable->Destroyed.connect (controllable_death_connection, MISSING_INVALIDATOR,
boost::bind (&MIDIControllable::drop_controllable, this),
@@ -228,7 +230,6 @@ MIDIControllable::lookup_controllable()
void
MIDIControllable::drop_controllable ()
{
- cerr << "removed controllable " << controllable << "\n";
set_controllable (0);
}
@@ -272,6 +273,7 @@ MIDIControllable::midi_sense_controller (Parser &, EventTwoBytes *msg)
if (control_additional == msg->controller_number) {
if (!controllable->is_toggle()) {
+
float new_value = msg->value;
float max_value = max(last_controllable_value, new_value);
float min_value = min(last_controllable_value, new_value);