commit 2980483e3a439083631792cdd6bfad4850763cca
parent 684ed18e17c4389135d8f7a4357a6139b098c708
Author: falkTX <falktx@falktx.com>
Date: Sun, 25 Feb 2024 09:57:37 +0100
Add DPF_VST3_DONT_USE_BRAND_ID to fix compat with existing plugins
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/distrho/DistrhoInfo.hpp b/distrho/DistrhoInfo.hpp
@@ -677,7 +677,9 @@ START_NAMESPACE_DISTRHO
/**
A 4-character symbol that identifies a brand or manufacturer, with at least one non-lower case character.@n
Plugins from the same brand should use the same symbol.
- @note This macro is required when building AU plugins
+ @note This macro is required when building AU plugins, and used for VST3 if present
+ @note Setting this macro will change the uid of a VST3 plugin.
+ If you already released a DPF-based VST3 plugin make sure to also enable DISTRHO_PLUGIN_VST3_OLD_ID_COMPAT
*/
#define DISTRHO_PLUGIN_BRAND_ID Dstr
@@ -878,6 +880,12 @@ START_NAMESPACE_DISTRHO
#define DPF_VST_SHOW_PARAMETER_OUTPUTS
/**
+ Forcibly ignore DISTRHO_PLUGIN_BRAND_ID for VST3 plugins.@n
+ This is required for DPF-based VST3 plugins that got released without setting DISTRHO_PLUGIN_BRAND_ID first.
+ */
+#define DPF_VST3_DONT_USE_BRAND_ID
+
+/**
Disable all file browser related code.@n
Must be set as compiler macro when building DGL. (e.g. `CXXFLAGS="-DDGL_FILE_BROWSER_DISABLED"`)
*/
diff --git a/distrho/src/DistrhoPluginVST3.cpp b/distrho/src/DistrhoPluginVST3.cpp
@@ -92,7 +92,7 @@ static constexpr const uint32_t dpf_id_view = d_cconst('v', 'i', 'e', 'w');
// --------------------------------------------------------------------------------------------------------------------
// plugin specific uids (values are filled in during plugin init)
-#ifdef DISTRHO_PLUGIN_BRAND_ID
+#if defined(DISTRHO_PLUGIN_BRAND_ID) && !defined(DPF_VST3_DONT_USE_BRAND_ID)
static constexpr const uint32_t dpf_id_brand = d_cconst(STRINGIFY(DISTRHO_PLUGIN_BRAND_ID));
#else
static constexpr const uint32_t dpf_id_brand = 0;