From 03aa65af234a4da6c0422406ac567ce2e88753c7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 18 Dec 2020 21:45:22 +0100 Subject: Ignore ports with nonsense lv2:control designations --- NEWS | 3 ++- src/jalv.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 5c62ec7..9b11d8c 100644 --- a/NEWS +++ b/NEWS @@ -2,10 +2,11 @@ jalv (1.6.5) unstable; * Add a command line argument to select a specific UI * Explicitly support lv2:inPlaceBroken + * Ignore ports with nonsense lv2:control designations * Remove Jack session support * Support port events for ui:showInterface UIs - -- David Robillard Mon, 14 Dec 2020 14:39:31 +0000 + -- David Robillard Fri, 18 Dec 2020 20:45:03 +0000 jalv (1.6.4) stable; diff --git a/src/jalv.c b/src/jalv.c index 8f90ed3..9fc221e 100644 --- a/src/jalv.c +++ b/src/jalv.c @@ -238,7 +238,14 @@ jalv_create_ports(Jalv* jalv) const LilvPort* control_input = lilv_plugin_get_port_by_designation( jalv->plugin, jalv->nodes.lv2_InputPort, jalv->nodes.lv2_control); if (control_input) { - jalv->control_in = lilv_port_get_index(jalv->plugin, control_input); + const uint32_t index = lilv_port_get_index(jalv->plugin, control_input); + if (jalv->ports[index].type == TYPE_EVENT) { + jalv->control_in = index; + } else { + fprintf(stderr, + "warning: Non-event port %u has lv2:control designation, " + "ignored\n"); + } } free(default_values); -- cgit v1.2.1