Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
patch_cable_strength.h
1/*
2 * Copyright © 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
18#pragma once
19#include "decimal.h"
20#include "gui/menu_item/automation/automation.h"
21#include "menu_item_with_cc_learning.h"
22class MultiRange;
23
24namespace deluge::gui::menu_item {
25
26class PatchCableStrength : public Decimal, public MenuItemWithCCLearning, public Automation {
27public:
28 using Decimal::Decimal;
29 void beginSession(MenuItem* navigatedBackwardFrom) final;
30 void readCurrentValue() final;
31 void writeCurrentValue() override;
32 [[nodiscard]] int32_t getMinValue() const final { return kMinMenuPatchCableValue; }
33 [[nodiscard]] int32_t getMaxValue() const final { return kMaxMenuPatchCableValue; }
34 [[nodiscard]] int32_t getNumDecimalPlaces() const final { return 2; }
35 virtual int32_t getDefaultEditPos() { return 2; }
36 MenuPermission checkPermissionToBeginSession(ModControllableAudio* modControllable, int32_t whichThing,
37 MultiRange** currentRange) override;
38 virtual ParamDescriptor getDestinationDescriptor() = 0;
39 virtual PatchSource getS() = 0;
40 uint8_t getIndexOfPatchedParamToBlink() final;
41 MenuItem* selectButtonPress() override;
42 ActionResult buttonAction(deluge::hid::Button b, bool on, bool inCardRoutine);
43 void horizontalEncoderAction(int32_t offset);
44
46 uint32_t getParamIndex();
47 PatchSource getPatchSource() override;
48
49 // OLED Only
50 void renderOLED();
51
52 void unlearnAction() final { MenuItemWithCCLearning::unlearnAction(); }
53 bool allowsLearnMode() final { return MenuItemWithCCLearning::allowsLearnMode(); }
54 void learnKnob(MIDICable* cable, int32_t whichKnob, int32_t modKnobMode, int32_t midiChannel) final {
55 MenuItemWithCCLearning::learnKnob(cable, whichKnob, modKnobMode, midiChannel);
56 };
57
58 ModelStackWithAutoParam* getModelStackWithParam(void* memory) override;
59
60 void updateAutomationViewParameter() override;
61
64
65protected:
66 bool preferBarDrawing = false;
67 ModelStackWithAutoParam* getModelStack(void* memory, bool allowCreation = false);
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
Definition mod_controllable_audio.h:47
Definition model_stack.h:269
Definition multi_range.h:23
Definition param_descriptor.h:27
Definition automation.h:29
Definition decimal.h:24
Definition multi_range.h:24
Definition patch_cable_strength.h:26
uint32_t getParamIndex()
Definition patch_cable_strength.cpp:232
deluge::modulation::params::Kind getParamKind()
Definition patch_cable_strength.cpp:228
void learnKnob(MIDICable *cable, int32_t whichKnob, int32_t modKnobMode, int32_t midiChannel) final
Definition patch_cable_strength.h:54
ActionResult buttonAction(deluge::hid::Button b, bool on, bool inCardRoutine)
Handle an arbitrary button.
Definition patch_cable_strength.cpp:244
uint32_t delayHorizontalScrollUntil
Used when scrolling horizontally to briefly catch on min / max decimal number edit position.
Definition patch_cable_strength.h:63
bool allowsLearnMode() final
Used by SoundEditor to determine if the current menu item can accept MIDI learning.
Definition patch_cable_strength.h:53
void horizontalEncoderAction(int32_t offset)
Handle horizontal encoder movement.
Definition patch_cable_strength.cpp:248
void renderOLED()
Root rendering routine for OLED.
Definition patch_cable_strength.cpp:55
void updateAutomationViewParameter() override
Definition patch_cable_strength.cpp:277
void readCurrentValue() final
Like readValueAgain, but does not redraw.
Definition patch_cable_strength.cpp:139
void beginSession(MenuItem *navigatedBackwardFrom) final
Begin an editing session with this menu item.
Definition patch_cable_strength.cpp:46
MenuItem * selectButtonPress() override
Handle a select button press.
Definition patch_cable_strength.cpp:240
uint8_t getIndexOfPatchedParamToBlink() final
Definition patch_cable_strength.cpp:220
void unlearnAction() final
Unlearn the parameter controlled by this menu.
Definition patch_cable_strength.h:52
Kind
Definition param.h:42