21#include "definitions.h"
22#include "gui/ui/keyboard/chords.h"
23#include "gui/ui/keyboard/layout/column_controls.h"
26namespace deluge::gui::ui::keyboard::layout {
28constexpr int8_t kVerticalPages = ((kUniqueChords + kDisplayHeight - 1) / kDisplayHeight);
31class KeyboardLayoutChordLibrary :
public ColumnControlsKeyboard {
33 KeyboardLayoutChordLibrary() =
default;
34 ~KeyboardLayoutChordLibrary()
override =
default;
39 bool encoderPressed =
false)
override;
42 void renderPads(
RGB image[][kDisplayWidth + kSideBarWidth])
override;
44 l10n::String name()
override {
return l10n::String::STRING_FOR_KEYBOARD_LAYOUT_CHORD_LIBRARY; }
46 bool supportsKit()
override {
return false; }
49 bool allowSidebarType(ColumnControlFunction sidebarType)
override;
52 void drawChordName(int16_t noteCode,
const char* chordName =
"",
const char* voicingName =
"");
53 inline uint8_t noteFromCoords(int32_t x) {
return getState().chordLibrary.noteOffset + x; }
54 inline int32_t getChordNo(int32_t y) {
return getState().chordLibrary.chordList.chordRowOffset + y; }
56 std::array<RGB, kOctaveSize> noteColours;
57 std::array<RGB, kVerticalPages> pageColours;
58 bool initializedNoteOffset =
false;
This class represents the colour format most used by the Deluge globally.
Definition rgb.h:14
void handleVerticalEncoder(int32_t offset) override
Shift state not supplied since that function is already taken.
Definition chord_library.cpp:60
void handleHorizontalEncoder(int32_t offset, bool shiftEnabled, PressedPad presses[kMaxNumKeyboardPadPresses], bool encoderPressed=false) override
Will be called with offset 0 to recalculate bounds on clip changes.
Definition chord_library.cpp:70
bool supportsInstrument() override
This currently includes Synth, MIDI and CV.
Definition chord_library.h:45
void precalculate() override
This function is called on visibility change and if colour offset changes.
Definition chord_library.cpp:96
void renderPads(RGB image[][kDisplayWidth+kSideBarWidth]) override
Handle output.
Definition chord_library.cpp:116
void evaluatePads(PressedPad presses[kMaxNumKeyboardPadPresses]) override
Handle input pad presses.
Definition chord_library.cpp:33
Definition notes_state.h:31