Vital
Loading...
Searching...
No Matches
keyboard_interface.h
Go to the documentation of this file.
1#pragma once
2
3#include "JuceHeader.h"
4#include "synth_section.h"
5
6class MidiKeyboard;
7
17public:
24 KeyboardInterface(MidiKeyboardState* keyboard_state);
25
30
38 void paintBackground(Graphics& g) override;
39
48 void paintBackgroundShadow(Graphics& g) override { if (isActive()) paintTabShadow(g); }
49
55 void resized() override;
56
61 void setFocus() { grabKeyboardFocus(); }
62
63private:
70 std::unique_ptr<MidiKeyboard> keyboard_;
71
72 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(KeyboardInterface)
73};
A UI section of the synthesizer interface that displays and handles a virtual MIDI keyboard.
Definition keyboard_interface.h:16
void resized() override
Called when the component is resized.
Definition keyboard_interface.cpp:38
void paintBackground(Graphics &g) override
Paints the background of the keyboard interface.
Definition keyboard_interface.cpp:30
KeyboardInterface(MidiKeyboardState *keyboard_state)
Constructs a new KeyboardInterface.
Definition keyboard_interface.cpp:12
~KeyboardInterface()
Destructor.
Definition keyboard_interface.cpp:23
void setFocus()
Sets the focus to this component, ensuring keyboard events are directed here.
Definition keyboard_interface.h:61
void paintBackgroundShadow(Graphics &g) override
Paints the shadow for the background (if the section is active).
Definition keyboard_interface.h:48
A visual and interactive MIDI keyboard component.
Definition midi_keyboard.h:17
Base class for all synthesizer sections, providing UI layout, painting, and interaction logic.
Definition synth_section.h:193
bool isActive() const
Checks if the section is currently active.
Definition synth_section.h:683
virtual void paintTabShadow(Graphics &g)
Paints a tab-like shadow effect around the component.
Definition synth_section.cpp:188