mirror of
https://codeberg.org/armin/horizont.git
synced 2026-09-01 04:10:46 +02:00
54 lines
1.6 KiB
C++
54 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include <JuceHeader.h>
|
|
|
|
#include <vector>
|
|
|
|
#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<int> area, int startIndex, int count);
|
|
void setScaleFactor (float newScale);
|
|
void updateScaleFactor();
|
|
void updateScaleSelection();
|
|
|
|
HorizontAudioProcessor& processor;
|
|
juce::AudioProcessorValueTreeState& apvts;
|
|
|
|
std::unique_ptr<HorizontLookAndFeel> lookAndFeel;
|
|
juce::Label titleLabel;
|
|
juce::Label subtitleLabel;
|
|
juce::ComboBox presetBox;
|
|
juce::ComboBox scaleBox;
|
|
juce::Label footerLabel;
|
|
SpectrumDisplay display;
|
|
|
|
std::vector<std::unique_ptr<Knob>> knobs;
|
|
|
|
juce::Rectangle<int> knobRow1Area;
|
|
juce::Rectangle<int> knobRow2Area;
|
|
juce::Rectangle<int> 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)
|
|
};
|