commit 87e9b0f8441229815c1cc8b0eb518ae760f9bf47 parent 57fcfcaf07f8dced0f643aff46bd0d3bb1b0b476 Author: falkTX <falktx@falktx.com> Date: Mon, 24 Oct 2022 21:47:08 +0100 Define kCVPortIsOptional property and use it for LV2 Signed-off-by: falkTX <falktx@falktx.com> Diffstat:
M | distrho/DistrhoPlugin.hpp | | | 6 | ++++++ |
M | distrho/src/DistrhoPluginLV2export.cpp | | | 3 | +++ |
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/distrho/DistrhoPlugin.hpp b/distrho/DistrhoPlugin.hpp @@ -72,6 +72,12 @@ static const uint32_t kCVPortHasPositiveUnipolarRange = 0x40; */ static const uint32_t kCVPortHasScaledRange = 0x80; +/** + CV port is optional, allowing hosts that do no CV ports to load the plugin. + When loaded in hosts that don't support CV, the float* buffer for this port will be null. + */ +static const uint32_t kCVPortIsOptional = 0x100; + /** @} */ /* ------------------------------------------------------------------------------------------------------------ diff --git a/distrho/src/DistrhoPluginLV2export.cpp b/distrho/src/DistrhoPluginLV2export.cpp @@ -532,6 +532,9 @@ void lv2_generate_ttl(const char* const basename) } } + if ((port.hints & (kAudioPortIsCV|kCVPortIsOptional)) == (kAudioPortIsCV|kCVPortIsOptional)) + pluginString += " lv2:portProperty lv2:connectionOptional;\n"; + if (i+1 == DISTRHO_PLUGIN_NUM_INPUTS) pluginString += " ] ;\n"; else