From 5a1fc0ddc9760282ea79b8b5eab7b61755d45239 Mon Sep 17 00:00:00 2001 From: Daniel Appelt Date: Fri, 14 Jun 2024 09:57:33 +0200 Subject: [PATCH] LV2: Ignore connection optional ports --- libs/ardour/lv2_plugin.cc | 111 +++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 54 deletions(-) diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index ce753c9d7f..c21229886a 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -186,6 +186,7 @@ public: LilvNode* lv2_ControlPort; LilvNode* lv2_InputPort; LilvNode* lv2_OutputPort; + LilvNode* lv2_connectionOptional; LilvNode* lv2_designation; LilvNode* lv2_enumeration; LilvNode* lv2_freewheeling; @@ -837,7 +838,7 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate) lilv_nodes_free(min_size_v); lilv_nodes_free(buffer_types); lilv_nodes_free(atom_supports); - } else { + } else if (!lilv_port_has_property(_impl->plugin, port, _world.lv2_connectionOptional)) { error << string_compose( "LV2: \"%1\" port %2 has no known data type", lilv_node_as_string(_impl->name), i) << endmsg; @@ -3494,58 +3495,59 @@ LV2World::LV2World() : world(lilv_world_new()) , _bundle_checked(false) { - atom_AtomPort = lilv_new_uri(world, LV2_ATOM__AtomPort); - atom_Chunk = lilv_new_uri(world, LV2_ATOM__Chunk); - atom_Sequence = lilv_new_uri(world, LV2_ATOM__Sequence); - atom_bufferType = lilv_new_uri(world, LV2_ATOM__bufferType); - atom_supports = lilv_new_uri(world, LV2_ATOM__supports); - atom_eventTransfer = lilv_new_uri(world, LV2_ATOM__eventTransfer); - ev_EventPort = lilv_new_uri(world, LILV_URI_EVENT_PORT); - ext_logarithmic = lilv_new_uri(world, LV2_PORT_PROPS__logarithmic); - ext_notOnGUI = lilv_new_uri(world, LV2_PORT_PROPS__notOnGUI); - ext_expensive = lilv_new_uri(world, LV2_PORT_PROPS__expensive); - ext_causesArtifacts= lilv_new_uri(world, LV2_PORT_PROPS__causesArtifacts); - ext_notAutomatic = lilv_new_uri(world, LV2_PORT_PROPS__notAutomatic); - ext_rangeSteps = lilv_new_uri(world, LV2_PORT_PROPS__rangeSteps); - ext_displayPriority= lilv_new_uri(world, LV2_PORT_PROPS__displayPriority); - groups_group = lilv_new_uri(world, LV2_PORT_GROUPS__group); - groups_element = lilv_new_uri(world, LV2_PORT_GROUPS__element); - lv2_AudioPort = lilv_new_uri(world, LILV_URI_AUDIO_PORT); - lv2_ControlPort = lilv_new_uri(world, LILV_URI_CONTROL_PORT); - lv2_InputPort = lilv_new_uri(world, LILV_URI_INPUT_PORT); - lv2_OutputPort = lilv_new_uri(world, LILV_URI_OUTPUT_PORT); - lv2_inPlaceBroken = lilv_new_uri(world, LV2_CORE__inPlaceBroken); - lv2_isSideChain = lilv_new_uri(world, LV2_CORE_PREFIX "isSideChain"); - lv2_index = lilv_new_uri(world, LV2_CORE__index); - lv2_integer = lilv_new_uri(world, LV2_CORE__integer); - lv2_default = lilv_new_uri(world, LV2_CORE__default); - lv2_minimum = lilv_new_uri(world, LV2_CORE__minimum); - lv2_maximum = lilv_new_uri(world, LV2_CORE__maximum); - lv2_reportsLatency = lilv_new_uri(world, LV2_CORE__reportsLatency); - lv2_sampleRate = lilv_new_uri(world, LV2_CORE__sampleRate); - lv2_toggled = lilv_new_uri(world, LV2_CORE__toggled); - lv2_designation = lilv_new_uri(world, LV2_CORE__designation); - lv2_enumeration = lilv_new_uri(world, LV2_CORE__enumeration); - lv2_freewheeling = lilv_new_uri(world, LV2_CORE__freeWheeling); - midi_MidiEvent = lilv_new_uri(world, LILV_URI_MIDI_EVENT); - rdfs_comment = lilv_new_uri(world, LILV_NS_RDFS "comment"); - rdfs_label = lilv_new_uri(world, LILV_NS_RDFS "label"); - rdfs_range = lilv_new_uri(world, LILV_NS_RDFS "range"); - rsz_minimumSize = lilv_new_uri(world, LV2_RESIZE_PORT__minimumSize); - time_Position = lilv_new_uri(world, LV2_TIME__Position); - time_beatsPerMin = lilv_new_uri(world, LV2_TIME__beatsPerMinute); - ui_GtkUI = lilv_new_uri(world, LV2_UI__GtkUI); - ui_X11UI = lilv_new_uri(world, LV2_UI__X11UI); - ui_external = lilv_new_uri(world, "http://lv2plug.in/ns/extensions/ui#external"); - ui_externalkx = lilv_new_uri(world, "http://kxstudio.sf.net/ns/lv2ext/external-ui#Widget"); - units_unit = lilv_new_uri(world, LV2_UNITS__unit); - units_render = lilv_new_uri(world, LV2_UNITS__render); - units_hz = lilv_new_uri(world, LV2_UNITS__hz); - units_midiNote = lilv_new_uri(world, LV2_UNITS__midiNote); - units_db = lilv_new_uri(world, LV2_UNITS__db); - patch_writable = lilv_new_uri(world, LV2_PATCH__writable); - patch_Message = lilv_new_uri(world, LV2_PATCH__Message); - opts_requiredOptions = lilv_new_uri(world, LV2_OPTIONS__requiredOption); + atom_AtomPort = lilv_new_uri(world, LV2_ATOM__AtomPort); + atom_Chunk = lilv_new_uri(world, LV2_ATOM__Chunk); + atom_Sequence = lilv_new_uri(world, LV2_ATOM__Sequence); + atom_bufferType = lilv_new_uri(world, LV2_ATOM__bufferType); + atom_supports = lilv_new_uri(world, LV2_ATOM__supports); + atom_eventTransfer = lilv_new_uri(world, LV2_ATOM__eventTransfer); + ev_EventPort = lilv_new_uri(world, LILV_URI_EVENT_PORT); + ext_logarithmic = lilv_new_uri(world, LV2_PORT_PROPS__logarithmic); + ext_notOnGUI = lilv_new_uri(world, LV2_PORT_PROPS__notOnGUI); + ext_expensive = lilv_new_uri(world, LV2_PORT_PROPS__expensive); + ext_causesArtifacts = lilv_new_uri(world, LV2_PORT_PROPS__causesArtifacts); + ext_notAutomatic = lilv_new_uri(world, LV2_PORT_PROPS__notAutomatic); + ext_rangeSteps = lilv_new_uri(world, LV2_PORT_PROPS__rangeSteps); + ext_displayPriority = lilv_new_uri(world, LV2_PORT_PROPS__displayPriority); + groups_group = lilv_new_uri(world, LV2_PORT_GROUPS__group); + groups_element = lilv_new_uri(world, LV2_PORT_GROUPS__element); + lv2_AudioPort = lilv_new_uri(world, LILV_URI_AUDIO_PORT); + lv2_ControlPort = lilv_new_uri(world, LILV_URI_CONTROL_PORT); + lv2_InputPort = lilv_new_uri(world, LILV_URI_INPUT_PORT); + lv2_OutputPort = lilv_new_uri(world, LILV_URI_OUTPUT_PORT); + lv2_connectionOptional = lilv_new_uri(world, LV2_CORE__connectionOptional); + lv2_inPlaceBroken = lilv_new_uri(world, LV2_CORE__inPlaceBroken); + lv2_isSideChain = lilv_new_uri(world, LV2_CORE_PREFIX "isSideChain"); + lv2_index = lilv_new_uri(world, LV2_CORE__index); + lv2_integer = lilv_new_uri(world, LV2_CORE__integer); + lv2_default = lilv_new_uri(world, LV2_CORE__default); + lv2_minimum = lilv_new_uri(world, LV2_CORE__minimum); + lv2_maximum = lilv_new_uri(world, LV2_CORE__maximum); + lv2_reportsLatency = lilv_new_uri(world, LV2_CORE__reportsLatency); + lv2_sampleRate = lilv_new_uri(world, LV2_CORE__sampleRate); + lv2_toggled = lilv_new_uri(world, LV2_CORE__toggled); + lv2_designation = lilv_new_uri(world, LV2_CORE__designation); + lv2_enumeration = lilv_new_uri(world, LV2_CORE__enumeration); + lv2_freewheeling = lilv_new_uri(world, LV2_CORE__freeWheeling); + midi_MidiEvent = lilv_new_uri(world, LILV_URI_MIDI_EVENT); + rdfs_comment = lilv_new_uri(world, LILV_NS_RDFS "comment"); + rdfs_label = lilv_new_uri(world, LILV_NS_RDFS "label"); + rdfs_range = lilv_new_uri(world, LILV_NS_RDFS "range"); + rsz_minimumSize = lilv_new_uri(world, LV2_RESIZE_PORT__minimumSize); + time_Position = lilv_new_uri(world, LV2_TIME__Position); + time_beatsPerMin = lilv_new_uri(world, LV2_TIME__beatsPerMinute); + ui_GtkUI = lilv_new_uri(world, LV2_UI__GtkUI); + ui_X11UI = lilv_new_uri(world, LV2_UI__X11UI); + ui_external = lilv_new_uri(world, "http://lv2plug.in/ns/extensions/ui#external"); + ui_externalkx = lilv_new_uri(world, "http://kxstudio.sf.net/ns/lv2ext/external-ui#Widget"); + units_unit = lilv_new_uri(world, LV2_UNITS__unit); + units_render = lilv_new_uri(world, LV2_UNITS__render); + units_hz = lilv_new_uri(world, LV2_UNITS__hz); + units_midiNote = lilv_new_uri(world, LV2_UNITS__midiNote); + units_db = lilv_new_uri(world, LV2_UNITS__db); + patch_writable = lilv_new_uri(world, LV2_PATCH__writable); + patch_Message = lilv_new_uri(world, LV2_PATCH__Message); + opts_requiredOptions = lilv_new_uri(world, LV2_OPTIONS__requiredOption); #ifdef LV2_EXTENDED lv2_noSampleAccurateCtrl = lilv_new_uri(world, "http://ardour.org/lv2/ext#noSampleAccurateControls"); // deprecated 2016-09-18 routing_connectAllOutputs = lilv_new_uri(world, LV2_ROUTING__connectAllOutputs); @@ -3616,6 +3618,7 @@ LV2World::~LV2World() lilv_node_free(lv2_integer); lilv_node_free(lv2_isSideChain); lilv_node_free(lv2_inPlaceBroken); + lilv_node_free(lv2_connectionOptional); lilv_node_free(lv2_OutputPort); lilv_node_free(lv2_InputPort); lilv_node_free(lv2_ControlPort); @@ -3971,7 +3974,7 @@ LV2PluginInfo::discover (boost::function