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