From b7efd16e59975f675f5d7d00b321740312e9d5a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hock?= Date: Sat, 23 Dec 2023 10:48:13 +0100 Subject: [PATCH] Dynamically disable slider parent --- src/StftPitchShiftPlugin/Editor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/StftPitchShiftPlugin/Editor.cpp b/src/StftPitchShiftPlugin/Editor.cpp index b262e37..1d06005 100644 --- a/src/StftPitchShiftPlugin/Editor.cpp +++ b/src/StftPitchShiftPlugin/Editor.cpp @@ -118,10 +118,10 @@ Editor::Editor(juce::AudioProcessor& process, std::shared_ptr parame { auto quefrency = parameters->get("quefrency"); - auto* slider = timbre_slider.front(); + auto* component = timbre_slider.front()->getParentComponent(); auto enabled = quefrency > 0; - slider->setEnabled(enabled); + component->setEnabled(enabled); }; const std::array pitch_sliders @@ -140,10 +140,10 @@ Editor::Editor(juce::AudioProcessor& process, std::shared_ptr parame for (int i = 0; i < maxstages; ++i) { - auto* slider = pitch_sliders.at(i); + auto* component = pitch_sliders.at(i)->getParentComponent(); auto enabled = i < stages; - slider->setEnabled(enabled); + component->setEnabled(enabled); } };