Browse Source

Define kCVPortIsOptional property and use it for LV2

Signed-off-by: falkTX <falktx@falktx.com>
pull/409/head
falkTX 3 years ago
parent
commit
87e9b0f844
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 9 additions and 0 deletions
  1. +6
    -0
      distrho/DistrhoPlugin.hpp
  2. +3
    -0
      distrho/src/DistrhoPluginLV2export.cpp

+ 6
- 0
distrho/DistrhoPlugin.hpp View File

@@ -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;

/** @} */

/* ------------------------------------------------------------------------------------------------------------


+ 3
- 0
distrho/src/DistrhoPluginLV2export.cpp View File

@@ -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


Loading…
Cancel
Save