mirror of
https://codeberg.org/armin/rmx-19.git
synced 2026-10-11 16:51:55 +02:00
53 lines
1.5 KiB
C
53 lines
1.5 KiB
C
|
|
#pragma once
|
||
|
|
#include <juce_gui_basics/juce_gui_basics.h>
|
||
|
|
#include "LcdPanel.h"
|
||
|
|
#include "PluginProcessor.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;
|
||
|
|
|
||
|
|
LcdPanel display;
|
||
|
|
|
||
|
|
juce::Colour face;
|
||
|
|
float powerPulse = 0.0f;
|
||
|
|
|
||
|
|
void timerCallback() override;
|
||
|
|
|
||
|
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (RackEditor)
|
||
|
|
};
|