summaryrefslogtreecommitdiff
path: root/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/surfaces/generic_midi/generic_midi_control_protocol.cc')
-rw-r--r--libs/surfaces/generic_midi/generic_midi_control_protocol.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
index 05a3ef0505..f5f75ce50d 100644
--- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
+++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc
@@ -259,17 +259,18 @@ GenericMidiControlProtocol::_send_feedback ()
const int32_t bufsize = 16 * 1024; /* XXX too big */
MIDI::byte buf[bufsize];
int32_t bsize = bufsize;
- MIDI::byte* end = buf;
-
+
+ /* XXX: due to bugs in some ALSA / JACK MIDI bridges, we have to do separate
+ writes for each controllable here; if we send more than one MIDI message
+ in a single jack_midi_event_write then some bridges will only pass the
+ first on to ALSA.
+ */
for (MIDIControllables::iterator r = controllables.begin(); r != controllables.end(); ++r) {
- end = (*r)->write_feedback (end, bsize);
+ MIDI::byte* end = (*r)->write_feedback (buf, bsize);
+ if (end != buf) {
+ _output_port->write (buf, (int32_t) (end - buf), 0);
+ }
}
-
- if (end == buf) {
- return;
- }
-
- _output_port->write (buf, (int32_t) (end - buf), 0);
}
bool
@@ -574,9 +575,6 @@ GenericMidiControlProtocol::get_feedback () const
return do_feedback;
}
-
-
-
int
GenericMidiControlProtocol::load_bindings (const string& xmlpath)
{
@@ -682,6 +680,8 @@ GenericMidiControlProtocol::create_binding (const XMLNode& node)
ev = MIDI::on;
} else if ((prop = node.property (X_("pgm"))) != 0) {
ev = MIDI::program;
+ } else if ((prop = node.property (X_("pb"))) != 0) {
+ ev = MIDI::pitchbend;
} else {
return 0;
}