diff options
author | David Robillard <d@drobilla.net> | 2012-02-18 01:15:43 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-02-18 01:15:43 +0000 |
commit | 719c973b349724657c71b545f4f3d4498d633b23 (patch) | |
tree | f3c6e65aecb0b01ee5d6fb6a5fdbfb2cb87f1c76 /src/jalv.c | |
parent | 21f5ce9b56bc0e0b3a38ee84bdd7e0992485c133 (diff) | |
download | jalv-719c973b349724657c71b545f4f3d4498d633b23.tar.gz jalv-719c973b349724657c71b545f4f3d4498d633b23.tar.bz2 jalv-719c973b349724657c71b545f4f3d4498d633b23.zip |
Implement/fix atom event port UI notifications.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@3985 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/jalv.c')
-rw-r--r-- | src/jalv.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -430,6 +430,21 @@ jack_process_cb(jack_nframes_t nframes, void* data) lv2_evbuf_get(i, &frames, &subframes, &type, &size, &data); jack_midi_event_write(buf, frames, data, size); + + /* TODO: Be more disciminate about what to send */ + if (!port->old_api) { + char buf[sizeof(ControlChange) + sizeof(LV2_Atom)]; + ControlChange* ev = (ControlChange*)buf; + ev->index = p; + ev->protocol = host->atom_prot_id; + ev->size = sizeof(LV2_Atom) + size; + LV2_Atom* atom = (LV2_Atom*)ev->body; + atom->type = type; + atom->size = size; + jack_ringbuffer_write(host->plugin_events, buf, sizeof(buf)); + /* TODO: race, ensure reader handles this correctly */ + jack_ringbuffer_write(host->plugin_events, (void*)data, size); + } } } else if (send_ui_updates && port->flow != FLOW_INPUT @@ -572,7 +587,7 @@ main(int argc, char** argv) host.midi_event_id = uri_to_id(&host, "http://lv2plug.in/ns/ext/event", NS_MIDI "MidiEvent"); - host.atom_prot_id = symap_map(host.symap, NS_ATOM "atomTransfer"); + host.atom_prot_id = symap_map(host.symap, NS_ATOM "eventTransfer"); char* template = jalv_strdup("/tmp/jalv-XXXXXX"); host.temp_dir = jalv_strjoin(mkdtemp(template), "/"); |