Deluge Firmware 1.3.0
Build date: 2025.04.16
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
22namespace deluge::gui::menu_item {
23
24class Transpose : public Decimal, public PatchedParam {
25public:
26 Transpose(l10n::String newName, int32_t newP = 0) : Decimal(newName), PatchedParam(newP) {}
27
28 Transpose(l10n::String newName, l10n::String title, int32_t newP = 0)
29 : Decimal(newName, title), PatchedParam(newP) {}
30
31 MenuItem* selectButtonPress() final { return PatchedParam::selectButtonPress(); }
32 [[nodiscard]] int32_t getMinValue() const final { return -9600; }
33 [[nodiscard]] int32_t getMaxValue() const final { return 9600; }
34 [[nodiscard]] int32_t getNumDecimalPlaces() const final { return 2; }
35 uint32_t getParamIndex() final { return PatchedParam::getParamIndex(); }
36 uint8_t shouldDrawDotOnName() final { return PatchedParam::shouldDrawDotOnName(); }
37
38 void drawValue() final { Decimal::drawValue(); }
39
40 uint8_t shouldBlinkPatchingSourceShortcut(PatchSource s, uint8_t* colour) final {
41 return PatchedParam::shouldBlinkPatchingSourceShortcut(s, colour);
42 }
43 MenuItem* patchingSourceShortcutPress(PatchSource s, bool previousPressStillActive = false) final {
44 return PatchedParam::patchingSourceShortcutPress(s, previousPressStillActive);
45 }
46
47 void unlearnAction() final { MenuItemWithCCLearning::unlearnAction(); }
48 bool allowsLearnMode() final { return MenuItemWithCCLearning::allowsLearnMode(); }
49 void learnKnob(::MIDICable* cable, int32_t whichKnob, int32_t modKnobMode, int32_t midiChannel) final {
50 MenuItemWithCCLearning::learnKnob(cable, whichKnob, modKnobMode, midiChannel);
51 };
52};
53
54} // 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:208
Definition decimal.h:24
void unlearnAction() final
Unlearn the parameter controlled by this menu.
Definition transpose.h:47
uint8_t shouldBlinkPatchingSourceShortcut(PatchSource s, uint8_t *colour) final
Definition transpose.h:40
bool allowsLearnMode() final
Used by SoundEditor to determine if the current menu item can accept MIDI learning.
Definition transpose.h:48
uint8_t shouldDrawDotOnName() final
Get the "draw dot state".
Definition transpose.h:36
MenuItem * selectButtonPress() final
Handle a select button press.
Definition transpose.h:31
MenuItem * patchingSourceShortcutPress(PatchSource s, bool previousPressStillActive=false) final
Action to take when a source shortcut is pressed.
Definition transpose.h:43
uint32_t getParamIndex() final
Definition transpose.h:35