Finished all sliders. Added logo.

This commit is contained in:
Legaeli 2025-11-13 16:51:12 +01:00
parent 6f2fd49107
commit da00962842
8 changed files with 152 additions and 44 deletions

View File

@ -880,6 +880,10 @@ class PresetMenuButtonLookAndFeel : public juce::LookAndFeel_V4 {
juce::Slider::SliderLayout getSliderLayout (juce::Slider& slider) override
{
juce::Slider::SliderLayout layout;
if (slider.getName() == "LowBand Slope" || slider.getName() == "HighBand Slope") {
layout.textBoxBounds = {};
return layout;
}
auto r = slider.getLocalBounds();
@ -1025,6 +1029,7 @@ class PresetMenuButtonLookAndFeel : public juce::LookAndFeel_V4 {
class SlopeSliderLookAndFeel : public BaseSliderLookAndFeel {
public:
static constexpr float labelPadding = 20.0f;
juce::Slider::SliderLayout getSliderLayout(juce::Slider& slider) override
{
juce::Slider::SliderLayout layout;
@ -1136,20 +1141,25 @@ class PresetMenuButtonLookAndFeel : public juce::LookAndFeel_V4 {
float hoverFactor = 1.0f;
auto surfaceCol = Colours::SURFACECOLOUR;
auto accentCol = Colours::ACCENTCOLOUR;
auto ringCol = Colours::SURFACEHOVER;
if (isEnabled) {
surfaceCol = isHovered ? Colours::SURFACEBYPASS : Colours::SURFACECOLOUR;
surfaceCol = isHovered ? Colours::SURFACEHOVER : Colours::SURFACECOLOUR;
accentCol = isHovered ? Colours::ACCENTHOVER : Colours::ACCENTCOLOUR;
ringCol = isHovered ? Colours::SURFACECOLOUR : Colours::SURFACEHOVER;
hoverFactor = isHovered ? 1.05f : 1.0f;
} else {
surfaceCol = Colours::SURFACEBYPASS;
accentCol = Colours::ACCENTWEAKCOLOUR;
ringCol = Colours::SURFACEHOVER;
}
// Einfacher Ring
g.setColour(surfaceCol);
g.fillEllipse(centreX - radius, centreY - radius, radius * 2.0f , radius * 2.0f);
//g.drawEllipse(centreX - radius, centreY - radius, radius * 2.0f, radius * 2.0f, 2.0f);
g.setColour(ringCol);
g.drawEllipse(centreX - radius, centreY - radius, radius * 2.0f, radius * 2.0f, arcPathWidth);
juce::Path valueArc;
valueArc.addCentredArc(centreX, centreY, radius, radius,
@ -1183,7 +1193,7 @@ class PresetMenuButtonLookAndFeel : public juce::LookAndFeel_V4 {
case SizeMode::Freq: return 0.8f;
case SizeMode::Q: return 0.8f;
case SizeMode::Slope: return 0.7f;
case SizeMode::Global: return 1.0f;
case SizeMode::Global: return 0.8f;
case SizeMode::Mix: return 0.8f;
default: return 1.0f;
}

View File

@ -164,6 +164,7 @@
<None Include="..\..\Resources\Fonts\Orbitron-Bold.ttf"/>
<None Include="..\..\Resources\Fonts\Orbitron-Regular.ttf"/>
<None Include="..\..\Resources\Fonts\Roboto-Regular.ttf"/>
<None Include="..\..\Resources\Icons\logo_icon.svg"/>
<None Include="..\..\Resources\Icons\bell_icon.svg"/>
<None Include="..\..\Resources\Icons\high_cut_icon.svg"/>
<None Include="..\..\Resources\Icons\high_shelf_icon.svg"/>

View File

@ -74,6 +74,9 @@
<None Include="..\..\Resources\Fonts\Roboto-Regular.ttf">
<Filter>CrystalizerEQ\Resources\Fonts</Filter>
</None>
<None Include="..\..\Resources\Icons\logo_icon.svg">
<Filter>CrystalizerEQ\Resources\Icons</Filter>
</None>
<None Include="..\..\Resources\Icons\bell_icon.svg">
<Filter>CrystalizerEQ\Resources\Icons</Filter>
</None>

View File

@ -21,6 +21,7 @@
file="Resources/Fonts/Roboto-Regular.ttf"/>
</GROUP>
<GROUP id="{3DCFA257-AECE-2625-016F-D02D71FFA24B}" name="Icons">
<FILE id="RCNwIt" name="logo_icon.svg" compile="0" resource="1" file="Resources/Icons/logo_icon.svg"/>
<FILE id="waE621" name="bell_icon.svg" compile="0" resource="1" file="Resources/Icons/bell_icon.svg"/>
<FILE id="KOfMYl" name="high_cut_icon.svg" compile="0" resource="1"
file="Resources/Icons/high_cut_icon.svg"/>

View File

@ -11413,63 +11413,88 @@ static const unsigned char temp_binary_data_6[] =
const char* RobotoRegular_ttf = (const char*) temp_binary_data_6;
//================== bell_icon.svg ==================
//================== logo_icon.svg ==================
static const unsigned char temp_binary_data_7[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 3100 3100\">\n"
" <g id=\"Ebene_2\" data-name=\"Ebene 2\">\n"
" <circle cx=\"1550.48\" cy=\"1550\" r=\"64\" fill=\"#333\"/>\n"
" </g>\n"
" <g id=\"Ebene_3\" data-name=\"Ebene 3\">\n"
" <path d=\"M1512.64,1563.07c4.53,0,8.47-4.21,9.59-8.78.37-1.57.45-2.93.45-4.86,0-1.36,0-2.5-.3-3.71-.89-4.64-4.46-8.85-9.22-8.85-6.1,0-10.26,5.78-10.26,13.64,0,6.57,3.49,12.57,9.74,12.57ZM1523.38,1559.03c-2.38,4.14-6.65,9.03-12.38,9.03-8.55,0-14.7"
"2-6.85-14.72-17.35,0-11.28,7.73-18.78,16.06-18.78,11.02,0,11.04,9.03,11.04,9.03l1.81-9.03h7.23l-5.27,18.1,5.27,18.03h-7.23\" fill=\"#fcfaf9\"/>\n"
" <path d=\"M1604.67,1546.39c0-9.91-6.59-14.45-18.06-14.45-11.68.09-18.06,4.49-18.06,14.45,0,8.11,9.03,12.65,9.03,12.65l-9.03,1.76v7.23l13.55-3.96v-5.02c-4.11-2.29-8.85-5.06-8.85-10.84,0-7.24,4.4-9.76,13.37-9.69,9.1,0,13.37,2.53,13.37,9.69,0,5.74-4"
".73,8.53-8.85,10.84v5.04l13.55,3.95v-7.23l-9.03-1.76s9.03-4.55,9.03-12.65Z\" fill=\"#fcfaf9\"/>\n"
" <polygon points=\"1534.67 1572.58 1543.71 1550 1536.93 1527.42 1496.29 1527.42 1496.29 1522.9 1541.45 1522.9 1550.48 1540.97 1559.51 1522.9 1604.67 1522.9 1604.67 1527.42 1564.03 1527.42 1557.25 1550 1566.29 1572.58 1604.67 1572.58 1604.67 1577.1"
" 1561.77 1577.1 1550.48 1554.52 1539.19 1577.1 1496.29 1577.1 1496.29 1572.58 1534.67 1572.58\" fill=\"#56feff\"/>\n"
" </g>\n"
" <g id=\"Ebene_5\" data-name=\"Ebene 5\">\n"
" <rect x=\"1582.09\" y=\"1554.52\" width=\"9.03\" height=\"13.55\" fill=\"#333\"/>\n"
" <rect x=\"1581.53\" y=\"1565.63\" width=\"11.31\" height=\"4.42\" fill=\"#333\"/>\n"
" <rect x=\"1585.12\" y=\"1564.25\" width=\"11.31\" height=\"4.42\" transform=\"translate(1131.12 -618.28) rotate(33.56)\" fill=\"#333\"/>\n"
" <polygon points=\"1587.05 1561.29 1584.91 1557.43 1592.17 1553.63 1591.89 1558.6 1587.05 1561.29\" fill=\"#333\"/>\n"
" </g>\n"
"</svg>";
const char* logo_icon_svg = (const char*) temp_binary_data_7;
//================== bell_icon.svg ==================
static const unsigned char temp_binary_data_8[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 28 12.02\">\n"
" <path fill=\"black\" d=\"M0,8.02h4.82c.75,0,1.45-.34,1.92-.92L11.42,1.24c1.32-1.65,3.84-1.65,5.16,0l4.68,5.86c.47.58,1.17.92,1.92.92h4.82v4h-4.82c-.75,0-1.45-.34-1.92-.92l-5.73-7.16c-.79-.98-2.28-.98-3.07,0l-5.73,7.16c-.47.58-1.17.92-1.92.92H0s0-4,"
"0-4Z\"/>\n"
"</svg>";
const char* bell_icon_svg = (const char*) temp_binary_data_7;
const char* bell_icon_svg = (const char*) temp_binary_data_8;
//================== high_cut_icon.svg ==================
static const unsigned char temp_binary_data_8[] =
static const unsigned char temp_binary_data_9[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n"
" <path fill=\"black\" d=\"M24,23.02V4C24,1.79,22.21,0,20,0H.98C.44,0,0,.44,0,.98v2.03c0,.54.44.98.98.98h17.02c1.2,0,2,.8,2,2v17.02c0,.54.44.98.98.98h2.05c.54,0,.98-.44.98-.98Z\"/>\n"
"</svg>";
const char* high_cut_icon_svg = (const char*) temp_binary_data_8;
const char* high_cut_icon_svg = (const char*) temp_binary_data_9;
//================== high_shelf_icon.svg ==================
static const unsigned char temp_binary_data_9[] =
static const unsigned char temp_binary_data_10[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 28 12\">\n"
" <path fill=\"black\" d=\"M11.23,6.39l5.62-4.77c1.23-1.04,2.79-1.61,4.4-1.61h6.04c.4,0,.72.32.72.72v2.56c0,.4-.32.72-.72.72h-6.08c-1.62,0-3.18.58-4.41,1.63l-5.56,4.75c-1.23,1.05-2.79,1.63-4.41,1.63H.72c-.4,0-.72-.32-.72-.72v-2.56c0-.4.32-.72.72-.72h"
"6.12c1.61,0,3.17-.57,4.4-1.61Z\"/>\n"
"</svg>";
const char* high_shelf_icon_svg = (const char*) temp_binary_data_9;
const char* high_shelf_icon_svg = (const char*) temp_binary_data_10;
//================== low_cut_icon.svg ==================
static const unsigned char temp_binary_data_10[] =
static const unsigned char temp_binary_data_11[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n"
" <path fill=\"black\" d=\"M0,23.02V4C0,1.79,1.79,0,4,0h19.02c.54,0,.98.44.98.98v2.03c0,.54-.44.98-.98.98H6c-1.2,0-2,.8-2,2v17.02c0,.54-.44.98-.98.98H.98c-.54,0-.98-.44-.98-.98Z\"/>\n"
"</svg>";
const char* low_cut_icon_svg = (const char*) temp_binary_data_10;
const char* low_cut_icon_svg = (const char*) temp_binary_data_11;
//================== low_shelf_icon.svg ==================
static const unsigned char temp_binary_data_11[] =
static const unsigned char temp_binary_data_12[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 28 12\">\n"
" <path fill=\"black\" d=\"M16.77,6.39L11.15,1.61C9.92.57,8.36,0,6.75,0H.72C.32,0,0,.32,0,.72v2.56c0,.4.32.72.72.72h6.08c1.62,0,3.18.58,4.41,1.63l5.56,4.75c1.23,1.05,2.79,1.63,4.41,1.63h6.11c.4,0,.72-.32.72-.72v-2.56c0-.4-.32-.72-.72-.72h-6.12c-1.61,"
"0-3.17-.57-4.4-1.61Z\"/>\n"
"</svg>";
const char* low_shelf_icon_svg = (const char*) temp_binary_data_11;
const char* low_shelf_icon_svg = (const char*) temp_binary_data_12;
//================== preset_menu_icon.svg ==================
static const unsigned char temp_binary_data_12[] =
static const unsigned char temp_binary_data_13[] =
"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 30 30\" width=\"60px\" height=\"60px\"><path d=\"M 3 7 A 1.0001 1.0001 0 1 0 3 9 L 27 9 A 1.0001 1.0001 0 1 0 27 7 L 3 7 z M 3 14 A 1.0001 1.0001 0 1 0 3 16 L 27 16 A 1.0001 1.0001 0 1 0 27 14 "
"L 3 14 z M 3 21 A 1.0001 1.0001 0 1 0 3 23 L 27 23 A 1.0001 1.0001 0 1 0 27 21 L 3 21 z\" fill=\"black\"/></svg>";
const char* preset_menu_icon_svg = (const char*) temp_binary_data_12;
const char* preset_menu_icon_svg = (const char*) temp_binary_data_13;
//================== crystalize_button_active_icon.svg ==================
static const unsigned char temp_binary_data_13[] =
static const unsigned char temp_binary_data_14[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 32\">\n"
" <g id=\"Ebene_6\" data-name=\"Ebene 6\">\n"
@ -11548,10 +11573,10 @@ static const unsigned char temp_binary_data_13[] =
" </g>\n"
"</svg>";
const char* crystalize_button_active_icon_svg = (const char*) temp_binary_data_13;
const char* crystalize_button_active_icon_svg = (const char*) temp_binary_data_14;
//================== crystalize_button_passive_icon.svg ==================
static const unsigned char temp_binary_data_14[] =
static const unsigned char temp_binary_data_15[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 32\">\n"
" <g id=\"Ebene_6\" data-name=\"Ebene 6\">\n"
@ -11629,17 +11654,17 @@ static const unsigned char temp_binary_data_14[] =
" </g>\n"
"</svg>";
const char* crystalize_button_passive_icon_svg = (const char*) temp_binary_data_14;
const char* crystalize_button_passive_icon_svg = (const char*) temp_binary_data_15;
//================== bypass_icon.svg ==================
static const unsigned char temp_binary_data_15[] =
static const unsigned char temp_binary_data_16[] =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<svg id=\"Ebene_1\" data-name=\"Ebene 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 22 23\">\n"
" <rect x=\"10\" width=\"2\" height=\"12\"/>\n"
" <path d=\"M13,1.19v1.87c4.1.91,7.17,4.57,7.17,8.94,0,5.06-4.1,9.17-9.17,9.17S1.83,17.06,1.83,12C1.83,7.63,4.9,3.97,9,3.06v-1.87C3.88,2.13,0,6.61,0,12c0,6.08,4.92,11,11,11s11-4.92,11-11c0-5.39-3.88-9.87-9-10.81Z\" fill=\"black\"/>\n"
"</svg>";
const char* bypass_icon_svg = (const char*) temp_binary_data_15;
const char* bypass_icon_svg = (const char*) temp_binary_data_16;
const char* getNamedResource (const char* resourceNameUTF8, int& numBytes);
@ -11660,6 +11685,7 @@ const char* getNamedResource (const char* resourceNameUTF8, int& numBytes)
case 0xcbceafb3: numBytes = 24668; return OrbitronBold_ttf;
case 0x9c8232dc: numBytes = 24716; return OrbitronRegular_ttf;
case 0x93fe9a1e: numBytes = 146004; return RobotoRegular_ttf;
case 0xa297e1b2: numBytes = 1793; return logo_icon_svg;
case 0x1024555a: numBytes = 397; return bell_icon_svg;
case 0x46c5a278: numBytes = 316; return high_cut_icon_svg;
case 0x0133c050: numBytes = 420; return high_shelf_icon_svg;
@ -11685,6 +11711,7 @@ const char* namedResourceList[] =
"OrbitronBold_ttf",
"OrbitronRegular_ttf",
"RobotoRegular_ttf",
"logo_icon_svg",
"bell_icon_svg",
"high_cut_icon_svg",
"high_shelf_icon_svg",
@ -11705,6 +11732,7 @@ const char* originalFilenames[] =
"Orbitron-Bold.ttf",
"Orbitron-Regular.ttf",
"Roboto-Regular.ttf",
"logo_icon.svg",
"bell_icon.svg",
"high_cut_icon.svg",
"high_shelf_icon.svg",

View File

@ -29,6 +29,9 @@ namespace BinaryData
extern const char* RobotoRegular_ttf;
const int RobotoRegular_ttfSize = 146004;
extern const char* logo_icon_svg;
const int logo_icon_svgSize = 1793;
extern const char* bell_icon_svg;
const int bell_icon_svgSize = 397;
@ -57,7 +60,7 @@ namespace BinaryData
const int bypass_icon_svgSize = 406;
// Number of elements in the namedResourceList and originalFileNames arrays.
const int namedResourceListSize = 16;
const int namedResourceListSize = 17;
// Points to the start of a list of resource names.
extern const char* namedResourceList[];

View File

@ -52,6 +52,9 @@ void CrystalizerEQAudioProcessorEditor::setupSliders() {
&peak3FreqSlider, &peak3QSlider, &highBandFreqSlider, &highBandQSlider}) {
s->setLookAndFeel(freqQLookAndFeel.get());
}
lowBandSlopeSlider.setTextBoxStyle(juce::Slider::NoTextBox, true, 0, 0);
highBandSlopeSlider.setTextBoxStyle(juce::Slider::NoTextBox, true, 0, 0);
}
//endregion setupSliders
@ -130,7 +133,7 @@ void CrystalizerEQAudioProcessorEditor::setupDisplayNames() {
testNoiseSlider.setTextValueSuffix(" Gain");
//lowBandFreqSlider.setTextValueSuffix ("\nHz");
lowBandSlopeSlider.setTextValueSuffix ("\ndB/Oct");
//lowBandSlopeSlider.setTextValueSuffix ("\ndB/Oct");
lowBandGainSlider.setTextValueSuffix("\ndB");
//lowBandQSlider.setTextValueSuffix ("\nQ");
@ -151,7 +154,7 @@ void CrystalizerEQAudioProcessorEditor::setupDisplayNames() {
//highBandFreqSlider.setTextValueSuffix ("\nHz");
highBandSlopeSlider.setTextValueSuffix ("\ndB/Oct");
//highBandSlopeSlider.setTextValueSuffix ("\ndB/Oct");
highBandGainSlider.setTextValueSuffix("\ndB");
// highBandQSlider.setTextValueSuffix ("\nQ");
@ -416,7 +419,9 @@ void CrystalizerEQAudioProcessorEditor::addComponentsToLayout() {
lowBandSlopeSlider.addAndMakeVisible(low24);
lowBandSlopeSlider.addAndMakeVisible(low36);
lowBandSlopeSlider.addAndMakeVisible(low48);
lowFilterArea.addAndMakeVisible(lowBandSlopeSlider);
lowFilterArea.addAndMakeVisible(lowdBOctLabel);
lowFilterArea.addAndMakeVisible(lowBandGainSlider);
lowFilterArea.addAndMakeVisible(lowBandQSlider);
@ -478,6 +483,8 @@ void CrystalizerEQAudioProcessorEditor::addComponentsToLayout() {
highBandSlopeSlider.addAndMakeVisible(high36);
highBandSlopeSlider.addAndMakeVisible(high48);
highFilterArea.addAndMakeVisible(highBandSlopeSlider);
highFilterArea.addAndMakeVisible(highdBOctLabel);
highFilterArea.addAndMakeVisible(highBandGainSlider);
highFilterArea.addAndMakeVisible(highBandQSlider);
@ -486,13 +493,14 @@ void CrystalizerEQAudioProcessorEditor::addComponentsToLayout() {
}
addAndMakeVisible(footerBar);
footerBar.addAndMakeVisible(globalControlArea);
globalControlArea.addAndMakeVisible(inputLabel);
globalControlArea.addAndMakeVisible(outputLabel);
globalControlArea.addAndMakeVisible(inputSlider);
globalControlArea.addAndMakeVisible(outputSlider);
globalControlArea.addAndMakeVisible(masterBypassButton);
footerBar.addAndMakeVisible(globalControlArea);
addAndMakeVisible(footerBar);
}
//endregion addComponentsToLayout
@ -518,6 +526,7 @@ void CrystalizerEQAudioProcessorEditor::setupLabels() {
setupLabel(low24, "24");
setupLabel(low36, "36");
setupLabel(low48, "48");
setupLabel(lowdBOctLabel, "db/Oct");
//PEAK 1
setupLabel (peak1FreqLabel,"Low-Mid\nHz");
@ -544,6 +553,8 @@ void CrystalizerEQAudioProcessorEditor::setupLabels() {
setupLabel(high24, "24");
setupLabel(high36, "36");
setupLabel(high48, "48");
setupLabel(highdBOctLabel, "db/Oct");
setupLabel(presetBoxLabel, "Presets");
@ -754,6 +765,11 @@ CrystalizerEQAudioProcessorEditor::CrystalizerEQAudioProcessorEditor (Crystalize
setupSliders();
initPresetSystem();
auto logoIcon = juce::XmlDocument::parse (BinaryData::logo_icon_svg);
if (logoIcon != nullptr)
logoDrawable = juce::Drawable::createFromSVG (*logoIcon);
addAndMakeVisible (testNoiseButton);
testNoiseButton.onClick = [this]() {
@ -861,8 +877,11 @@ 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);
const auto logoArea = hB.toFloat().reduced(hBPad);
logoDrawable->drawWithin(g, logoArea,
juce::RectanglePlacement::xRight, // oder xLeft, yTop etc.
1.0f);
g.setColour(Colours::SURFACECOLOUR);
const auto pA = getLocalArea(&presetArea, presetArea.getLocalBounds());
@ -871,7 +890,10 @@ 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);
const auto fA = getLocalArea(&filterArea, filterArea.getLocalBounds());
const int fABorderWidth = 3;
@ -888,13 +910,13 @@ void CrystalizerEQAudioProcessorEditor::paint (juce::Graphics& g)
g.setColour(Colours::BACKGROUNDBYPASS);
g.fillRect(fA);
paintBorderLines(g);
//paintModeBoxBorders(g);
g.setColour(Colours::SURFACEBYPASS);
const auto fB = getLocalArea(&footerBar, footerBar.getLocalBounds());
g.fillRect(fB);
paintBorderLines(g);
if constexpr (false) // -> auf false setzen, wenn nicht gebraucht
@ -1054,6 +1076,25 @@ void CrystalizerEQAudioProcessorEditor::paintBorderLines(juce::Graphics &g) {
g.drawVerticalLine(x,center - halfLen, center + halfLen);
}
g.setColour(DesignSystem::Colours::SURFACECOLOUR);
auto prevRightGlobal = (float) globalControlArea.getRight();
for (auto* c : globalControlArea.getChildren()) {
if (c == &inputSlider) continue;
if (c == &masterBypassButton) continue;
const auto area = getLocalArea(c, c->getLocalBounds());
const float xAvg = ((float) area.getX() - prevRightGlobal) / 2;
const int x = area.getX() - xAvg;
prevRightGlobal = (float) c->getRight();
const auto top = (float) area.getY();
const auto bot = (float) area.getBottom();
const float center = (top + bot) * 0.5f;
const float halfLen = (bot - top) * 0.375f;
g.drawVerticalLine(x,center - halfLen, center + halfLen);
}
}
//endregion paintBorderLines
@ -1073,6 +1114,7 @@ void CrystalizerEQAudioProcessorEditor::setKnobVisibility() {
lowBandFreqLabel.setEnabled (lowMode >= 1);
lowBandSlopeSlider.setEnabled (lowMode == 1);
lowBandSlopeLabel.setEnabled (lowMode == 1);
lowdBOctLabel.setEnabled (lowMode == 1);
lowBandGainSlider.setEnabled(lowMode >= 2);
lowBandGainLabel .setEnabled(lowMode >= 2);
lowBandQSlider .setEnabled(lowMode >= 1);
@ -1090,6 +1132,7 @@ void CrystalizerEQAudioProcessorEditor::setKnobVisibility() {
highBandFreqLabel.setEnabled (highMode >= 1);
highBandSlopeSlider.setEnabled (highMode == 1);
highBandSlopeLabel.setEnabled (highMode == 1);
highdBOctLabel.setEnabled (highMode == 1);
highBandGainSlider.setEnabled(highMode >= 2);
highBandGainLabel .setEnabled(highMode >= 2);
highBandQSlider .setEnabled(highMode >= 1);
@ -1394,6 +1437,10 @@ void CrystalizerEQAudioProcessorEditor::setupLowBandLayout() {
Layout::area(lowBandSlopeLabel, 3, 1, 4, 2)
.withMargin(juce::GridItem::Margin(-offSetToGainTop / 1.5f, 0, 0, 0)),
Layout::area(lowdBOctLabel, 3, 1, 4, 2)
.withAlignSelf(juce::GridItem::AlignSelf::center)
.withJustifySelf(juce::GridItem::JustifySelf::center),
});
@ -1630,6 +1677,10 @@ void CrystalizerEQAudioProcessorEditor::setupHighBandLayout() {
Layout::area(highBandSlopeLabel, 3, 3, 4, 4)
.withMargin(juce::GridItem::Margin(-offSetToGainTop / 1.5f, 0, 0, 0)),
Layout::area(highdBOctLabel, 3, 3, 4, 4)
.withAlignSelf(juce::GridItem::AlignSelf::center)
.withJustifySelf(juce::GridItem::JustifySelf::center),
});
const auto modeBoxBounds = lowBandModeBox.getLocalBounds();
@ -1668,7 +1719,7 @@ void CrystalizerEQAudioProcessorEditor::setupFooter() {
const auto refH = getReferenceCell()[1];
Layout::GridSpec footerSpec{
/* cols */ { Layout::fr(1), Layout::fr(1), Layout::pxTrack(footerWidth / 3.0f) },
/* cols */ { Layout::fr(1), Layout::fr(1), Layout::fr(1) },
/* rows */ { Layout::fr(1) },
/* colGap */ Spacing::SizeMode::XS,
/* rowGap */ Spacing::SizeMode::XS,
@ -1682,10 +1733,12 @@ void CrystalizerEQAudioProcessorEditor::setupFooter() {
const auto globalControlAreaWidth = static_cast<float>(globalControlArea.getWidth());
const auto globalControlAreaHeight = static_cast<float>(globalControlArea.getHeight());
const auto globalControlColWidth = globalControlAreaWidth / 3.0f;
const auto sliderRadius = outputSlider.getWidth() / 2.0f;
const auto sliderWidth = outputSlider.getWidth();
Layout::GridSpec globalControlAreaSpec{
/* cols */ { Layout::fr(1), Layout::pxTrack(globalControlColWidth), Layout::fr(1) },
/* cols */ { Layout::fr(1), Layout::fr(1), Layout::fr(1) },
/* rows */ { Layout::fr(1)},
/* colGap */ Spacing::SizeMode::XS,
/* rowGap */ Spacing::SizeMode::XS,
@ -1694,19 +1747,26 @@ void CrystalizerEQAudioProcessorEditor::setupFooter() {
Layout::grid(globalControlAreaBounds, globalControlAreaSpec, {
//TODO: Bring components closer together
Layout::area(inputSlider, 1, 2, 3, 3)
.withWidth(refW * globalMod * 0.8f)
.withHeight(refH * globalMod * 0.8f)
Layout::area(outputSlider, 1, 2, 3, 3)
.withWidth(refW * globalMod )
.withHeight(refH * globalMod )
.withMargin(juce::GridItem::Margin(0, 0, 0, sliderRadius * 6))
.withAlignSelf(juce::GridItem::AlignSelf::center)
.withJustifySelf(juce::GridItem::JustifySelf::center),
Layout::area(outputSlider, 1, 3, 3, 4)
.withWidth(refW * globalMod * 0.8f)
.withHeight(refH * globalMod * 0.8f)
Layout::area(inputSlider, 1, 1, 3, 2)
.withWidth(refW * globalMod )
.withHeight(refH * globalMod )
.withMargin(juce::GridItem::Margin(0, 0, 0, sliderRadius * 10))
.withAlignSelf(juce::GridItem::AlignSelf::center)
.withJustifySelf(juce::GridItem::JustifySelf::center),
Layout::area(masterBypassButton, 1, 1, 3, 2),
Layout::area(masterBypassButton, 1, 3, 3, 4)
.withWidth(sliderWidth)
.withMargin(juce::GridItem::Margin(0, 0, 0, sliderRadius * 2)),
});
}

View File

@ -180,21 +180,21 @@ public:
juce::Label titleLabel, testNoiseLabel,
lowBandFreqLabel, lowBandSlopeLabel, lowBandGainLabel, lowBandQLabel, lowBandModeLabel,
low12, low24, low36, low48,
low12, low24, low36, low48, lowdBOctLabel,
peak1FreqLabel, peak1GainLabel, peak1QLabel,
peak2FreqLabel, peak2GainLabel, peak2QLabel,
peak3FreqLabel, peak3GainLabel, peak3QLabel,
highBandFreqLabel, highBandSlopeLabel, highBandGainLabel, highBandQLabel, highBandModeLabel,
high12, high24, high36, high48,
high12, high24, high36, high48, highdBOctLabel,
inputLabel, outputLabel,
presetBoxLabel;
const juce::Array<juce::Label*> sliderLabels = {
&lowBandFreqLabel, &lowBandSlopeLabel, &lowBandGainLabel, &lowBandQLabel, &lowBandModeLabel,
&lowBandFreqLabel, &lowBandSlopeLabel, &lowBandGainLabel, &lowBandQLabel, &lowBandModeLabel, &lowdBOctLabel,
&peak1FreqLabel, &peak1GainLabel, &peak1QLabel,
&peak2FreqLabel, &peak2GainLabel, &peak2QLabel,
&peak3FreqLabel, &peak3GainLabel, &peak3QLabel,
&highBandFreqLabel, &highBandSlopeLabel, &highBandGainLabel, &highBandQLabel, &highBandModeLabel,
&highBandFreqLabel, &highBandSlopeLabel, &highBandGainLabel, &highBandQLabel, &highBandModeLabel, &highdBOctLabel,
&inputLabel, &outputLabel
};
const juce::Array<juce::Label*> slopeLabels = {
@ -338,5 +338,7 @@ private:
bool isAnimatingCrystalize = false;
bool isFadingToActive = false;
std::unique_ptr<juce::Drawable> logoDrawable;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CrystalizerEQAudioProcessorEditor)
};