mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 12:16:30 +01:00
Generic MIDI: do not send touch events for all mapped controlers
Previously a start-touch was sent for any bound MIDI Controllable on each incoming MIDI Control event.
This commit is contained in:
parent
d3f536a7ff
commit
72cac07ae7
1 changed files with 106 additions and 104 deletions
|
|
@ -327,6 +327,10 @@ MIDIControllable::midi_sense_note (Parser &, EventTwoBytes *msg, bool /*is_on*/)
|
|||
void
|
||||
MIDIControllable::midi_sense_controller (Parser &, EventTwoBytes *msg)
|
||||
{
|
||||
if (control_additional != msg->controller_number) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_controllable) {
|
||||
if (lookup_controllable ()) {
|
||||
return;
|
||||
|
|
@ -337,8 +341,6 @@ MIDIControllable::midi_sense_controller (Parser &, EventTwoBytes *msg)
|
|||
|
||||
_surface->maybe_start_touch (_controllable);
|
||||
|
||||
if (control_additional == msg->controller_number) {
|
||||
|
||||
if (!_controllable->is_toggle()) {
|
||||
if (get_encoder() == No_enc) {
|
||||
float new_value = msg->value;
|
||||
|
|
@ -442,12 +444,15 @@ MIDIControllable::midi_sense_controller (Parser &, EventTwoBytes *msg)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MIDIControllable::midi_sense_program_change (Parser &, MIDI::byte msg)
|
||||
{
|
||||
if (msg != control_additional) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_controllable) {
|
||||
if (lookup_controllable ()) {
|
||||
return;
|
||||
|
|
@ -458,8 +463,6 @@ MIDIControllable::midi_sense_program_change (Parser &, MIDI::byte msg)
|
|||
|
||||
_surface->maybe_start_touch (_controllable);
|
||||
|
||||
if (msg == control_additional) {
|
||||
|
||||
if (!_controllable->is_toggle()) {
|
||||
_controllable->set_value (1.0, Controllable::UseGroup);
|
||||
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("MIDI program %1 value 1.0 %3\n", (int) msg, current_uri() ));
|
||||
|
|
@ -468,7 +471,6 @@ MIDIControllable::midi_sense_program_change (Parser &, MIDI::byte msg)
|
|||
_controllable->set_value (new_value, Controllable::UseGroup);
|
||||
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("MIDI program %1 value %2 %3\n", (int) msg, (float) new_value, current_uri()));
|
||||
}
|
||||
}
|
||||
|
||||
last_value = (MIDI::byte) (_controllable->get_value() * 127.0); // to prevent feedback fights
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue