Deluge Firmware
1.3.0
Build date: 2026.08.29
Toggle main menu visibility
Loading...
Searching...
No Matches
norns.h
1
/*
2
* Copyright © 2016-2023 Synthstrom Audible Limited
3
*
4
* This file is part of The Synthstrom Audible Deluge Firmware.
5
*
6
* The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7
* terms of the GNU General Public License as published by the Free Software Foundation,
8
* either version 3 of the License, or (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
* See the GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License along with this program.
15
* If not, see <https://www.gnu.org/licenses/>.
16
*/
17
18
#pragma once
19
20
#include "gui/ui/keyboard/layout.h"
21
22
namespace
deluge::gui::ui::keyboard::layout {
23
24
constexpr
int32_t kMinNornsRowInterval = 1;
25
constexpr
int32_t kMaxNornsRowInterval = 16;
26
27
class
KeyboardLayoutNorns :
public
KeyboardLayout {
28
public
:
29
KeyboardLayoutNorns() =
default
;
30
~KeyboardLayoutNorns()
override
=
default
;
31
32
void
evaluatePads
(
PressedPad
presses[kMaxNumKeyboardPadPresses])
override
;
33
void
handleVerticalEncoder
(int32_t offset)
override
;
34
void
handleHorizontalEncoder
(int32_t offset,
bool
shiftEnabled,
PressedPad
presses[kMaxNumKeyboardPadPresses],
35
bool
encoderPressed =
false
)
override
;
36
void
precalculate
()
override
;
37
38
void
renderPads
(
RGB
image[][kDisplayWidth + kSideBarWidth])
override
;
39
40
l10n::String name()
override
{
return
l10n::String::STRING_FOR_KEYBOARD_LAYOUT_NORNS; }
41
bool
supportsInstrument
()
override
{
return
true
; }
42
bool
supportsKit()
override
{
return
false
; }
43
44
private
:
45
inline
uint8_t noteFromCoords(int32_t x, int32_t y) {
return
x + y * kDisplayWidth; }
46
};
47
48
};
// namespace deluge::gui::ui::keyboard::layout
RGB
This class represents the colour format most used by the Deluge globally.
Definition
rgb.h:14
deluge::gui::ui::keyboard::layout::KeyboardLayoutNorns::precalculate
void precalculate() override
This function is called on visibility change and if colour offset changes.
Definition
norns.cpp:42
deluge::gui::ui::keyboard::layout::KeyboardLayoutNorns::handleVerticalEncoder
void handleVerticalEncoder(int32_t offset) override
Shift state not supplied since that function is already taken.
Definition
norns.cpp:35
deluge::gui::ui::keyboard::layout::KeyboardLayoutNorns::renderPads
void renderPads(RGB image[][kDisplayWidth+kSideBarWidth]) override
Handle output.
Definition
norns.cpp:45
deluge::gui::ui::keyboard::layout::KeyboardLayoutNorns::evaluatePads
void evaluatePads(PressedPad presses[kMaxNumKeyboardPadPresses]) override
Handle input pad presses.
Definition
norns.cpp:22
deluge::gui::ui::keyboard::layout::KeyboardLayoutNorns::supportsInstrument
bool supportsInstrument() override
This currently includes Synth, MIDI and CV.
Definition
norns.h:41
deluge::gui::ui::keyboard::layout::KeyboardLayoutNorns::handleHorizontalEncoder
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
norns.cpp:38
deluge::gui::ui::keyboard::PressedPad
Definition
notes_state.h:31