Skip to content

Commit

Permalink
WIP add ratio slider
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseDiazRohena committed Dec 18, 2023
1 parent 2f2ad75 commit 96a2048
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gui/panels/ValentineCenterPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace detail
inline const juce::String kCrushSliderText = "CRUSH";
inline const juce::String kCompressSliderText = "COMPRESS";
inline const juce::String kSaturateSliderText = "SATURATE";
inline const juce::String kRatioSliderText = "RATIO";
} // namespace detail

CenterPanel::CenterPanel (ValentineAudioProcessor& processor)
Expand All @@ -36,13 +37,17 @@ CenterPanel::CenterPanel (ValentineAudioProcessor& processor)
, valentineLogo (
juce::Drawable::createFromImageData (BinaryData::logo_218x40_svg,
BinaryData::logo_218x40_svgSize))
, ratioSlider (detail::kRatioSliderText,
parameterID (VParameter::ratio),
processor.treeState)
{
addAndMakeVisible (crushEnableButton);
addAndMakeVisible (crushSlider);
addAndMakeVisible (compressSlider);
addAndMakeVisible (saturateEnableButton);
addAndMakeVisible (saturateSlider);
addAndMakeVisible (valentineLogo.get());
addAndMakeVisible (ratioSlider);
}

CenterPanel::~CenterPanel()
Expand Down Expand Up @@ -129,6 +134,13 @@ void CenterPanel::resized()
juce::roundToInt (borderLineThickness),
bottomRowBorderHeight)
.reduced (0, bottomRowBorderHeight * .1f);

auto bottomRowComponents = bottomRowBorder.reduced (margin);
auto bottomRowSliderWidth = juce::roundToInt (bottomRowComponents.getWidth() * .2f);
const auto bottomRowButtonWidth = juce::roundToInt (bottomRowSliderWidth * .10f);
bottomRowSliderWidth -= bottomRowButtonWidth;

ratioSlider.setBounds (bottomRowComponents.removeFromLeft (bottomRowSliderWidth));
}
} // namespace tote_bag
} // namespace valentine
2 changes: 2 additions & 0 deletions src/gui/panels/ValentineCenterPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class CenterPanel : public juce::Component

std::unique_ptr<juce::Drawable> valentineLogo;

LabelSlider ratioSlider;

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

0 comments on commit 96a2048

Please sign in to comment.