diff --git a/src/CardinalPlugin.cpp b/src/CardinalPlugin.cpp index 1f90343..a8ff551 100644 --- a/src/CardinalPlugin.cpp +++ b/src/CardinalPlugin.cpp @@ -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) { diff --git a/src/CardinalUI.cpp b/src/CardinalUI.cpp index 9958f2a..2858ab2 100644 --- a/src/CardinalUI.cpp +++ b/src/CardinalUI.cpp @@ -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;