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; }
80 virtual NotesState& getNotesState() {
return currentNotesState; }
82 virtual void checkNewInstrument(
Instrument* newInstrument) {}
85 inline bool isKit() {
return getCurrentOutputType() == OutputType::KIT; }
87 inline int16_t
getRootNote() {
return (currentSong->key.rootNote % kOctaveSize); }
88 inline bool getScaleModeEnabled() {
return getCurrentInstrumentClip()->inScaleMode; }
89 inline uint8_t getScaleNoteCount() {
return currentSong->key.modeNotes.count(); }
91 inline NoteSet& getScaleNotes() {
return currentSong->key.modeNotes; }
93 inline uint8_t getDefaultVelocity() {
return getCurrentInstrument()->defaultVelocity; }
95 inline int32_t getLowestClipNote() {
return kLowestKeyboardNote; }
96 inline int32_t getHighestClipNote() {
98 return getCurrentInstrumentClip()->noteRows.getNumElements() - 1;
101 return kHighestKeyboardNote;
104 inline RGB getNoteColour(uint8_t note) {
105 int8_t colourOffset = 0;
108 if (getCurrentOutputType() == OutputType::KIT) {
109 if (note >= 0 && note < getCurrentInstrumentClip()->noteRows.getNumElements()) {
110 NoteRow* noteRow = getCurrentInstrumentClip()->noteRows.getElement(note);
112 colourOffset = noteRow->getColourOffset(getCurrentInstrumentClip());
117 return getCurrentInstrumentClip()->getMainColourFromY(note, colourOffset);
120 inline NoteHighlightIntensity& getHighlightedNotes() {
return keyboardScreen.highlightedNotes; }
121 inline NoteHighlightIntensity& getNornsNotes() {
return keyboardScreen.nornsNotes; }
123 inline KeyboardState& getState() {
return getCurrentInstrumentClip()->keyboardState; }
126 uint8_t velocity = 64;
129 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.