From 321316718877918b2d248423b54fbb737a6630e1 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 2 Oct 2025 20:00:13 +0200 Subject: [PATCH] LV2: don't hide bypass/enabled port.. .. and remove non-standard, deprecated bypass/enable extension --- libs/ardour/ardour/lv2_extensions.h | 32 ----------------------------- libs/ardour/lv2_plugin.cc | 23 +++++++-------------- 2 files changed, 7 insertions(+), 48 deletions(-) diff --git a/libs/ardour/ardour/lv2_extensions.h b/libs/ardour/ardour/lv2_extensions.h index 0ff97d6770..d9906f9e90 100644 --- a/libs/ardour/ardour/lv2_extensions.h +++ b/libs/ardour/ardour/lv2_extensions.h @@ -154,38 +154,6 @@ typedef struct _LV2_License_Interface { @} */ -/** - @defgroup lv2bypass Plugin-provided bypass - - A port with the designation "processing#enable" must - control a plugin's internal bypass mode. - - If the port value is larger than zero the plugin processes - normally. - - If the port value is zero, the plugin is expected to bypass - all signals unmodified. - - The plugin is responsible for providing a click-free transition - between the states. - - (values less than zero are reserved for future use: - e.g click-free insert/removal of latent plugins. - Generally values <= 0 are to be treated as bypassed.) - - lv2:designation ; - - @{ -*/ - -#define LV2_PROCESSING_URI "http://ardour.org/lv2/processing" -#define LV2_PROCESSING_URI_PREFIX LV2_PROCESSING_URI "#" -#define LV2_PROCESSING_URI__enable LV2_PROCESSING_URI_PREFIX "enable" - -/** - @} -*/ - /** @defgroup lv2routing plugin port/routing control diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 401a83a9d0..c8265c7645 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -196,6 +196,7 @@ public: LilvNode* lv2_connectionOptional; LilvNode* lv2_designation; LilvNode* lv2_enumeration; + LilvNode* lv2_enabled; LilvNode* lv2_freewheeling; LilvNode* lv2_inPlaceBroken; LilvNode* lv2_isSideChain; @@ -2595,8 +2596,11 @@ LV2Plugin::describe_parameter(Evoral::Parameter which) const LilvPort* port = lilv_plugin_get_port_by_index(_impl->plugin, which.id()); - if (lilv_port_has_property(_impl->plugin, port, _world.ext_notOnGUI)) { - return X_("hidden"); + if (lilv_port_has_property(_impl->plugin, port, _world.ext_notOnGUI)) { // + const LilvPort* bypass = lilv_plugin_get_port_by_designation(_impl->plugin, _world.lv2_InputPort, _world.lv2_enabled); + if (port != bypass) { + return X_("hidden"); + } } const LilvPort* fwport = lilv_plugin_get_port_by_designation(_impl->plugin, _world.lv2_InputPort, _world.lv2_freewheeling); @@ -3405,23 +3409,10 @@ uint32_t LV2Plugin::designated_bypass_port () { const LilvPort* port = NULL; - LilvNode* designation = lilv_new_uri (_world.world, LV2_CORE_PREFIX "enabled"); - port = lilv_plugin_get_port_by_designation ( - _impl->plugin, _world.lv2_InputPort, designation); - lilv_node_free(designation); + port = lilv_plugin_get_port_by_designation (_impl->plugin, _world.lv2_InputPort, _world.lv2_enabled); if (port) { return lilv_port_get_index (_impl->plugin, port); } -#ifdef LV2_EXTENDED - /* deprecated on 2016-Sep-18 in favor of lv2:enabled */ - designation = lilv_new_uri (_world.world, LV2_PROCESSING_URI__enable); - port = lilv_plugin_get_port_by_designation ( - _impl->plugin, _world.lv2_InputPort, designation); - lilv_node_free(designation); - if (port) { - return lilv_port_get_index (_impl->plugin, port); - } -#endif return UINT32_MAX; }