#pragma once #include #include "LcdPanel.h" #include "PluginProcessor.h" #include "BinaryData.h" class RackEditor : public juce::AudioProcessorEditor, private juce::Timer { public: explicit RackEditor (RMX19AudioProcessor&); ~RackEditor() override; void paint (juce::Graphics&) override; void resized() override; bool keyPressed (const juce::KeyPress&) override; private: RMX19AudioProcessor& proc; class NavButton : public juce::Button { public: NavButton (int d, const juce::String& glyph, const juce::String& label) : juce::Button (label), dir (d), mark (glyph) { setWantsKeyboardFocus (true); setRepeatSpeed (320, 80); } void paintButton (juce::Graphics&, bool, bool) override; int dir; juce::String mark; }; class OkButton : public juce::Button { public: OkButton (const juce::String& label, bool isEnter) : juce::Button (label), enter (isEnter) { setWantsKeyboardFocus (true); setRepeatSpeed (320, 80); } void paintButton (juce::Graphics&, bool, bool) override; bool enter; }; NavButton* up = nullptr; NavButton* down = nullptr; NavButton* left = nullptr; NavButton* right = nullptr; OkButton* enterB = nullptr; OkButton* backB = nullptr; juce::ComboBox scaleBox; LcdPanel display; juce::Colour face; juce::Image backgroundImage; float powerPulse = 0.0f; float uiScale = 1.5f; static constexpr int baseW = 656, baseH = 248; void setScale (float s); void timerCallback() override; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (RackEditor) };