Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
mod_controllable.h
1/*
2 * Copyright © 2016-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 "definitions_cxx.hpp"
20#include "modulation/params/param.h"
21
24class InstrumentClip;
25class Action;
27class AutoParam;
28class ParamCollection;
29class Sound;
30class TimelineCounter;
33class MIDIKnob;
35
40class ModControllable {
41public:
42 ModControllable() = default;
43 virtual ~ModControllable() = default;
44 virtual bool modEncoderButtonAction(uint8_t whichModEncoder, bool on, ModelStackWithThreeMainThings* modelStack) {
45 return false;
46 } // Returns whether Instrument was changed
47 virtual void modButtonAction(uint8_t whichModButton, bool on, ParamManagerForTimeline* paramManager) {};
49 getParamFromModEncoder(int32_t whichModEncoder, ModelStackWithThreeMainThings* modelStack,
50 bool allowCreation = true); // Check that autoParam isn't NULL, after calling this.
51
54
55 virtual uint8_t* getModKnobMode(); // Return NULL if different modes not supported
56 virtual bool isKit() { return false; }
57 virtual bool isSong() { return false; }
58 virtual bool isEditingComp() { return false; }
59 virtual bool valueChangedEnoughToMatter(int32_t old_value, int32_t new_value, deluge::modulation::params::Kind kind,
60 uint32_t paramID) {
61 return old_value != new_value;
62 }
63 virtual int32_t getKnobPosForNonExistentParam(
64 int32_t whichModEncoder,
65 ModelStackWithAutoParam* modelStack); // modelStack->autoParam will be NULL in this rare case!!
66 virtual ActionResult modEncoderActionForNonExistentParam(int32_t offset, int32_t whichModEncoder,
67 ModelStackWithAutoParam* modelStack) {
68 return ActionResult::NOT_DEALT_WITH;
69 }
70 virtual bool allowNoteTails(ModelStackWithSoundFlags* modelStack, bool disregardSampleLoop = false) { return true; }
71 virtual void polyphonicExpressionEventOnChannelOrNote(int32_t newValue, int32_t expressionDimension,
72 int32_t channelOrNoteNumber,
73 MIDICharacteristic whichCharacteristic) {}
74 virtual void monophonicExpressionEvent(int32_t newValue, int32_t expressionDimension) {}
75
76protected:
82};
Definition action.h:75
Definition auto_param.h:44
Definition instrument_clip.h:48
Definition knob.h:34
deluge::modulation::params::Kind unpatchedParamKind_
Definition mod_controllable.h:81
virtual ModelStackWithAutoParam * getParamFromMIDIKnob(MIDIKnob &knob, ModelStackWithThreeMainThings *modelStack)
Check that autoParam isn't NULL, after calling this.
Definition mod_controllable.cpp:40
Definition model_stack.h:269
Definition model_stack.h:287
Definition model_stack.h:231
Definition param_collection.h:39
Definition param_manager.h:174
Definition sound.h:71
Definition timeline_counter.h:28
Kind
Definition param.h:42