diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jalv.c | 11 | ||||
-rw-r--r-- | src/jalv_internal.h | 3 |
2 files changed, 13 insertions, 1 deletions
@@ -644,7 +644,7 @@ jack_session_cb(jack_session_event_t* event, void* arg) void jalv_ui_instantiate(Jalv* jalv, const char* native_ui_type, void* parent) { - jalv->ui_host = suil_host_new(jalv_ui_write, NULL, NULL, NULL); + jalv->ui_host = suil_host_new(jalv_ui_write, jalv_ui_port_index, NULL, NULL); const LV2_Feature parent_feature = { LV2_UI__parent, parent @@ -747,6 +747,15 @@ jalv_ui_write(SuilController controller, jack_ringbuffer_write(jalv->ui_events, buf, sizeof(buf)); } +uint32_t +jalv_ui_port_index(SuilController controller, const char* symbol) +{ + Jalv* const jalv = (Jalv*)controller; + struct Port* port = jalv_port_by_symbol(jalv, symbol); + + return port ? port->index : LV2UI_INVALID_PORT_INDEX; +} + bool jalv_emit_ui_events(Jalv* jalv) { diff --git a/src/jalv_internal.h b/src/jalv_internal.h index 8ea45df..5bcb175 100644 --- a/src/jalv_internal.h +++ b/src/jalv_internal.h @@ -237,6 +237,9 @@ jalv_ui_write(SuilController controller, uint32_t protocol, const void* buffer); +uint32_t +jalv_ui_port_index(SuilController controller, const char* port_symbol); + void jalv_ui_port_event(Jalv* jalv, uint32_t port_index, |