summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/JackMidiDriver.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-05-20 16:37:41 +0000
committerDavid Robillard <d@drobilla.net>2008-05-20 16:37:41 +0000
commitdfc9f577630309a56a786c78da0bde705a0b2135 (patch)
tree8d4e73af090dd381440ff0b4f33d37e0cd83a953 /src/libs/engine/JackMidiDriver.cpp
parent34093b89423e7d195972e68676c73853228d35f6 (diff)
downloadingen-dfc9f577630309a56a786c78da0bde705a0b2135.tar.gz
ingen-dfc9f577630309a56a786c78da0bde705a0b2135.tar.bz2
ingen-dfc9f577630309a56a786c78da0bde705a0b2135.zip
Fix Jack MIDI output.
git-svn-id: http://svn.drobilla.net/lad/ingen@1224 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/JackMidiDriver.cpp')
-rw-r--r--src/libs/engine/JackMidiDriver.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/libs/engine/JackMidiDriver.cpp b/src/libs/engine/JackMidiDriver.cpp
index d6808fcc..22db1d4b 100644
--- a/src/libs/engine/JackMidiDriver.cpp
+++ b/src/libs/engine/JackMidiDriver.cpp
@@ -107,18 +107,15 @@ JackMidiPort::post_process(ProcessContext& context)
{
if (is_input())
return;
-
- assert(_patch_port->poly() == 1);
EventBuffer* patch_buf = dynamic_cast<EventBuffer*>(_patch_port->buffer(0));
+ void* jack_buf = jack_port_get_buffer(_jack_port, context.nframes());
+
+ assert(_patch_port->poly() == 1);
assert(patch_buf);
- void* jack_buffer = jack_port_get_buffer(_jack_port, context.nframes());
- const jack_nframes_t event_count = patch_buf->event_count();
-
patch_buf->prepare_read(context.nframes());
-
- jack_midi_clear_buffer(jack_buffer);
+ jack_midi_clear_buffer(jack_buf);
uint32_t frames = 0;
uint32_t subframes = 0;
@@ -127,10 +124,9 @@ JackMidiPort::post_process(ProcessContext& context)
uint8_t* data = NULL;
// Copy events from Jack port buffer into patch port buffer
- for (jack_nframes_t i=0; i < event_count; ++i) {
+ for (patch_buf->rewind(); patch_buf->is_valid(); patch_buf->increment()) {
patch_buf->get_event(&frames, &subframes, &type, &size, &data);
- // FIXME: type
- jack_midi_event_write(jack_buffer, frames, data, size);
+ jack_midi_event_write(jack_buf, frames, data, size);
}
//if (event_count)