feedback for toggled MIDI controls now sends 0 or 127, not various in-between values (should fix #5117, without any bad side-effects

git-svn-id: svn://localhost/ardour2/branches/3.0@13680 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis
2012-12-19 01:28:41 +00:00
parent 99c848455a
commit 37906d067e

View File

@@ -163,6 +163,14 @@ MIDIControllable::control_to_midi (float val)
float control_max = controllable->upper ();
const float control_range = control_max - control_min;
if (controllable->is_toggle()) {
if (val >= (control_min + (control_range/2.0f))) {
return max_value_for_type();
} else {
return 0;
}
}
return (val - control_min) / control_range * max_value_for_type ();
}