gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit d9e657b94161d42e9b5b51e5fa2934cbb6714059
parent 1fd5b13f81c37c05fdb528c83e1e23f356e09c57
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Tue, 15 Mar 2022 23:24:20 +0100

fix FX page not correctly switching delay/reverb mode

Diffstat:
Msource/jucePlugin/ui3/FxPage.cpp | 16+++++++++++++++-
Msource/jucePlugin/ui3/FxPage.h | 6+++++-
2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/source/jucePlugin/ui3/FxPage.cpp b/source/jucePlugin/ui3/FxPage.cpp @@ -12,11 +12,25 @@ namespace genericVirusUI const auto p = m_editor.getController().getParameter(Virus::Param_DelayReverbMode, 0); if (p) - p->onValueChanged = [this]() { updateReverbDelay(); }; + { + p->getValueObject().addListener(this); + } updateReverbDelay(); } + FxPage::~FxPage() + { + const auto p = m_editor.getController().getParameter(Virus::Param_DelayReverbMode, 0); + if(p) + p->getValueObject().removeListener(this); + } + + void FxPage::valueChanged(juce::Value& value) + { + updateReverbDelay(); + } + void FxPage::updateReverbDelay() const { auto p = m_editor.getController().getParameter(Virus::Param_DelayReverbMode, 0); diff --git a/source/jucePlugin/ui3/FxPage.h b/source/jucePlugin/ui3/FxPage.h @@ -1,5 +1,7 @@ #pragma once +#include <juce_audio_processors/juce_audio_processors.h> + namespace juce { class Component; @@ -9,11 +11,13 @@ namespace genericVirusUI { class VirusEditor; - class FxPage + class FxPage : public juce::Value::Listener { public: explicit FxPage(VirusEditor& _editor); + ~FxPage() override; + void valueChanged(juce::Value& value) override; private: void updateReverbDelay() const;