Deluge Firmware
1.3.0
Build date: 2026.08.23
Toggle main menu visibility
Loading...
Searching...
No Matches
transpose.h
1
/*
2
* Copyright (c) 2014-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
#pragma once
18
#include "decimal.h"
19
#include "definitions_cxx.hpp"
20
#include "gui/menu_item/patched_param.h"
21
22
#include <hid/buttons.h>
23
24
namespace
deluge::gui::menu_item {
25
26
class
Transpose :
public
Decimal
,
public
PatchedParam {
27
public
:
28
Transpose(l10n::String newName, int32_t newP = 0) :
Decimal
(newName), PatchedParam(newP) {}
29
30
Transpose(l10n::String newName, l10n::String
title
, int32_t newP = 0)
31
:
Decimal
(newName,
title
), PatchedParam(newP) {}
32
33
MenuItem*
selectButtonPress
() final {
return
PatchedParam::selectButtonPress(); }
34
[[nodiscard]] int32_t getMinValue() const final {
return
-9600; }
35
[[nodiscard]] int32_t getMaxValue() const final {
return
9600; }
36
[[nodiscard]] int32_t getNumDecimalPlaces() const final {
return
2; }
37
uint32_t
getParamIndex
() final {
return
PatchedParam::getParamIndex(); }
38
uint8_t
shouldDrawDotOnName
() final {
return
PatchedParam::shouldDrawDotOnName(); }
39
40
void
drawValue() final { Decimal::drawValue(); }
41
42
uint8_t
shouldBlinkPatchingSourceShortcut
(PatchSource s, uint8_t* colour)
final
{
43
return
PatchedParam::shouldBlinkPatchingSourceShortcut(s, colour);
44
}
45
MenuItem*
patchingSourceShortcutPress
(PatchSource s,
bool
previousPressStillActive =
false
) final {
46
return
PatchedParam::patchingSourceShortcutPress(s, previousPressStillActive);
47
}
48
49
void
unlearnAction
() final { MenuItemWithCCLearning::unlearnAction(); }
50
bool
allowsLearnMode
() final {
return
MenuItemWithCCLearning::allowsLearnMode(); }
51
void
learnKnob
(
::MIDICable
* cable, int32_t whichKnob, int32_t modKnobMode, int32_t midiChannel)
final
{
52
MenuItemWithCCLearning::learnKnob(cable, whichKnob, modKnobMode, midiChannel);
53
};
54
};
55
56
}
// namespace deluge::gui::menu_item
MIDICable
A MIDI cable connection. Stores all state specific to a given cable and its contained ports and chann...
Definition
midi_device.h:96
MenuItem::title
deluge::l10n::String title
Can get overridden by getTitle(). Actual max num chars for OLED display is 14.
Definition
menu_item.h:222
deluge::gui::menu_item::Decimal
Definition
decimal.h:24
deluge::gui::menu_item::Transpose::unlearnAction
void unlearnAction() final
Unlearn the parameter controlled by this menu.
Definition
transpose.h:49
deluge::gui::menu_item::Transpose::learnKnob
void learnKnob(::MIDICable *cable, int32_t whichKnob, int32_t modKnobMode, int32_t midiChannel) final
Definition
transpose.h:51
deluge::gui::menu_item::Transpose::shouldBlinkPatchingSourceShortcut
uint8_t shouldBlinkPatchingSourceShortcut(PatchSource s, uint8_t *colour) final
Definition
transpose.h:42
deluge::gui::menu_item::Transpose::allowsLearnMode
bool allowsLearnMode() final
Used by SoundEditor to determine if the current menu item can accept MIDI learning.
Definition
transpose.h:50
deluge::gui::menu_item::Transpose::shouldDrawDotOnName
uint8_t shouldDrawDotOnName() final
Get the "draw dot state".
Definition
transpose.h:38
deluge::gui::menu_item::Transpose::selectButtonPress
MenuItem * selectButtonPress() final
Handle a select button press.
Definition
transpose.h:33
deluge::gui::menu_item::Transpose::patchingSourceShortcutPress
MenuItem * patchingSourceShortcutPress(PatchSource s, bool previousPressStillActive=false) final
Action to take when a source shortcut is pressed.
Definition
transpose.h:45
deluge::gui::menu_item::Transpose::getParamIndex
uint32_t getParamIndex() final
Definition
transpose.h:37