#pragma once #include #include "PluginProcessor.h" namespace gelyk { class NeonLookAndFeel : public juce::LookAndFeel_V4 { public: NeonLookAndFeel(); void drawLinearSlider(juce::Graphics&, int x, int y, int width, int height, float sliderPos, float minSliderPos, float maxSliderPos, const juce::Slider::SliderStyle, juce::Slider&) override; void drawComboBox(juce::Graphics&, int width, int height, bool isButtonDown, int buttonX, int buttonY, int buttonW, int buttonH, juce::ComboBox&) override; void positionComboBoxText(juce::ComboBox&, juce::Label&) override; juce::Colour cyan { 0xff00e5ff }; juce::Colour magenta{ 0xffff2fd6 }; juce::Colour violet { 0xff8a2be2 }; juce::Colour bg { 0xff0b0f16 }; juce::Colour panel { 0xff121a24 }; juce::Colour line { 0xff1f2a38 }; juce::Colour textDim{ 0xff7a8aa0 }; }; // --------------------------------------------------------------------------- class GelykEQAudioProcessorEditor final : public juce::AudioProcessorEditor, public juce::Timer { public: explicit GelykEQAudioProcessorEditor(GelykEQAudioProcessor&); ~GelykEQAudioProcessorEditor() override; void paint(juce::Graphics&) override; void resized() override; void timerCallback() override; private: void rebuildFaders(); void scaleUI(float percent); GelykEQAudioProcessor& processor; NeonLookAndFeel lookAndFeel; static constexpr int numBands = 5; struct BandWidget { std::unique_ptr gain; std::unique_ptr q; std::unique_ptr freqLabel; std::unique_ptr gainLabel; }; BandWidget bands[numBands]; std::unique_ptr masterLabel; std::unique_ptr master; std::unique_ptr scaleBox; std::unique_ptr titleLabel; std::unique_ptr statusBar; std::unique_ptr statusGit; juce::AudioProcessorValueTreeState::SliderAttachment gainAttachments[numBands]; juce::AudioProcessorValueTreeState::SliderAttachment qAttachments[numBands]; std::unique_ptr masterAttachment; juce::AudioProcessorValueTreeState::ParameterAttachment analyserAttachment; juce::Array spectrum; juce::Array freqBins; std::atomic scaling { 1.0f }; // for resized() JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(GelykEQAudioProcessorEditor) }; } // namespace gelyk