From dfc9f577630309a56a786c78da0bde705a0b2135 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 20 May 2008 16:37:41 +0000 Subject: Fix Jack MIDI output. git-svn-id: http://svn.drobilla.net/lad/ingen@1224 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/JackMidiDriver.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/libs/engine/JackMidiDriver.cpp') 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(_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) -- cgit v1.2.1