#pragma once #include #include #include "Knob.h" #include "PluginProcessor.h" #include "HorizontLookAndFeel.h" #include "SpectrumDisplay.h" class HorizontAudioProcessorEditor : public juce::AudioProcessorEditor, private juce::ComboBox::Listener { public: HorizontAudioProcessorEditor (HorizontAudioProcessor&, juce::AudioProcessorValueTreeState&); ~HorizontAudioProcessorEditor() override; void paint (juce::Graphics&) override; void resized() override; void mouseWheelMove (const juce::MouseEvent&, const juce::MouseWheelDetails&) override; float getScaleFactor() const noexcept { return scaleFactor; } private: void comboBoxChanged (juce::ComboBox* boxThatHasChanged) override; void layoutKnobRow (juce::Rectangle area, int startIndex, int count); void setScaleFactor (float newScale); void updateScaleFactor(); void updateScaleSelection(); HorizontAudioProcessor& processor; juce::AudioProcessorValueTreeState& apvts; std::unique_ptr lookAndFeel; juce::Label titleLabel; juce::Label subtitleLabel; juce::ComboBox presetBox; juce::ComboBox scaleBox; juce::Label footerLabel; SpectrumDisplay display; std::vector> knobs; juce::Rectangle knobRow1Area; juce::Rectangle knobRow2Area; juce::Rectangle footerArea; float scaleFactor = 1.0f; static constexpr float baseWidth = 860.0f; static constexpr float baseHeight = 606.0f; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (HorizontAudioProcessorEditor) };