44 KeyboardLayout() =
default;
45 virtual ~KeyboardLayout() {}
56 bool encoderPressed =
false) = 0;
64 virtual void renderSidebarPads(
RGB image[][kDisplayWidth + kSideBarWidth]) {
66 for (int32_t y = 0; y < kDisplayHeight; y++) {
67 image[y][kDisplayWidth] = colours::black;
68 image[y][kDisplayWidth + 1] = colours::black;
74 virtual l10n::String name() = 0;
77 virtual bool supportsKit() {
return false; }
78 virtual RequiredScaleMode requiredScaleMode() {
return RequiredScaleMode::Undefined; }
84 virtual NotesState& getNotesState() {
return currentNotesState; }
86 virtual void checkNewInstrument(
Instrument* newInstrument) {}
89 inline bool isKit() {
return getCurrentOutputType() == OutputType::KIT; }
91 inline int16_t
getRootNote() {
return (currentSong->key.rootNote % kOctaveSize); }
92 inline bool getScaleModeEnabled() {
return getCurrentInstrumentClip()->inScaleMode; }
93 inline uint8_t getScaleNoteCount() {
return currentSong->key.modeNotes.count(); }
95 inline NoteSet& getScaleNotes() {
return currentSong->key.modeNotes; }
97 inline uint8_t getDefaultVelocity() {
return getCurrentInstrument()->defaultVelocity; }
99 inline int32_t getLowestClipNote() {
return kLowestKeyboardNote; }
100 inline int32_t getHighestClipNote() {
102 return getCurrentInstrumentClip()->noteRows.getNumElements() - 1;
105 return kHighestKeyboardNote;
108 inline RGB getNoteColour(uint8_t note) {
109 int8_t colourOffset = 0;
112 if (getCurrentOutputType() == OutputType::KIT) {
113 if (note >= 0 && note < getCurrentInstrumentClip()->noteRows.getNumElements()) {
114 NoteRow* noteRow = getCurrentInstrumentClip()->noteRows.getElement(note);
116 colourOffset = noteRow->getColourOffset(getCurrentInstrumentClip());
121 return getCurrentInstrumentClip()->getMainColourFromY(note, colourOffset);
124 inline NoteHighlightIntensity& getHighlightedNotes() {
return keyboardScreen.highlightedNotes; }
125 inline NoteHighlightIntensity& getNornsNotes() {
return keyboardScreen.nornsNotes; }
127 inline KeyboardState& getState() {
return getCurrentInstrumentClip()->keyboardState; }
130 uint8_t velocity = 64;
133 NotesState currentNotesState;
virtual void handleHorizontalEncoder(int32_t offset, bool shiftEnabled, PressedPad presses[kMaxNumKeyboardPadPresses], bool encoderPressed=false)=0
Will be called with offset 0 to recalculate bounds on clip changes.