diff --git a/Source/GUIelements/MaimLookAndFeel.cpp b/Source/GUIelements/MaimLookAndFeel.cpp index 59a6357..cde5acf 100644 --- a/Source/GUIelements/MaimLookAndFeel.cpp +++ b/Source/GUIelements/MaimLookAndFeel.cpp @@ -75,8 +75,8 @@ void MaimLookAndFeel::drawRotarySlider (juce::Graphics& g, centery - radius, radius * 2, radius * 2, - PI * (shadow_tilt + 1), - PI * (shadow_tilt + 2)); + pi * (shadow_tilt + 1), + pi * (shadow_tilt + 2)); highlight.closeSubPath(); g.setColour(fill); @@ -88,8 +88,8 @@ void MaimLookAndFeel::drawRotarySlider (juce::Graphics& g, centery - radius, radius * 2, radius * 2, - PI * shadow_tilt - penumbra_rad, - PI * (shadow_tilt + 1) + penumbra_rad); + pi * shadow_tilt - penumbra_rad, + pi * (shadow_tilt + 1) + penumbra_rad); penumbra.closeSubPath(); g.setColour(BEVEL_LIGHT); @@ -101,8 +101,8 @@ void MaimLookAndFeel::drawRotarySlider (juce::Graphics& g, centery - radius, radius * 2, radius * 2, - PI * shadow_tilt + penumbra_rad, - PI * (shadow_tilt + 1) - penumbra_rad); + pi * shadow_tilt + penumbra_rad, + pi * (shadow_tilt + 1) - penumbra_rad); shadow.closeSubPath(); g.setColour(BEVEL_DARK); diff --git a/Source/GUIelements/MaimLookAndFeel.h b/Source/GUIelements/MaimLookAndFeel.h index 6c24cbe..86a7939 100644 --- a/Source/GUIelements/MaimLookAndFeel.h +++ b/Source/GUIelements/MaimLookAndFeel.h @@ -11,8 +11,6 @@ #include "juce_graphics/juce_graphics.h" #include "juce_gui_basics/juce_gui_basics.h" -#define PI 3.14159265359 - // BEDSTEAD FONT // https://www.1001fonts.com/bedstead-font.html // Bedtead by Ben Harris. @@ -71,5 +69,6 @@ class MaimLookAndFeel : public juce::LookAndFeel_V4 const juce::Typeface::Ptr tooltip_font; private: + const float pi = 3.14159265359; }; #endif //MAIM_MAIMLOOKANDFEEL_H diff --git a/Source/GUIelements/PostSection.cpp b/Source/GUIelements/PostSection.cpp index 5f8bea0..4060e22 100644 --- a/Source/GUIelements/PostSection.cpp +++ b/Source/GUIelements/PostSection.cpp @@ -20,12 +20,36 @@ PostSection::PostSection(juce::AudioProcessorValueTreeState& p) : StageWindow(p) addAndMakeVisible(encoderSlider); } +void PostSection::paint (juce::Graphics& g) +{ + StageWindow::paint(g); + g.setColour(MaimLookAndFeel().BEVEL_DARK); + for (const auto& section : { driveSection, bitrateSection, filterSection }) { + g.drawVerticalLine(section.getRight(), section.getY() + 10,section.getBottom() - 10); + + } +} + void PostSection::resized() { + setUsableBounds(); + int used_space = 0; + + driveSection = usable_bounds.withWidth(75); + used_space += driveSection.getWidth(); + + bitrateSection = usable_bounds.withTrimmedLeft(used_space).withWidth(150); + used_space += bitrateSection.getWidth(); + + filterSection = usable_bounds.withTrimmedLeft(used_space).withWidth(75); + used_space += filterSection.getWidth(); + + makeupSection = usable_bounds.withTrimmedLeft(used_space); + int knobWidth = getWidth() / 5; - driveSlider.setBounds(getLocalBounds().withWidth(knobWidth)); - bitrateSlider.setBounds(getLocalBounds().withWidth(knobWidth).withX(knobWidth)); - encoderSlider.setBounds(getLocalBounds().withWidth(knobWidth).withX(knobWidth * 2)); - postFilterSlider.setBounds(getLocalBounds().withWidth(knobWidth).withX(knobWidth * 3)); - makeupSlider.setBounds(getLocalBounds().withWidth(knobWidth).withX(knobWidth * 4)); + driveSlider.setBounds(driveSection); + bitrateSlider.setBounds(bitrateSection.withWidth(bitrateSection.getWidth() / 2)); + encoderSlider.setBounds(bitrateSection.withTrimmedLeft(bitrateSection.getWidth() / 2)); + postFilterSlider.setBounds(filterSection); + makeupSlider.setBounds(makeupSection); } diff --git a/Source/GUIelements/PostSection.h b/Source/GUIelements/PostSection.h index d8ebc66..0ed80fe 100644 --- a/Source/GUIelements/PostSection.h +++ b/Source/GUIelements/PostSection.h @@ -22,8 +22,14 @@ class PostSection : public StageWindow { public: PostSection(juce::AudioProcessorValueTreeState& p); + void paint (juce::Graphics& g); void resized() override; private: + juce::Rectangle driveSection; + juce::Rectangle bitrateSection; + juce::Rectangle filterSection; + juce::Rectangle makeupSection; + juce::Slider driveSlider { juce::Slider::RotaryVerticalDrag, juce::Slider::TextBoxBelow @@ -67,6 +73,17 @@ class PostSection : public StageWindow "bitrate", bitrateSlider }; + + juce::Slider squishSlider { + juce::Slider::RotaryVerticalDrag, + juce::Slider::TextBoxBelow + }; + + juce::AudioProcessorValueTreeState::SliderAttachment squishAttachment { + parameters, + "bitratesqish", + squishSlider + }; juce::Slider postFilterSlider { juce::Slider::RotaryVerticalDrag,