summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hosts/jack_compat.h9
-rw-r--r--hosts/lv2_jack_host.c5
2 files changed, 14 insertions, 0 deletions
diff --git a/hosts/jack_compat.h b/hosts/jack_compat.h
index 792148e..a1f710d 100644
--- a/hosts/jack_compat.h
+++ b/hosts/jack_compat.h
@@ -45,6 +45,15 @@ jack_midi_event_get_compat(
#define jack_midi_event_get jack_midi_event_get_compat
+void
+jack_midi_clear_buffer_compat(
+ void * port_buffer)
+{
+ jack_midi_clear_buffer(port_buffer, 0);
+}
+
+#define jack_midi_clear_buffer jack_midi_clear_buffer_compat
+
#else
#if defined(HAVE_OLD_JACK_MIDI)
diff --git a/hosts/lv2_jack_host.c b/hosts/lv2_jack_host.c
index 93a17e1..62fe0e9 100644
--- a/hosts/lv2_jack_host.c
+++ b/hosts/lv2_jack_host.c
@@ -294,8 +294,13 @@ jack_process_cb(jack_nframes_t nframes, void* data)
for (uint32_t i=0; i < event_count; ++i) {
lv2midi_get_event(&state, &timestamp, &size, &data);
+#if defined(JACK_MIDI_NEEDS_NFRAMES)
+ jack_midi_event_write(jack_buffer,
+ (jack_nframes_t)timestamp, data, size, nframes);
+#else
jack_midi_event_write(jack_buffer,
(jack_nframes_t)timestamp, data, size);
+#endif
lv2midi_increment(&state);
}