Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
jatinchowdhury18 committed Feb 2, 2024
1 parent 862a556 commit ad54ee3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
Binary file modified res/presets/Init.chowpreset
Binary file not shown.
44 changes: 22 additions & 22 deletions src/gui/BandSplitter/BandSplitterChyron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,32 @@ BandSplitterChyron::BandSplitterChyron (chowdsp::PluginState& pluginState,

void BandSplitterChyron::updateValues()
{
cutoffSliderLow.reset();
cutoffSliderMid.reset();
cutoffSliderHigh.reset();
cutoffSlider1.reset();
cutoffSlider2.reset();
cutoffSlider3.reset();

auto bandState = bandSplitterParams.getCurrentBandState();
cutoffSliderLow.emplace (state, bandSplitterParams.cutoff.get(), &hostContextProvider);
cutoffSlider1.emplace (state, bandSplitterParams.cutoff.get(), &hostContextProvider);
if (bandState == dsp::band_splitter::BandState::TwoBands)
cutoffSliderLow->setName ("Cutoff");
cutoffSlider1->setName ("Cutoff");
else
cutoffSliderLow->setName ("Cutoff Low");
addAndMakeVisible (*cutoffSliderLow);
cutoffSlider1->setName ("Cutoff Low");
addAndMakeVisible (*cutoffSlider1);

if (bandState != dsp::band_splitter::BandState::TwoBands)
{
cutoffSliderMid.emplace (state, bandSplitterParams.cutoff2.get(), &hostContextProvider);
cutoffSlider2.emplace (state, bandSplitterParams.cutoff2.get(), &hostContextProvider);
if (bandState == dsp::band_splitter::BandState::ThreeBands)
cutoffSliderMid->setName ("Cutoff High");
cutoffSlider2->setName ("Cutoff High");
else
cutoffSliderMid->setName ("Cutoff Mid");
addAndMakeVisible (*cutoffSliderMid);
cutoffSlider2->setName ("Cutoff Mid");
addAndMakeVisible (*cutoffSlider2);
}
if (bandState == dsp::band_splitter::BandState::FourBands)
{
cutoffSliderHigh.emplace (state, bandSplitterParams.cutoff3.get(), &hostContextProvider);
cutoffSliderHigh->setName ("Cutoff High");
addAndMakeVisible (*cutoffSliderHigh);
cutoffSlider3.emplace (state, bandSplitterParams.cutoff3.get(), &hostContextProvider);
cutoffSlider3->setName ("Cutoff High");
addAndMakeVisible (*cutoffSlider3);
}
resized();
}
Expand All @@ -64,22 +64,22 @@ void BandSplitterChyron::resized()
auto bounds = getLocalBounds();
const auto sliderBounds = bounds.withHeight (proportionOfHeight (1.0f / 3.0f));

if (cutoffSliderMid.has_value() && cutoffSliderHigh.has_value())
if (cutoffSlider2.has_value() && cutoffSlider3.has_value())
{
const auto fourthHeight = proportionOfHeight (1.0f / 4.0f);
cutoffSliderLow->setBounds (sliderBounds.withCentre ({ bounds.getCentreX(), fourthHeight }).reduced (proportionOfWidth (0.025f), 0));
cutoffSliderMid->setBounds (sliderBounds.withCentre ({ bounds.getCentreX(), 2 * fourthHeight }).reduced (proportionOfWidth (0.025f), 0));
cutoffSliderHigh->setBounds (sliderBounds.withCentre ({ bounds.getCentreX(), 3 * fourthHeight }).reduced (proportionOfWidth (0.025f), 0));
cutoffSlider1->setBounds (sliderBounds.withCentre ({ bounds.getCentreX(), fourthHeight }).reduced (proportionOfWidth (0.025f), 0));
cutoffSlider2->setBounds (sliderBounds.withCentre ({ bounds.getCentreX(), 2 * fourthHeight }).reduced (proportionOfWidth (0.025f), 0));
cutoffSlider3->setBounds (sliderBounds.withCentre ({ bounds.getCentreX(), 3 * fourthHeight }).reduced (proportionOfWidth (0.025f), 0));
}
else if (cutoffSliderMid.has_value())
else if (cutoffSlider2.has_value())
{
const auto thirdHeight = proportionOfHeight (1.0f / 3.0f);
cutoffSliderLow->setBounds (sliderBounds.withCentre ({ bounds.getCentreX(), thirdHeight }).reduced (proportionOfWidth (0.025f), 0));
cutoffSliderMid->setBounds (sliderBounds.withCentre ({ bounds.getCentreX(), 2 * thirdHeight }).reduced (proportionOfWidth (0.025f), 0));
cutoffSlider1->setBounds (sliderBounds.withCentre ({ bounds.getCentreX(), thirdHeight }).reduced (proportionOfWidth (0.025f), 0));
cutoffSlider2->setBounds (sliderBounds.withCentre ({ bounds.getCentreX(), 2 * thirdHeight }).reduced (proportionOfWidth (0.025f), 0));
}
else
{
cutoffSliderLow->setBounds (sliderBounds.withCentre (bounds.getCentre()).reduced (proportionOfWidth (0.025f), 0));
cutoffSlider1->setBounds (sliderBounds.withCentre (bounds.getCentre()).reduced (proportionOfWidth (0.025f), 0));
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/gui/BandSplitter/BandSplitterChyron.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class BandSplitterChyron : public juce::Component
chowdsp::PluginState& state;
dsp::band_splitter::Params& bandSplitterParams;

std::optional<TextSlider> cutoffSliderLow;
std::optional<TextSlider> cutoffSliderMid;
std::optional<TextSlider> cutoffSliderHigh;
std::optional<TextSlider> cutoffSlider1;
std::optional<TextSlider> cutoffSlider2;
std::optional<TextSlider> cutoffSlider3;

chowdsp::ScopedCallbackList callbacks;
const chowdsp::HostContextProvider& hostContextProvider;
Expand Down

0 comments on commit ad54ee3

Please sign in to comment.