Add (unused) bypass parameter, for future-proofing
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
88ab133e9b
commit
9ac12eb0f4
2 changed files with 25 additions and 6 deletions
|
|
@ -433,7 +433,7 @@ class CardinalPlugin : public CardinalBasePlugin
|
|||
|
||||
public:
|
||||
CardinalPlugin()
|
||||
: CardinalBasePlugin(kModuleParameters + kWindowParameterCount, 0, kCardinalStateCount),
|
||||
: CardinalBasePlugin(kModuleParameters + kWindowParameterCount + 1, 0, kCardinalStateCount),
|
||||
fInitializer(this),
|
||||
#if DISTRHO_PLUGIN_NUM_INPUTS != 0
|
||||
fAudioBufferCopy(nullptr),
|
||||
|
|
@ -607,6 +607,12 @@ protected:
|
|||
return;
|
||||
}
|
||||
|
||||
if (index == kModuleParameters)
|
||||
{
|
||||
parameter.initDesignation(kParameterDesignationBypass);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef HEADLESS
|
||||
switch (index - kModuleParameters)
|
||||
{
|
||||
|
|
@ -748,11 +754,17 @@ protected:
|
|||
|
||||
float getParameterValue(uint32_t index) const override
|
||||
{
|
||||
// host mapped parameters
|
||||
if (index < kModuleParameters)
|
||||
return context->parameters[index];
|
||||
|
||||
// bypass
|
||||
if (index == kModuleParameters)
|
||||
return 0.0f;
|
||||
|
||||
#ifndef HEADLESS
|
||||
index -= kModuleParameters;
|
||||
// window related parameters
|
||||
index -= kModuleParameters + 1;
|
||||
|
||||
if (index < kWindowParameterCount)
|
||||
return fWindowParameters[index];
|
||||
|
|
@ -763,14 +775,20 @@ protected:
|
|||
|
||||
void setParameterValue(uint32_t index, float value) override
|
||||
{
|
||||
// host mapped parameters
|
||||
if (index < kModuleParameters)
|
||||
{
|
||||
context->parameters[index] = value;
|
||||
return;
|
||||
}
|
||||
|
||||
// bypass
|
||||
if (index == kModuleParameters)
|
||||
return;
|
||||
|
||||
#ifndef HEADLESS
|
||||
index -= kModuleParameters;
|
||||
// window related parameters
|
||||
index -= kModuleParameters + 1;
|
||||
|
||||
if (index < kWindowParameterCount)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ public:
|
|||
return;
|
||||
}
|
||||
|
||||
setParameterValue(kModuleParameters + param, value * mult);
|
||||
setParameterValue(kModuleParameters + param + 1, value * mult);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
@ -462,10 +462,11 @@ protected:
|
|||
*/
|
||||
void parameterChanged(const uint32_t index, const float value) override
|
||||
{
|
||||
if (index < kModuleParameters)
|
||||
// host mapped parameters + bypass
|
||||
if (index <= kModuleParameters)
|
||||
return;
|
||||
|
||||
switch (index - kModuleParameters)
|
||||
switch (index - kModuleParameters - 1)
|
||||
{
|
||||
case kWindowParameterShowTooltips:
|
||||
windowParameters.tooltips = value > 0.5f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue