diff --git a/CrystalizerEQ/AXIOMDesignSystem.h b/CrystalizerEQ/AXIOMDesignSystem.h index 5a83208..23b67bb 100644 --- a/CrystalizerEQ/AXIOMDesignSystem.h +++ b/CrystalizerEQ/AXIOMDesignSystem.h @@ -5,7 +5,7 @@ #include #include "JuceLibraryCode/BinaryData.h" -#include "PluginEditor.h" + namespace AXIOM { class DesignSystem : public juce::LookAndFeel_V4 { @@ -655,6 +655,7 @@ class PresetMenuButtonLookAndFeel : public juce::LookAndFeel_V4 { const bool isToggled = button.getToggleState(); auto bounds = button.getLocalBounds().toFloat(); auto iconSize = juce::jmin(bounds.getWidth(), bounds.getHeight()) * 0.5f; + auto hoverFactor = isHovered ? 1.05f : 1.0f; auto iconBounds = juce::Rectangle(iconSize * hoverFactor, iconSize * hoverFactor) @@ -671,8 +672,6 @@ class PresetMenuButtonLookAndFeel : public juce::LookAndFeel_V4 { juce::RectanglePlacement::centred, passiveIconOpacity); } - - } private: @@ -872,11 +871,10 @@ class PresetMenuButtonLookAndFeel : public juce::LookAndFeel_V4 { label->setColour(juce::Label::backgroundColourId, juce::Colours::transparentBlack); label->setColour(juce::Label::outlineColourId, juce::Colours::transparentBlack); - label->setColour(juce::Label::textColourId, juce::Colours::white); + label->setColour(juce::Label::textColourId, Colours::FOREGROUNDCOLOUR); label->setJustificationType(juce::Justification::centred); label->setInterceptsMouseClicks (false, false); Typography::applyToLabel(*label, Typography::Style::Mono, 1.f); - return label; } juce::Slider::SliderLayout getSliderLayout (juce::Slider& slider) override @@ -921,8 +919,6 @@ class PresetMenuButtonLookAndFeel : public juce::LookAndFeel_V4 { g.setColour(Colours::ACCENTCOLOUR); g.fillPath(p); - - //TODO: ON BYPASS SET TO RING TO SURFACEHOVER, ACCENT TO WEAKACCENTHOVER } }; class GainSliderLookAndFeel : public BaseSliderLookAndFeel @@ -1025,6 +1021,103 @@ class PresetMenuButtonLookAndFeel : public juce::LookAndFeel_V4 { g.fillPath(p); } }; + + class SlopeSliderLookAndFeel : public BaseSliderLookAndFeel { + public: + static constexpr float labelPadding = 20.0f; + juce::Slider::SliderLayout getSliderLayout(juce::Slider& slider) override + { + juce::Slider::SliderLayout layout; + auto bounds = slider.getLocalBounds(); + + // TextBox in der Mitte (wie bei BaseSliderLookAndFeel) + layout.textBoxBounds = juce::Rectangle( + bounds.getCentreX() - bounds.getWidth() / 2, + bounds.getCentreY() - bounds.getHeight() / 2, + bounds.getWidth(), + bounds.getHeight() + ); + + // HIER IST DER TRICK: Knob-Bereich kleiner als Slider-Bounds! + // So bleibt Platz für die Labels außerhalb + layout.sliderBounds = bounds.reduced(labelPadding); + + return layout; + } + + void drawRotarySlider(juce::Graphics& g, int x, int y, int width, int height, + float sliderPos, float rotaryStartAngle, float rotaryEndAngle, + juce::Slider& slider) override + { + // Basis-Implementation - wird in Subklassen überschrieben + auto radius = juce::jmin(width / 2, height / 2) - 4.0f; + auto centreX = x + width * 0.5f; + auto centreY = y + height * 0.5f; + auto angle = rotaryStartAngle + sliderPos * (rotaryEndAngle - rotaryStartAngle); + bool isEnabled = slider.isEnabled(); + bool isHovered = slider.isMouseOverOrDragging(); + + // Outer ring + g.setColour(Colours::BACKGROUNDCOLOUR); + g.fillEllipse(centreX - radius, centreY - radius, radius * 2.0f, radius * 2.0f); + + juce::Colour accentCol = isEnabled ? Colours::ACCENTCOLOUR : Colours::ACCENTWEAKCOLOUR; + + // Indicator + juce::Path p; + auto pointerLength = radius * 0.6f; + auto pointerThickness = 2.0f; + p.addRectangle(-pointerThickness * 0.5f, -radius, pointerThickness, pointerLength); + p.applyTransform(juce::AffineTransform::rotation(angle).translated(centreX, centreY)); + + g.setColour(accentCol); + g.fillPath(p); + + + // Dann zeichne die Labels + const auto bounds = juce::Rectangle(x, y, width, height); + const auto centre = bounds.getCentre().toFloat(); + const float textRadius = std::min(width, height) * 0.5f + 5.0f; + + const juce::StringArray labels = {"12", "24", "36", "48"}; + + g.setFont(12.0f); + auto value = slider.getValue(); + + for (int i = 0; i < labels.size(); ++i) + { + const double labelVal = labels[i].getDoubleValue(); // "12" -> 12.0 usw. + const bool isMatch = value == i; // Toleranz: 0.5 + + juce::Colour colour; + if (!isEnabled) { + colour = isMatch ? Colours::ACCENTWEAKCOLOUR : Colours::FOREGROUNDCOLOUR.withMultipliedAlpha (0.4f); + } + else { + colour = isMatch + ? Colours::ACCENTCOLOUR + : Colours::FOREGROUNDCOLOUR; + } + g.setColour(colour); + + + const double position = (double)i / 3.0; + const float ang = rotaryStartAngle + position * (rotaryEndAngle - rotaryStartAngle); + + juce::Point pos( + centre.x + textRadius * std::cos(ang - juce::MathConstants::halfPi), + centre.y + textRadius * std::sin(ang - juce::MathConstants::halfPi) + ); + + juce::Rectangle textRect(30.0f, 16.0f); + textRect.setCentre(pos); + + g.drawText(labels[i], textRect, juce::Justification::centred); + } + + } + }; + class GlobalSliderLookAndFeel : public BaseSliderLookAndFeel { public: diff --git a/CrystalizerEQ/JuceLibraryCode/BinaryData.cpp b/CrystalizerEQ/JuceLibraryCode/BinaryData.cpp index bc075e6..08c327f 100644 --- a/CrystalizerEQ/JuceLibraryCode/BinaryData.cpp +++ b/CrystalizerEQ/JuceLibraryCode/BinaryData.cpp @@ -11471,43 +11471,80 @@ const char* preset_menu_icon_svg = (const char*) temp_binary_data_12; //================== crystalize_button_active_icon.svg ================== static const unsigned char temp_binary_data_13[] = "\n" -"\n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" +"\n" +" \n" +" \n" +" \n" " \n" -" \n" +" \n" +" \n" +" \n" +" \n" +" \n" " \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" " \n" " \n" -" \n" -" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" " \n" ""; @@ -11516,42 +11553,79 @@ const char* crystalize_button_active_icon_svg = (const char*) temp_binary_data_1 //================== crystalize_button_passive_icon.svg ================== static const unsigned char temp_binary_data_14[] = "\n" -"\n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" +"\n" +" \n" +" \n" +" \n" " \n" -" \n" +" \n" +" \n" +" \n" +" \n" " \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" " \n" " \n" -" \n" -" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" +" \n" " \n" ""; @@ -11592,8 +11666,8 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes) case 0x31532e06: numBytes = 317; return low_cut_icon_svg; case 0x7e8ca05e: numBytes = 410; return low_shelf_icon_svg; case 0x4df4bf1e: numBytes = 350; return preset_menu_icon_svg; - case 0xd842aaab: numBytes = 4212; return crystalize_button_active_icon_svg; - case 0x885a7642: numBytes = 4141; return crystalize_button_passive_icon_svg; + case 0xd842aaab: numBytes = 6343; return crystalize_button_active_icon_svg; + case 0x885a7642: numBytes = 6279; return crystalize_button_passive_icon_svg; case 0xe49e0f15: numBytes = 406; return bypass_icon_svg; default: break; } diff --git a/CrystalizerEQ/JuceLibraryCode/BinaryData.h b/CrystalizerEQ/JuceLibraryCode/BinaryData.h index 0cd2b1a..8f36356 100644 --- a/CrystalizerEQ/JuceLibraryCode/BinaryData.h +++ b/CrystalizerEQ/JuceLibraryCode/BinaryData.h @@ -48,10 +48,10 @@ namespace BinaryData const int preset_menu_icon_svgSize = 350; extern const char* crystalize_button_active_icon_svg; - const int crystalize_button_active_icon_svgSize = 4212; + const int crystalize_button_active_icon_svgSize = 6343; extern const char* crystalize_button_passive_icon_svg; - const int crystalize_button_passive_icon_svgSize = 4141; + const int crystalize_button_passive_icon_svgSize = 6279; extern const char* bypass_icon_svg; const int bypass_icon_svgSize = 406; diff --git a/CrystalizerEQ/PluginEditor.cpp b/CrystalizerEQ/PluginEditor.cpp index 10f2d43..f2ad98e 100644 --- a/CrystalizerEQ/PluginEditor.cpp +++ b/CrystalizerEQ/PluginEditor.cpp @@ -32,6 +32,7 @@ void CrystalizerEQAudioProcessorEditor::setupSliders() { } gainLookAndFeel = std::make_unique(); freqQLookAndFeel = std::make_unique(); + slopeLookAndFeel = std::make_unique(); globalLookAndFeel = std::make_unique(); lowBandGainSlider.setLookAndFeel(gainLookAndFeel.get()); @@ -40,6 +41,9 @@ void CrystalizerEQAudioProcessorEditor::setupSliders() { peak3GainSlider.setLookAndFeel(gainLookAndFeel.get()); highBandGainSlider.setLookAndFeel(gainLookAndFeel.get()); + lowBandSlopeSlider.setLookAndFeel(slopeLookAndFeel.get()); + highBandSlopeSlider.setLookAndFeel(slopeLookAndFeel.get()); + inputSlider.setLookAndFeel(globalLookAndFeel.get()); outputSlider.setLookAndFeel(globalLookAndFeel.get()); @@ -268,6 +272,7 @@ void CrystalizerEQAudioProcessorEditor::disableLowBand(const float target) { lowBandGainLabel .setEnabled(isToggled); lowBandQSlider .setEnabled(isToggled); lowBandQLabel .setEnabled(isToggled); + }; //endregion disableLowBand @@ -392,6 +397,7 @@ void CrystalizerEQAudioProcessorEditor::addComponentsToLayout() { { filterArea.addAndMakeVisible(lowFilterArea); + lowBandModeBox.addAndMakeVisible(lowBandModeLabel); lowBandModeBox.addAndMakeVisible(lowBypass); lowBandModeBox.addAndMakeVisible(lowCut); lowBandModeBox.addAndMakeVisible(lowBell); @@ -405,7 +411,13 @@ void CrystalizerEQAudioProcessorEditor::addComponentsToLayout() { lowFilterArea.addAndMakeVisible(lowBandGainLabel); lowFilterArea.addAndMakeVisible(lowBandQLabel); lowFilterArea.addAndMakeVisible(lowBandFreqLabel); + + lowBandSlopeSlider.addAndMakeVisible(low12); + lowBandSlopeSlider.addAndMakeVisible(low24); + lowBandSlopeSlider.addAndMakeVisible(low36); + lowBandSlopeSlider.addAndMakeVisible(low48); lowFilterArea.addAndMakeVisible(lowBandSlopeSlider); + lowFilterArea.addAndMakeVisible(lowBandGainSlider); lowFilterArea.addAndMakeVisible(lowBandQSlider); lowFilterArea.addAndMakeVisible(lowBandFreqSlider); @@ -447,6 +459,7 @@ void CrystalizerEQAudioProcessorEditor::addComponentsToLayout() { { filterArea.addAndMakeVisible(highFilterArea); + highBandModeBox.addAndMakeVisible(highBandModeLabel); highBandModeBox.addAndMakeVisible(highBypass); highBandModeBox.addAndMakeVisible(highCut); highBandModeBox.addAndMakeVisible(highBell); @@ -459,7 +472,13 @@ void CrystalizerEQAudioProcessorEditor::addComponentsToLayout() { highFilterArea.addAndMakeVisible(highBandGainLabel); highFilterArea.addAndMakeVisible(highBandQLabel); highFilterArea.addAndMakeVisible(highBandFreqLabel); + + highBandSlopeSlider.addAndMakeVisible(high12); + highBandSlopeSlider.addAndMakeVisible(high24); + highBandSlopeSlider.addAndMakeVisible(high36); + highBandSlopeSlider.addAndMakeVisible(high48); highFilterArea.addAndMakeVisible(highBandSlopeSlider); + highFilterArea.addAndMakeVisible(highBandGainSlider); highFilterArea.addAndMakeVisible(highBandQSlider); highFilterArea.addAndMakeVisible(highBandFreqSlider); @@ -494,6 +513,11 @@ void CrystalizerEQAudioProcessorEditor::setupLabels() { setupLabel (lowBandSlopeLabel, "Slope"); setupLabel (lowBandGainLabel, "Low\nGain"); setupLabel(lowBandQLabel, "Low\nQ"); + setupLabel(lowBandModeLabel, "Band Mode"); + setupLabel(low12, "12"); + setupLabel(low24, "24"); + setupLabel(low36, "36"); + setupLabel(low48, "48"); //PEAK 1 setupLabel (peak1FreqLabel,"Low-Mid\nHz"); @@ -515,6 +539,11 @@ void CrystalizerEQAudioProcessorEditor::setupLabels() { setupLabel (highBandSlopeLabel, "Slope"); setupLabel (highBandGainLabel, "High\nGain"); setupLabel(highBandQLabel, "High\nQ"); + setupLabel(highBandModeLabel, "Band Mode"); + setupLabel(high12, "12"); + setupLabel(high24, "24"); + setupLabel(high36, "36"); + setupLabel(high48, "48"); setupLabel(presetBoxLabel, "Presets"); @@ -725,7 +754,6 @@ CrystalizerEQAudioProcessorEditor::CrystalizerEQAudioProcessorEditor (Crystalize setupSliders(); initPresetSystem(); - addAndMakeVisible (testNoiseButton); testNoiseButton.onClick = [this]() { @@ -748,7 +776,6 @@ CrystalizerEQAudioProcessorEditor::CrystalizerEQAudioProcessorEditor (Crystalize }; - } CrystalizerEQAudioProcessorEditor::~CrystalizerEQAudioProcessorEditor() { @@ -834,7 +861,7 @@ void CrystalizerEQAudioProcessorEditor::paint (juce::Graphics& g) auto hBH = hB.getHeight(); auto hBPad = ((hBY + mPY) - hBH) / 2; g.fillRect(hBX, hBY, hBW, mPY - hBPad); - paintBorderLines(g); + //paintBorderLines(g); g.setColour(Colours::SURFACECOLOUR); @@ -844,7 +871,7 @@ void CrystalizerEQAudioProcessorEditor::paint (juce::Graphics& g) auto pAWidth = pA.getWidth(); auto pAHeight = pA.getHeight(); g.fillRoundedRectangle(pAX, pAY - 10.f, pAWidth, pAHeight + 10.f, 10.0f); - paintBorderLines(g); + //paintBorderLines(g); const auto fA = getLocalArea(&filterArea, filterArea.getLocalBounds()); const int fABorderWidth = 3; @@ -863,12 +890,13 @@ void CrystalizerEQAudioProcessorEditor::paint (juce::Graphics& g) g.fillRect(fA); paintBorderLines(g); - paintModeBoxBorders(g); + //paintModeBoxBorders(g); g.setColour(Colours::SURFACEBYPASS); const auto fB = getLocalArea(&footerBar, footerBar.getLocalBounds()); g.fillRect(fB); + if constexpr (false) // -> auf false setzen, wenn nicht gebraucht { for (auto* c : getChildren()) // headerBar, mainPanel, footerBar @@ -1006,7 +1034,6 @@ void CrystalizerEQAudioProcessorEditor::paint (juce::Graphics& g) //region paintBorderLines void CrystalizerEQAudioProcessorEditor::paintBorderLines(juce::Graphics &g) { - //TODO: BRODER LINES DONT ALIGN WITH MARGIN FROM ANALYZERAREA AND FILTERAREA g.setColour(DesignSystem::Colours::BACKGROUNDCOLOUR); auto prevRight = (float) lowFilterArea.getRight(); @@ -1015,7 +1042,7 @@ void CrystalizerEQAudioProcessorEditor::paintBorderLines(juce::Graphics &g) { const auto area = getLocalArea(c, c->getLocalBounds()); const float xAvg = ((float) area.getX() - prevRight) / 2; - const int x = area.getX() - xAvg; + const int x = area.getX() - xAvg + (filterAreaMargin / 2); prevRight = (float) c->getRight(); const auto top = (float) area.getY(); @@ -1050,6 +1077,7 @@ void CrystalizerEQAudioProcessorEditor::setKnobVisibility() { lowBandGainLabel .setEnabled(lowMode >= 2); lowBandQSlider .setEnabled(lowMode >= 1); lowBandQLabel .setEnabled(lowMode >= 1); + lowBandModeLabel.setEnabled (lowMode >= 1); int highMode = (int) audioProcessor.apvts .getRawParameterValue("HighBandModes")->load(); // 0..3 @@ -1066,6 +1094,7 @@ void CrystalizerEQAudioProcessorEditor::setKnobVisibility() { highBandGainLabel .setEnabled(highMode >= 2); highBandQSlider .setEnabled(highMode >= 1); highBandQLabel .setEnabled(highMode >= 1); + highBandModeLabel.setEnabled (highMode >= 1); } //endregion setKnobVisibility @@ -1126,6 +1155,8 @@ void CrystalizerEQAudioProcessorEditor::resized() setupFooter(); //setSliderSizes(); + + const auto testBounds = mainPanel.getLocalBounds(); const auto testWidth = testBounds.getWidth(); const auto testHeight = testBounds.getHeight(); @@ -1252,7 +1283,6 @@ void CrystalizerEQAudioProcessorEditor::setupBody() { const auto bodyHeight = static_cast(bounds.getHeight()); const auto bodyWidth = static_cast(bounds.getWidth()); const auto bodyColWidth = bodyWidth / 5.0f; - const int margin = 15; Layout::GridSpec bodySpec{ /* cols */ { Layout::fr(1), Layout::pxTrack(bodyColWidth), Layout::pxTrack(bodyColWidth), Layout::pxTrack(bodyColWidth), Layout::fr(1) }, @@ -1263,10 +1293,10 @@ void CrystalizerEQAudioProcessorEditor::setupBody() { }; Layout::grid(bounds, bodySpec, { Layout::area(analyzerArea, 1, 2, 2, 5) - .withMargin(juce::GridItem::Margin(margin, 0, margin, 0)), + .withMargin(juce::GridItem::Margin(filterAreaMargin, 0, filterAreaMargin, 0)), Layout::area(crystalizeButton, 1, 5, 2, 6), Layout::area(filterArea, 2, 1, 3, 6) - .withMargin(juce::GridItem::Margin(0, margin, 0, margin)) + .withMargin(juce::GridItem::Margin(0, filterAreaMargin, 0, filterAreaMargin)) }); @@ -1318,6 +1348,7 @@ void CrystalizerEQAudioProcessorEditor::setupLowBandLayout() { const auto refH = getReferenceCell()[1]; const auto gainSize = refH * gainMod; const auto offSetToGainTop = gainSize; + const float labelPadding = Components::SlopeSliderLookAndFeel::labelPadding * 2; Layout::GridSpec lowBandSpec{ /* cols */ { Layout::fr(1), Layout::pxTrack(knobColWidth), Layout::fr(1) }, @@ -1346,13 +1377,13 @@ void CrystalizerEQAudioProcessorEditor::setupLowBandLayout() { .withAlignSelf(juce::GridItem::AlignSelf::center) .withJustifySelf(juce::GridItem::JustifySelf::center), - Layout::area(lowBandSlopeSlider, 3, 3, 4, 4) - .withWidth(refW * slopeMod) - .withHeight(refH * slopeMod) + Layout::area(lowBandSlopeSlider, 3, 1, 4, 2) + .withWidth(refW * slopeMod + labelPadding) + .withHeight(refH * slopeMod + labelPadding) .withAlignSelf(juce::GridItem::AlignSelf::center) .withJustifySelf(juce::GridItem::JustifySelf::center), - Layout::area(lowBandModeBox, 3, 1, 4, 3), + Layout::area(lowBandModeBox, 3, 2, 4, 4), Layout::area(lowBandFreqLabel, 2, 1, 3, 2) @@ -1360,8 +1391,8 @@ void CrystalizerEQAudioProcessorEditor::setupLowBandLayout() { Layout::area(lowBandGainLabel, 1, 2, 2, 3), Layout::area(lowBandQLabel, 2, 3, 3, 4) .withMargin(juce::GridItem::Margin(-offSetToGainTop, 0, 0, 0)), - Layout::area(lowBandSlopeLabel, 3, 3, 4, 4) - .withMargin(juce::GridItem::Margin(-offSetToGainTop / 2, 0, 0, 0)), + Layout::area(lowBandSlopeLabel, 3, 1, 4, 2) + .withMargin(juce::GridItem::Margin(-offSetToGainTop / 1.5f, 0, 0, 0)), }); @@ -1370,20 +1401,23 @@ void CrystalizerEQAudioProcessorEditor::setupLowBandLayout() { const auto modeBoxAreaWidth = static_cast(modeBoxBounds.getWidth()); const auto modeBoxAreaHeight = static_cast(modeBoxBounds.getHeight()); const auto modeBoxButtonColWidth = modeBoxAreaWidth / 4.0f; + const auto slopeH = lowBandSlopeSlider.getY() - lowBandModeBox.getY() + lowBandModeLabel.getFont().getHeight() / 2; Layout::GridSpec lowBandModeBoxSpec{ /* cols */ { Layout::fr(1), Layout::fr(1), Layout::fr(1), Layout::fr(1) }, - /* rows */ { Layout::fr(1)}, + /* rows */ { Layout::fr(1), Layout::fr(1)}, /* colGap */ Spacing::SizeMode::XS, /* rowGap */ Spacing::SizeMode::XS, /* pad */ Layout::padding(Spacing::SizeMode::XS) }; Layout::grid(modeBoxBounds, lowBandModeBoxSpec, { - Layout::area(lowBypass, 1, 1, 2, 2), - Layout::area(lowCut, 1, 2, 2, 3), - Layout::area(lowBell, 1, 3, 2, 4), - Layout::area(lowShelf, 1, 4, 2, 5) + Layout::area(lowBandModeLabel, 1, 2, 2, 4) + .withMargin(juce::GridItem::Margin(slopeH , 0, 0, 0)), + Layout::area(lowBypass, 1, 1, 3, 2), + Layout::area(lowCut, 1, 2, 3, 3), + Layout::area(lowBell, 1, 3, 3, 4), + Layout::area(lowShelf, 1, 4, 3, 5) }); } //endregion setupLowBandLayout @@ -1549,6 +1583,8 @@ void CrystalizerEQAudioProcessorEditor::setupHighBandLayout() { const auto refH = getReferenceCell()[1]; const auto gainSize = refH * gainMod; const auto offSetToGainTop = gainSize; + const float labelPadding = Components::SlopeSliderLookAndFeel::labelPadding * 2; + Layout::GridSpec highBandSpec{ /* cols */ { Layout::fr(1), Layout::pxTrack(knobColWidth), Layout::fr(1) }, @@ -1577,12 +1613,12 @@ void CrystalizerEQAudioProcessorEditor::setupHighBandLayout() { .withAlignSelf(juce::GridItem::AlignSelf::center) .withJustifySelf(juce::GridItem::JustifySelf::center), - Layout::area(highBandModeBox, 3, 2, 4, 4), + Layout::area(highBandModeBox, 3, 1, 4, 3), - Layout::area(highBandSlopeSlider, 3, 1, 4, 2) - .withWidth(refW * slopeMod) - .withHeight(refH * slopeMod) + Layout::area(highBandSlopeSlider, 3, 3, 4, 4) + .withWidth(refW * slopeMod + labelPadding) + .withHeight(refH * slopeMod + labelPadding) .withAlignSelf(juce::GridItem::AlignSelf::center) .withJustifySelf(juce::GridItem::JustifySelf::center), @@ -1591,8 +1627,8 @@ void CrystalizerEQAudioProcessorEditor::setupHighBandLayout() { Layout::area(highBandGainLabel, 1, 2, 2, 3), Layout::area(highBandQLabel, 2, 3, 3, 4) .withMargin(juce::GridItem::Margin(-offSetToGainTop, 0, 0, 0)), - Layout::area(highBandSlopeLabel, 3, 1, 4, 2) - .withMargin(juce::GridItem::Margin(-offSetToGainTop / 2, 0, 0, 0)), + Layout::area(highBandSlopeLabel, 3, 3, 4, 4) + .withMargin(juce::GridItem::Margin(-offSetToGainTop / 1.5f, 0, 0, 0)), }); @@ -1600,20 +1636,23 @@ void CrystalizerEQAudioProcessorEditor::setupHighBandLayout() { const auto modeBoxAreaWidth = static_cast(modeBoxBounds.getWidth()); const auto modeBoxAreaHeight = static_cast(modeBoxBounds.getHeight()); const auto modeBoxButtonColWidth = modeBoxAreaWidth / 4.0f; + const auto slopeH = highBandSlopeSlider.getY() - highBandModeBox.getY() + highBandModeLabel.getFont().getHeight() / 2; Layout::GridSpec highBandModeBoxSpec{ /* cols */ { Layout::fr(1), Layout::fr(1), Layout::fr(1), Layout::fr(1) }, - /* rows */ { Layout::fr(1)}, + /* rows */ { Layout::fr(1), Layout::fr(1)}, /* colGap */ Spacing::SizeMode::XS, /* rowGap */ Spacing::SizeMode::XS, /* pad */ Layout::padding(Spacing::SizeMode::XS) }; Layout::grid(modeBoxBounds, highBandModeBoxSpec, { - Layout::area(highBypass, 1, 4, 2, 5), - Layout::area(highCut, 1, 3, 2, 4), - Layout::area(highBell, 1, 2, 2, 3), - Layout::area(highShelf, 1, 1, 2, 2) + Layout::area(highBandModeLabel, 1, 2, 2, 4) + .withMargin(juce::GridItem::Margin(slopeH , 0, 0, 0)), + Layout::area(highBypass, 1, 4, 3, 5), + Layout::area(highCut, 1, 3, 3, 4), + Layout::area(highBell, 1, 2, 3, 3), + Layout::area(highShelf, 1, 1, 3, 2) }); } //endregion setupHighBandLayout diff --git a/CrystalizerEQ/PluginEditor.h b/CrystalizerEQ/PluginEditor.h index 9c77321..8b648fe 100644 --- a/CrystalizerEQ/PluginEditor.h +++ b/CrystalizerEQ/PluginEditor.h @@ -179,22 +179,28 @@ public: inputAttach, outputAttach; juce::Label titleLabel, testNoiseLabel, - lowBandFreqLabel, lowBandSlopeLabel, lowBandGainLabel, lowBandQLabel, + lowBandFreqLabel, lowBandSlopeLabel, lowBandGainLabel, lowBandQLabel, lowBandModeLabel, + low12, low24, low36, low48, peak1FreqLabel, peak1GainLabel, peak1QLabel, peak2FreqLabel, peak2GainLabel, peak2QLabel, peak3FreqLabel, peak3GainLabel, peak3QLabel, - highBandFreqLabel, highBandSlopeLabel, highBandGainLabel, highBandQLabel, + highBandFreqLabel, highBandSlopeLabel, highBandGainLabel, highBandQLabel, highBandModeLabel, + high12, high24, high36, high48, inputLabel, outputLabel, presetBoxLabel; const juce::Array sliderLabels = { - &lowBandFreqLabel, &lowBandSlopeLabel, &lowBandGainLabel, &lowBandQLabel, + &lowBandFreqLabel, &lowBandSlopeLabel, &lowBandGainLabel, &lowBandQLabel, &lowBandModeLabel, &peak1FreqLabel, &peak1GainLabel, &peak1QLabel, &peak2FreqLabel, &peak2GainLabel, &peak2QLabel, &peak3FreqLabel, &peak3GainLabel, &peak3QLabel, - &highBandFreqLabel, &highBandSlopeLabel, &highBandGainLabel, &highBandQLabel, + &highBandFreqLabel, &highBandSlopeLabel, &highBandGainLabel, &highBandQLabel, &highBandModeLabel, &inputLabel, &outputLabel }; + const juce::Array slopeLabels = { + &low12, &low24, &low36, &low48, + &high12, &high24, &high36, &high48 + }; juce::TextButton testNoiseButton, resetButton, savePresetButton, deletePresetButton; @@ -264,6 +270,7 @@ private: std::unique_ptr baseLookAndFeel; std::unique_ptr gainLookAndFeel; std::unique_ptr freqQLookAndFeel; + std::unique_ptr slopeLookAndFeel; std::unique_ptr globalLookAndFeel; std::unique_ptr bypassButtonLookAndFeel; std::unique_ptr presetMenuButtonLookAndFeel; @@ -326,6 +333,8 @@ private: const float slopeMod = SliderStyles::Size::getSliderSizeMod(SliderStyles::Size::SizeMode::Slope); const float globalMod = SliderStyles::Size::getSliderSizeMod(SliderStyles::Size::SizeMode::Global); + const float filterAreaMargin = 15.0f; + bool isAnimatingCrystalize = false; bool isFadingToActive = false; diff --git a/CrystalizerEQ/PluginProcessor.cpp b/CrystalizerEQ/PluginProcessor.cpp index 78b267d..07a5967 100644 --- a/CrystalizerEQ/PluginProcessor.cpp +++ b/CrystalizerEQ/PluginProcessor.cpp @@ -64,7 +64,7 @@ CrystalizerEQAudioProcessor::createParameterLayout() { params.push_back (std::make_unique( "Peak2Gain", "Peak2 Gain (dB)", - juce::NormalisableRange(-48.f, 48.f, 0.1f), 0.f)); + juce::NormalisableRange(-24.f, 24.f, 0.1f), 0.f)); params.push_back (std::make_unique( "Peak2Q", "Peak2 Q",