Deluge Firmware
Loading...
Searching...
No Matches
patcher.h
Go to the documentation of this file.
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#ifndef PATCHABLE_H
19#define PATCHABLE_H
20
21#include "r_typedefs.h"
22
23struct CableGroup;
24
25class Sound;
27class PatchCableSet;
28struct Destination;
29class ParamManager;
30class PatchCable;
31
32#define GLOBALITY_GLOBAL 1
33#define GLOBALITY_LOCAL 0
34
38 uint8_t firstParam;
42 uint8_t endParams;
43 uint8_t globality;
44};
45
46
47
48class Patcher {
49public:
50 Patcher(const PatchableInfo* newInfo);
51 void performInitialPatching(Sound* sound, ParamManager* paramManager);
52 void performPatching(uint32_t sourcesChanged, Sound* sound, ParamManagerForTimeline* paramManager);
54
55private:
56 void applyRangeAdjustment(int32_t *patchedValue, PatchCable* patchCable);
57 int32_t combineCablesLinearForRangeParam(Destination const* destination, ParamManager* paramManager);
58 int32_t combineCablesLinear(Destination const* destination, unsigned int p, Sound* sound, ParamManager* paramManager);
59 int32_t combineCablesExp(Destination const* destination, unsigned int p, Sound* sound, ParamManager* paramManager);
60 void cableToLinearParamWithoutRangeAdjustment(int32_t sourceValue, int32_t cableStrength, int32_t* runningTotalCombination);
61 void cableToLinearParam(int32_t sourceValue, int32_t cableStrength, int32_t* runningTotalCombination, PatchCable* patchCable);
62 void cableToExpParamWithoutRangeAdjustment(int32_t sourceValue, int32_t cableStrength, int32_t* runningTotalCombination);
63 void cableToExpParam(int32_t sourceValue, int32_t cableStrength, int32_t* runningTotalCombination, PatchCable* patchCable);
64 int32_t* getParamFinalValuesPointer();
65 int32_t getSourceValue(int s);
66
67 const PatchableInfo* const patchableInfo;
68};
69
70#endif // PATCHABLE_H
Definition: ParamManager.h:166
Definition: ParamManager.h:50
Definition: PatchCable.h:28
Definition: PatchCableSet.h:41
Definition: patcher.h:48
void recalculateFinalValueForParamWithNoCables(int p, Sound *sound, ParamManagerForTimeline *paramManager)
Definition: patcher.cpp:42
void performPatching(uint32_t sourcesChanged, Sound *sound, ParamManagerForTimeline *paramManager)
Definition: patcher.cpp:74
void performInitialPatching(Sound *sound, ParamManager *paramManager)
Definition: patcher.cpp:293
Definition: sound.h:66
Definition: PatchCableSet.h:28
Definition: PatchCableSet.h:34
Definition: patcher.h:35
uint8_t firstParam
Definition: patcher.h:38
int32_t sourceValuesOffset
Definition: patcher.h:37
uint8_t firstExpParam
Definition: patcher.h:41
uint8_t firstHybridParam
Definition: patcher.h:40
int32_t paramFinalValuesOffset
Definition: patcher.h:36
uint8_t firstNonVolumeParam
Definition: patcher.h:39
uint8_t globality
Definition: patcher.h:43
uint8_t endParams
Definition: patcher.h:42