Skip to content

Commit

Permalink
Dynamically disable slider parent
Browse files Browse the repository at this point in the history
  • Loading branch information
jurihock committed Dec 23, 2023
1 parent b2c803b commit b7efd16
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/StftPitchShiftPlugin/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ Editor::Editor(juce::AudioProcessor& process, std::shared_ptr<Parameters> parame
{
auto quefrency = parameters->get<float>("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<juce::Slider*, 5> pitch_sliders
Expand All @@ -140,10 +140,10 @@ Editor::Editor(juce::AudioProcessor& process, std::shared_ptr<Parameters> 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);
}
};

Expand Down

0 comments on commit b7efd16

Please sign in to comment.