Skip to content

Commit

Permalink
finally the pieces are in. WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseDiazRohena committed Dec 26, 2023
1 parent dfed5fd commit c051316
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
32 changes: 29 additions & 3 deletions src/gui/panels/ValentineCenterPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ inline const juce::String kSaturateSliderText = "SATURATE";
inline const juce::String kRatioSliderText = "RATIO";
inline const juce::String kAttackSliderText = "ATTACK";
inline const juce::String kReleaseSliderText = "RELEASE";
inline const juce::String kOutputSliderText = "OUTPUT";
inline const juce::String kMixSliderText = "MIX";
} // namespace detail

CenterPanel::CenterPanel (ValentineAudioProcessor& processor)
Expand Down Expand Up @@ -48,6 +50,13 @@ CenterPanel::CenterPanel (ValentineAudioProcessor& processor)
, releaseSlider (detail::kReleaseSliderText,
parameterID (VParameter::release),
processor.treeState)
, clipEnableButton (parameterID (VParameter::outputClipEnable), processor.treeState)
, outputSlider (detail::kOutputSliderText,
parameterID (VParameter::makeupGain),
processor.treeState)
, mixSlider (detail::kMixSliderText,
parameterID (VParameter::dryWet),
processor.treeState)
{
addAndMakeVisible (crushEnableButton);
addAndMakeVisible (crushSlider);
Expand All @@ -58,6 +67,9 @@ CenterPanel::CenterPanel (ValentineAudioProcessor& processor)
addAndMakeVisible (ratioSlider);
addAndMakeVisible (attackSlider);
addAndMakeVisible (releaseSlider);
addAndMakeVisible (clipEnableButton);
addAndMakeVisible (outputSlider);
addAndMakeVisible (mixSlider);
}

CenterPanel::~CenterPanel()
Expand Down Expand Up @@ -103,18 +115,18 @@ void CenterPanel::resized()

// We want the buttons to be centered vertically, and need the button bounds to
// be square;
const auto buttonSpacer =
const auto topRowButtonSpacer =
juce::roundToInt ((topRowSliders.getHeight() - topRowButtonWidth) * .5f);

crushEnableButton.setBounds (
topRowSliders.removeFromLeft (topRowButtonWidth).reduced (0, buttonSpacer));
topRowSliders.removeFromLeft (topRowButtonWidth).reduced (0, topRowButtonSpacer));

crushSlider.setBounds (topRowSliders.removeFromLeft (topRowSliderWidth));

compressSlider.setBounds (topRowSliders.removeFromLeft (topRowSliderWidth));

saturateEnableButton.setBounds (
topRowSliders.removeFromLeft (topRowButtonWidth).reduced (0, buttonSpacer));
topRowSliders.removeFromLeft (topRowButtonWidth).reduced (0, topRowButtonSpacer));

saturateSlider.setBounds (topRowSliders.removeFromLeft (topRowSliderWidth));

Expand Down Expand Up @@ -153,6 +165,20 @@ void CenterPanel::resized()
ratioSlider.setBounds (bottomRowComponents.removeFromLeft (bottomRowSliderWidth));
attackSlider.setBounds (bottomRowComponents.removeFromLeft (bottomRowSliderWidth));
releaseSlider.setBounds (bottomRowComponents.removeFromLeft (bottomRowSliderWidth));

// Kludging this for now. There is a much better way of finding this...
// but I don't want to figure it out rn.
bottomRowComponents.removeFromLeft (bottomRowSliderWidth * .6f);

// We want the buttons to be centered vertically, and need the button bounds to
// be square;
const auto bottomRowButtonSpacer =
juce::roundToInt ((bottomRowComponents.getHeight() - bottomRowButtonWidth) * .5f);

clipEnableButton.setBounds (bottomRowComponents.removeFromLeft (bottomRowButtonWidth)
.reduced (0, bottomRowButtonSpacer));
outputSlider.setBounds (bottomRowComponents.removeFromLeft (bottomRowSliderWidth));
mixSlider.setBounds (bottomRowComponents.removeFromLeft (bottomRowSliderWidth));
}
} // namespace tote_bag
} // namespace valentine
4 changes: 4 additions & 0 deletions src/gui/panels/ValentineCenterPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ class CenterPanel : public juce::Component
LabelSlider attackSlider;
LabelSlider releaseSlider;

ToggleButton clipEnableButton;
LabelSlider outputSlider;
LabelSlider mixSlider;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CenterPanel)
};
} // namespace valentine
Expand Down

0 comments on commit c051316

Please sign in to comment.