aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jalv.c15
-rw-r--r--src/jalv_internal.h1
-rw-r--r--src/lv2_evbuf.c2
3 files changed, 11 insertions, 7 deletions
diff --git a/src/jalv.c b/src/jalv.c
index 042f7bc..5e836a6 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -464,9 +464,11 @@ jack_process_cb(jack_nframes_t nframes, void* data)
uint32_t frames, subframes, type, size;
uint8_t* data;
lv2_evbuf_get(i, &frames, &subframes, &type, &size, &data);
- assert(size > 0);
- // FIXME: check type
- jack_midi_event_write(buf, frames, data, size);
+ if (type == host->midi_event_id) {
+ jack_midi_event_write(buf, frames, data, size);
+ } else {
+ fprintf(stderr, "Non-MIDI event output type %d\n", type);
+ }
/* TODO: Be more disciminate about what to send */
if (!port->old_api) {
@@ -671,11 +673,12 @@ main(int argc, char** argv)
host.sratom = sratom_new(&host.map);
- host.midi_event_id = uri_to_id(&host,
- "http://lv2plug.in/ns/ext/event",
- NS_MIDI "MidiEvent");
+ host.midi_event_id = uri_to_id(
+ &host, "http://lv2plug.in/ns/ext/event", LV2_MIDI__MidiEvent);
+
host.urids.atom_eventTransfer = symap_map(host.symap, LV2_ATOM__eventTransfer);
host.urids.log_Trace = symap_map(host.symap, LV2_LOG__Trace);
+ host.urids.midi_MidiEvent = symap_map(host.symap, LV2_MIDI__MidiEvent);
host.urids.time_Position = symap_map(host.symap, LV2_TIME__Position);
host.urids.time_bar = symap_map(host.symap, LV2_TIME__bar);
host.urids.time_barBeat = symap_map(host.symap, LV2_TIME__barBeat);
diff --git a/src/jalv_internal.h b/src/jalv_internal.h
index 737abf0..631994d 100644
--- a/src/jalv_internal.h
+++ b/src/jalv_internal.h
@@ -94,6 +94,7 @@ typedef struct {
typedef struct {
LV2_URID atom_eventTransfer;
LV2_URID log_Trace;
+ LV2_URID midi_MidiEvent;
LV2_URID time_Position;
LV2_URID time_bar;
LV2_URID time_barBeat;
diff --git a/src/lv2_evbuf.c b/src/lv2_evbuf.c
index 274d120..e8c9b60 100644
--- a/src/lv2_evbuf.c
+++ b/src/lv2_evbuf.c
@@ -197,7 +197,7 @@ lv2_evbuf_get(LV2_Evbuf_Iterator iter,
switch (iter.evbuf->type) {
case LV2_EVBUF_EVENT:
ebuf = &iter.evbuf->buf.event;
- ev = (LV2_Event*)ebuf->data + iter.offset;
+ ev = (LV2_Event*)((char*)ebuf->data + iter.offset);
*frames = ev->frames;
*subframes = ev->subframes;
*type = ev->type;