Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
unpatched_param.h
1/*
2 * Copyright © 2017-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/menu_item/integer.h"
21#include "menu_item_with_cc_learning.h"
22#include "param.h"
23
25
26namespace deluge::gui::menu_item {
27
28class UnpatchedParam : public Param, public IntegerContinuous, public MenuItemWithCCLearning {
29public:
30 UnpatchedParam(l10n::String newName, l10n::String title, int32_t newP)
31 : Param(newP), IntegerContinuous(newName, title) {}
32
33 UnpatchedParam(l10n::String newName, int32_t newP) : Param(newP), IntegerContinuous(newName) {}
34
35 bool usesAffectEntire() override { return true; }
36 void readCurrentValue() override;
37 void writeCurrentValue() override;
38 ParamDescriptor getLearningThing() final;
39 [[nodiscard]] int32_t getMaxValue() const override { return Param::getMaxValue(); }
40 [[nodiscard]] int32_t getMinValue() const override { return Param::getMinValue(); }
41 MenuItem* selectButtonPress() final { return Param::selectButtonPress(); }
42 // this button action function definition should not be required as it should be inherited
43 // from the param class, however it does not work if the definition is removed, so there
44 // is likely a multi-inheritance issue that needs to be resolved
45 ActionResult buttonAction(deluge::hid::Button b, bool on, bool inCardRoutine) final {
46 return Param::buttonAction(b, on, inCardRoutine);
47 }
48 void horizontalEncoderAction(int32_t offset) final { return Param::horizontalEncoderAction(offset); }
49
50 void unlearnAction() final { MenuItemWithCCLearning::unlearnAction(); }
51 bool allowsLearnMode() final { return MenuItemWithCCLearning::allowsLearnMode(); }
52 void learnKnob(MIDICable* cable, int32_t whichKnob, int32_t modKnobMode, int32_t midiChannel) final {
53 MenuItemWithCCLearning::learnKnob(cable, whichKnob, modKnobMode, midiChannel);
54 };
55
57 uint32_t getParamIndex();
58 ParamSet* getParamSet() final;
59 ModelStackWithAutoParam* getModelStack(void* memory) final;
60
61 int32_t getParamValue() {
63 return getValue();
64 }
65
66protected:
67 virtual int32_t getFinalValue();
68};
69
70} // 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 model_stack.h:269
Definition param_descriptor.h:27
Definition param_set.h:36
void unlearnAction() final
Unlearn the parameter controlled by this menu.
Definition unpatched_param.h:50
void readCurrentValue() override
Like readValueAgain, but does not redraw.
Definition unpatched_param.cpp:36
MenuItem * selectButtonPress() final
Handle a select button press.
Definition unpatched_param.h:41
void horizontalEncoderAction(int32_t offset) final
Handle horizontal encoder movement.
Definition unpatched_param.h:48
ActionResult buttonAction(deluge::hid::Button b, bool on, bool inCardRoutine) final
Handle an arbitrary button.
Definition unpatched_param.h:45
bool allowsLearnMode() final
Used by SoundEditor to determine if the current menu item can accept MIDI learning.
Definition unpatched_param.h:51
bool usesAffectEntire() override
Claim support for Kit AFFECT_ENTIRE editing.
Definition unpatched_param.h:35
deluge::modulation::params::Kind getParamKind()
Definition unpatched_param.cpp:98
uint32_t getParamIndex()
Definition unpatched_param.cpp:103
void learnKnob(MIDICable *cable, int32_t whichKnob, int32_t modKnobMode, int32_t midiChannel) final
Definition unpatched_param.h:52
Kind
Definition param.h:42