Deluge Firmware 1.3.0
Build date: 2025.09.14
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
24namespace deluge::gui::menu_item {
25
26class Transpose : public Decimal, public PatchedParam {
27public:
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
A MIDI cable connection. Stores all state specific to a given cable and its contained ports and chann...
Definition midi_device.h:94
deluge::l10n::String title
Can get overridden by getTitle(). Actual max num chars for OLED display is 14.
Definition menu_item.h:215
Definition decimal.h:24
void unlearnAction() final
Unlearn the parameter controlled by this menu.
Definition transpose.h:49
uint8_t shouldBlinkPatchingSourceShortcut(PatchSource s, uint8_t *colour) final
Definition transpose.h:42
bool allowsLearnMode() final
Used by SoundEditor to determine if the current menu item can accept MIDI learning.
Definition transpose.h:50
uint8_t shouldDrawDotOnName() final
Get the "draw dot state".
Definition transpose.h:38
MenuItem * selectButtonPress() final
Handle a select button press.
Definition transpose.h:33
MenuItem * patchingSourceShortcutPress(PatchSource s, bool previousPressStillActive=false) final
Action to take when a source shortcut is pressed.
Definition transpose.h:45
uint32_t getParamIndex() final
Definition transpose.h:37