From a89dcbcd2009b6bade1cd98932082e6ce41344f2 Mon Sep 17 00:00:00 2001 From: Stefano D'Angelo Date: Sun, 15 Dec 2024 23:29:21 +0100 Subject: [PATCH] fix lv2 template bug (ui with no output params was broken) --- templates/lv2/src/lv2.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/templates/lv2/src/lv2.c b/templates/lv2/src/lv2.c index 787c25b..39fd934 100644 --- a/templates/lv2/src/lv2.c +++ b/templates/lv2/src/lv2.c @@ -449,11 +449,18 @@ static void ui_port_event(LV2UI_Handle handle, uint32_t port_index, uint32_t buf (void)format; ui_instance *instance = (ui_instance *)handle; +# if DATA_PRODUCT_CONTROL_INPUTS_N > 0 if (port_index < CONTROL_OUTPUT_INDEX_OFFSET) { size_t index = port_index - CONTROL_INPUT_INDEX_OFFSET; plugin_ui_set_parameter(instance->ui, param_data[index].index, adjust_param(index, *((float *)buffer))); - } else + } +# endif +# if DATA_PRODUCT_CONTROL_OUTPUTS_N > 0 +# if DATA_PRODUCT_CONTROL_INPUTS_N > 0 + else +# endif plugin_ui_set_parameter(instance->ui, param_out_index[port_index - CONTROL_OUTPUT_INDEX_OFFSET], *((float *)buffer)); +# endif } # endif