diff --git a/src/gui/panels/ValentineCenterPanel.cpp b/src/gui/panels/ValentineCenterPanel.cpp index d7071da3..2da5f72d 100644 --- a/src/gui/panels/ValentineCenterPanel.cpp +++ b/src/gui/panels/ValentineCenterPanel.cpp @@ -15,21 +15,33 @@ namespace valentine namespace detail { inline const juce::String kCrushSliderText = "CRUSH"; +inline const juce::String kCompressSliderText = "COMPRESS"; +inline const juce::String kSaturateSliderText = "SATURATE"; } // namespace detail CenterPanel::CenterPanel (ValentineAudioProcessor& processor) : borderLineThickness (0.0f) , borderCornerSize (0.0f) + , crushEnableButton (parameterID (VParameter::crushEnable), processor.treeState) , crushSlider (detail::kCrushSliderText, parameterID (VParameter::bitCrush), processor.treeState) - , crushEnableButton (parameterID (VParameter::crushEnable), processor.treeState) + , compressSlider (detail::kCompressSliderText, + parameterID (VParameter::inputGain), + processor.treeState) + , saturateEnableButton (parameterID (VParameter::saturateEnable), processor.treeState) + , saturateSlider (detail::kSaturateSliderText, + parameterID (VParameter::saturation), + processor.treeState) , valentineLogo ( juce::Drawable::createFromImageData (BinaryData::logo_218x40_svg, BinaryData::logo_218x40_svgSize)) { addAndMakeVisible (crushEnableButton); addAndMakeVisible (crushSlider); + addAndMakeVisible (compressSlider); + addAndMakeVisible (saturateEnableButton); + addAndMakeVisible (saturateSlider); addAndMakeVisible (valentineLogo.get()); } @@ -74,16 +86,24 @@ void CenterPanel::resized() // Adjust button width to make room topRowSliderWidth -= topRowButtonWidth; - auto crushButtonBounds = topRowSliders.removeFromLeft (topRowButtonWidth); - auto crushButtonSpacer = juce::roundToInt ( - (crushButtonBounds.getHeight() - crushButtonBounds.getWidth()) * .5f); - crushButtonBounds.removeFromTop (crushButtonSpacer); - crushButtonBounds.removeFromBottom (crushButtonSpacer); + // We want the buttons to be centered vertically, and need the button bounds to + // be square; + const auto buttonSpacer = + juce::roundToInt ((topRowSliders.getHeight() - topRowButtonWidth) * .5f); - crushEnableButton.setBounds (crushButtonBounds); - - const auto crushSliderBounds = topRowSliders.removeFromLeft (topRowSliderWidth); - crushSlider.setBounds (crushSliderBounds); + auto crushButtonBounds = topRowSliders.removeFromLeft (topRowButtonWidth); + // auto crushButtonSpacer = juce::roundToInt ( + // (crushButtonBounds.getHeight() - crushButtonBounds.getWidth()) * .5f); + // crushButtonBounds.removeFromTop (crushButtonSpacer); + // crushButtonBounds.removeFromBottom (crushButtonSpacer); + + crushEnableButton.setBounds (crushButtonBounds.reduced (0, buttonSpacer)); + + crushSlider.setBounds (topRowSliders.removeFromLeft (topRowSliderWidth)); + compressSlider.setBounds (topRowSliders.removeFromLeft (topRowSliderWidth)); + saturateEnableButton.setBounds ( + topRowSliders.removeFromLeft (topRowButtonWidth).reduced (0, buttonSpacer)); + saturateSlider.setBounds (topRowSliders.removeFromLeft (topRowSliderWidth)); const auto logoHeight = juce::roundToInt (topRowComponents.getHeight() * .25f); topRowComponents.removeFromTop (logoHeight * 1.45f); diff --git a/src/gui/panels/ValentineCenterPanel.h b/src/gui/panels/ValentineCenterPanel.h index fe4267a2..86eeffc0 100644 --- a/src/gui/panels/ValentineCenterPanel.h +++ b/src/gui/panels/ValentineCenterPanel.h @@ -29,8 +29,11 @@ class CenterPanel : public juce::Component float borderLineThickness; float borderCornerSize; - LabelSlider crushSlider; ToggleButton crushEnableButton; + LabelSlider crushSlider; + LabelSlider compressSlider; + ToggleButton saturateEnableButton; + LabelSlider saturateSlider; std::unique_ptr valentineLogo;