Signed-off-by: falkTX <falktx@falktx.com>pull/443/head
@@ -223,6 +223,22 @@ enum ParameterDesignation { | |||||
kParameterDesignationBypass = 1 | kParameterDesignationBypass = 1 | ||||
}; | }; | ||||
/** | |||||
Parameter designation symbols.@n | |||||
These are static, hard-coded definitions to ensure consistency across DPF and plugins. | |||||
*/ | |||||
namespace ParameterDesignationSymbols { | |||||
/** | |||||
Bypass designation symbol. | |||||
*/ | |||||
static constexpr const char bypass[] = "dpf_bypass"; | |||||
/** | |||||
Bypass designation symbol, inverted for LV2 so it becomes "enabled". | |||||
*/ | |||||
static constexpr const char bypass_lv2[] = "lv2_enabled"; | |||||
}; | |||||
/** | /** | ||||
Predefined Port Groups Ids. | Predefined Port Groups Ids. | ||||
@@ -731,7 +747,7 @@ struct Parameter { | |||||
hints = kParameterIsAutomatable|kParameterIsBoolean|kParameterIsInteger; | hints = kParameterIsAutomatable|kParameterIsBoolean|kParameterIsInteger; | ||||
name = "Bypass"; | name = "Bypass"; | ||||
shortName = "Bypass"; | shortName = "Bypass"; | ||||
symbol = "dpf_bypass"; | |||||
symbol = ParameterDesignationSymbols::bypass; | |||||
unit = ""; | unit = ""; | ||||
midiCC = 0; | midiCC = 0; | ||||
groupId = kPortGroupNone; | groupId = kPortGroupNone; | ||||
@@ -749,7 +765,7 @@ struct Parameter { | |||||
*/ | */ | ||||
static constexpr const Parameter kParameterBypass = { | static constexpr const Parameter kParameterBypass = { | ||||
kParameterIsAutomatable|kParameterIsBoolean|kParameterIsInteger, | kParameterIsAutomatable|kParameterIsBoolean|kParameterIsInteger, | ||||
"Bypass", "Bypass", "dpf_bypass", "", "", {}, {}, 0, kPortGroupNone, | |||||
"Bypass", "Bypass", ParameterDesignationSymbols::bypass, "", "", {}, {}, 0, kPortGroupNone, | |||||
}; | }; | ||||
#endif | #endif | ||||
@@ -748,7 +748,7 @@ void lv2_generate_ttl(const char* const basename) | |||||
case kParameterDesignationBypass: | case kParameterDesignationBypass: | ||||
designated = true; | designated = true; | ||||
pluginString += " lv2:name \"Enabled\" ;\n"; | pluginString += " lv2:name \"Enabled\" ;\n"; | ||||
pluginString += " lv2:symbol \"" DISTRHO_BYPASS_PARAMETER_NAME "\" ;\n"; | |||||
pluginString += " lv2:symbol \"" + String(ParameterDesignationSymbols::bypass_lv2) + "\" ;\n"; | |||||
pluginString += " lv2:default 1 ;\n"; | pluginString += " lv2:default 1 ;\n"; | ||||
pluginString += " lv2:minimum 0 ;\n"; | pluginString += " lv2:minimum 0 ;\n"; | ||||
pluginString += " lv2:maximum 1 ;\n"; | pluginString += " lv2:maximum 1 ;\n"; | ||||
@@ -1684,7 +1684,7 @@ void lv2_generate_ttl(const char* const basename) | |||||
if (plugin.getParameterDesignation(j) == kParameterDesignationBypass) | if (plugin.getParameterDesignation(j) == kParameterDesignationBypass) | ||||
{ | { | ||||
parameterSymbol = DISTRHO_BYPASS_PARAMETER_NAME; | |||||
parameterSymbol = ParameterDesignationSymbols::bypass_lv2; | |||||
parameterValue = 1.0f - parameterValue; | parameterValue = 1.0f - parameterValue; | ||||
} | } | ||||
@@ -88,7 +88,7 @@ public: | |||||
fController(controller), | fController(controller), | ||||
fWriteFunction(writeFunc), | fWriteFunction(writeFunc), | ||||
fURIDs(uridMap), | fURIDs(uridMap), | ||||
fBypassParameterIndex(fUiPortMap != nullptr ? fUiPortMap->port_index(fUiPortMap->handle, "lv2_enabled") | |||||
fBypassParameterIndex(fUiPortMap != nullptr ? fUiPortMap->port_index(fUiPortMap->handle, ParameterDesignationSymbols::bypass_lv2) | |||||
: LV2UI_INVALID_PORT_INDEX), | : LV2UI_INVALID_PORT_INDEX), | ||||
fWinIdWasNull(winId == 0), | fWinIdWasNull(winId == 0), | ||||
fUI(this, winId, sampleRate, | fUI(this, winId, sampleRate, | ||||