diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2019-08-19 13:19:38 -0500 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-08-19 23:28:04 +0200 |
commit | 031847f88ef8c266df97f38fccf094fb0c78356e (patch) | |
tree | f5e1cde2693a1730ae6f1f46354ab3c6f67e8f69 /libs/ardour/lv2_plugin.cc | |
parent | 8775087ea6280d4c553be5579e94e8b84e9b3bad (diff) |
LV2 extension to override strict-i/o per plugin
This allows mono to stereo plugins to override the default
routing and forces both outputs to be connected.
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r-- | libs/ardour/lv2_plugin.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 09c352c39b..6c23472b68 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -202,6 +202,7 @@ public: #endif #ifdef LV2_EXTENDED LilvNode* lv2_noSampleAccurateCtrl; + LilvNode* routing_connectAllOutputs; // lv2:optionalFeature LilvNode* auto_can_write_automatation; // lv2:optionalFeature LilvNode* auto_automation_control; // atom:supports LilvNode* auto_automation_controlled; // lv2:portProperty @@ -369,6 +370,7 @@ LV2Plugin::LV2Plugin (AudioEngine& engine, , _patch_port_out_index((uint32_t)-1) , _uri_map(URIMap::instance()) , _no_sample_accurate_ctrl (false) + , _connect_all_audio_outputs (false) { init(c_plugin, rate); latency_compute_run(); @@ -387,6 +389,7 @@ LV2Plugin::LV2Plugin (const LV2Plugin& other) , _patch_port_out_index((uint32_t)-1) , _uri_map(URIMap::instance()) , _no_sample_accurate_ctrl (false) + , _connect_all_audio_outputs (false) { init(other._impl->plugin, other._sample_rate); @@ -628,6 +631,9 @@ LV2Plugin::init(const void* c_plugin, samplecnt_t rate) /* deprecated 2016-Sep-18 in favor of bufz_coarseBlockLength */ _no_sample_accurate_ctrl = true; } + if (lilv_nodes_contains (optional_features, _world.routing_connectAllOutputs)) { + _connect_all_audio_outputs = true; + } if (lilv_nodes_contains (optional_features, _world.auto_can_write_automatation)) { _can_write_automation = true; } @@ -908,6 +914,12 @@ LV2Plugin::requires_fixed_sized_buffers () const return _no_sample_accurate_ctrl; } +bool +LV2Plugin::connect_all_audio_outputs () const +{ + return _connect_all_audio_outputs; +} + LV2Plugin::~LV2Plugin () { DEBUG_TRACE(DEBUG::LV2, string_compose("%1 destroy\n", name())); @@ -3252,6 +3264,7 @@ LV2World::LV2World() 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); auto_can_write_automatation = lilv_new_uri(world, LV2_AUTOMATE_URI__can_write); auto_automation_control = lilv_new_uri(world, LV2_AUTOMATE_URI__control); auto_automation_controlled = lilv_new_uri(world, LV2_AUTOMATE_URI__controlled); @@ -3275,6 +3288,7 @@ LV2World::~LV2World() lilv_node_free(bufz_powerOf2BlockLength); #ifdef LV2_EXTENDED lilv_node_free(lv2_noSampleAccurateCtrl); + lilv_node_free(routing_connectAllOutputs); lilv_node_free(auto_can_write_automatation); lilv_node_free(auto_automation_control); lilv_node_free(auto_automation_controlled); |