diff options
author | Len Ovens <len@ovenwerks.net> | 2015-07-09 18:23:14 -0700 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-07-10 16:52:43 -0400 |
commit | a29b0508839ec3aed45b6f5b9305228883b078ca (patch) | |
tree | fcedade899f26dee0ed93e09b2a7e95da7141182 /libs/surfaces | |
parent | 6349570fb24b03694e814dfff344faea92659054 (diff) |
Fixed generic MIDI program change event size to two bytes (fixes #6426)
Diffstat (limited to 'libs/surfaces')
-rw-r--r-- | libs/surfaces/generic_midi/midicontrollable.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/surfaces/generic_midi/midicontrollable.cc b/libs/surfaces/generic_midi/midicontrollable.cc index b427bef03b..89df2cbdea 100644 --- a/libs/surfaces/generic_midi/midicontrollable.cc +++ b/libs/surfaces/generic_midi/midicontrollable.cc @@ -470,12 +470,16 @@ MIDIControllable::write_feedback (MIDI::byte* buf, int32_t& bufsize, bool /*forc DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("Feedback: %1 %2\n", control_description(), current_uri())); *buf++ = (0xF0 & control_type) | (0xF & control_channel); - + int ev_size = 3; switch (control_type) { case MIDI::pitchbend: *buf++ = int (gm) & 127; *buf++ = (int (gm) >> 7) & 127; break; + case MIDI::program: + *buf++ = control_additional; /* program number */ + ev_size = 2; + break; default: *buf++ = control_additional; /* controller number */ *buf++ = gm; @@ -484,7 +488,7 @@ MIDIControllable::write_feedback (MIDI::byte* buf, int32_t& bufsize, bool /*forc DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("MIDI out: Type %1 Channel %2 Bytes %3 %4\n", (int) control_type, (int) control_channel , (int) *(buf - 2), (int) *(buf - 1))); last_value = gm; - bufsize -= 3; + bufsize -= ev_size; return buf; } |