diff --git a/modules/gin b/modules/gin index cf19899..1c2ff0f 160000 --- a/modules/gin +++ b/modules/gin @@ -1 +1 @@ -Subproject commit cf19899bbcbc2f46132d5f49de6a519b313c0922 +Subproject commit 1c2ff0f34c275feea0ec95074689634416296343 diff --git a/modules/juce b/modules/juce index 22df0d2..a878e04 160000 --- a/modules/juce +++ b/modules/juce @@ -1 +1 @@ -Subproject commit 22df0d2266007bccb25d6ed52b9907f60d04e971 +Subproject commit a878e042e86f9462fc08459e13fcd9bf196e0c69 diff --git a/plugin/Source/Panels.h b/plugin/Source/Panels.h index 697b8b9..1dff914 100644 --- a/plugin/Source/Panels.h +++ b/plugin/Source/Panels.h @@ -250,6 +250,16 @@ public: adsr = new gin::ADSRComponent (); adsr->setParams (preset.attack, preset.decay, preset.sustain, preset.release); + adsr->phaseCallback = [this] + { + std::vector> res; + + for (auto v : proc.getActiveVoices()) + if (auto wtv = dynamic_cast (v)) + res.push_back (wtv->adsr.getCurrentPhase()); + + return res; + }; addControl (adsr, 0, 0, 4, 1); addControl (new gin::Knob (preset.attack), 0, 1); @@ -290,6 +300,19 @@ public: adsr = new gin::ADSRComponent (); adsr->setParams (flt.attack, flt.decay, flt.sustain, flt.release); + adsr->phaseCallback = [this, &flt] + { + std::vector> res; + + if (flt.amount->getUserValue() != 0.0f) + { + for (auto voice : proc.getActiveVoices()) + if (auto wtv = dynamic_cast (voice)) + res.push_back (wtv->filterADSR.getCurrentPhase()); + } + + return res; + }; addControl (adsr, 3, 0, 4, 1); addControl (a = new gin::Knob (flt.attack), 3, 1); @@ -435,6 +458,19 @@ public: auto g = new gin::ADSRComponent(); g->setParams (env.attack, env.decay, env.sustain, env.release); + g->phaseCallback = [this, &env] + { + std::vector> res; + + if (env.enable->isOn()) + { + for (auto v : proc.getActiveVoices()) + if (auto wtv = dynamic_cast (v)) + res.push_back (wtv->modADSRs[idx].getCurrentPhase()); + } + + return res; + }; addControl (g, 0, 0, 4, 1); setSize (112, 163);