-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy patheffectmanifestparameter.h
229 lines (193 loc) · 6.76 KB
/
effectmanifestparameter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
#ifndef EFFECTMANIFESTPARAMETER_H
#define EFFECTMANIFESTPARAMETER_H
#include <QVariant>
#include <QString>
#include <QtDebug>
class EffectManifestParameter {
public:
enum ControlHint {
CONTROL_UNKNOWN = 0,
CONTROL_KNOB_LINEAR,
CONTROL_KNOB_LOGARITHMIC,
CONTROL_KNOB_STEPPING, // A step rotary, steps given by m_steps
// are arranged with equal distance on scale
CONTROL_TOGGLE_STEPPING // For button and enum controls, not accessible
// form many controllers, no linking to super knob
};
enum SemanticHint {
SEMANTIC_UNKNOWN = 0,
SEMANTIC_SAMPLES,
SEMANTIC_NOTE,
};
enum UnitsHint {
UNITS_UNKNOWN = 0,
UNITS_TIME,
UNITS_HERTZ,
UNITS_SAMPLERATE, // fraction of the samplerate
UNITS_BEATS, // multiples of a beat
};
enum LinkType {
LINK_NONE = 0, // Not controlled by the super knob
LINK_LINKED, // Controlled by the super knob as it is
LINK_LINKED_LEFT, // Controlled by the left side of the super knob
LINK_LINKED_RIGHT, // Controlled by the right side of the super knob
LINK_LINKED_LEFT_RIGHT, // Controlled by both sides of the super knob
NUM_LINK_TYPES
};
enum class LinkInversion {
NOT_INVERTED = 0,
INVERTED = 1
};
EffectManifestParameter()
: m_controlHint(CONTROL_UNKNOWN),
m_semanticHint(SEMANTIC_UNKNOWN),
m_unitsHint(UNITS_UNKNOWN),
m_defaultLinkType(LINK_NONE),
m_defaultLinkInversion(LinkInversion::NOT_INVERTED),
m_neutralPointOnScale(0.0),
m_default(0),
m_minimum(0),
m_maximum(1.0),
m_showInParametertSlot(true) {
}
virtual ~EffectManifestParameter() {
//qDebug() << debugString() << "destroyed";
}
////////////////////////////////////////////////////////////////////////////////
// Parameter Information
////////////////////////////////////////////////////////////////////////////////
virtual const QString& id() const {
return m_id;
}
virtual void setId(const QString& id) {
m_id = id;
}
virtual const QString& name() const {
return m_name;
}
virtual void setName(const QString& name) {
m_name = name;
}
virtual const QString& shortName() const {
return m_shortName;
}
virtual void setShortName(const QString& shortName) {
m_shortName = shortName;
}
virtual const QString& description() const {
return m_description;
}
virtual void setDescription(const QString& description) {
m_description = description;
}
////////////////////////////////////////////////////////////////////////////////
// Usage hints
////////////////////////////////////////////////////////////////////////////////
virtual ControlHint controlHint() const {
return m_controlHint;
}
virtual void setControlHint(ControlHint controlHint) {
m_controlHint = controlHint;
}
virtual SemanticHint semanticHint() const {
return m_semanticHint;
}
virtual void setSemanticHint(SemanticHint semanticHint) {
m_semanticHint = semanticHint;
}
virtual UnitsHint unitsHint() const {
return m_unitsHint;
}
virtual void setUnitsHint(UnitsHint unitsHint) {
m_unitsHint = unitsHint;
}
virtual LinkType defaultLinkType() const {
return m_defaultLinkType;
}
virtual void setDefaultLinkType(const LinkType linkType) {
m_defaultLinkType = linkType;
}
virtual LinkInversion defaultLinkInversion() const {
return m_defaultLinkInversion;
}
virtual void setDefaultLinkInversion(const LinkInversion linkInversion) {
m_defaultLinkInversion = linkInversion;
}
// Neutral Point On Scale is the parameter in the range 0 .. 1 on the knob that
// is adopted as neutral when controlled by the super knob.
// This is allows to link the super knob in a way that two effects are
// cranked in simultaneous, or in case of a split filter like super knob,
// both effects are neutral at super knob center.
// A EQ Gain has usually a neutral point of 0.5 (0 dB) while a delay knob
// has a neutral point of 0.0 (no delay)
// A EQ Gain knob cannot be used on a split super knob.
virtual double neutralPointOnScale() const {
return m_neutralPointOnScale;
}
virtual void setNeutralPointOnScale(double neutralPoint) {
m_neutralPointOnScale = neutralPoint;
}
// These store the mapping between the parameter slot and
// the effective parameter which is loaded onto the slot.
// This is required because we have only 8 parameter slots, but
// LV2 or VST effects can have more then 8.
virtual bool showInParameterSlot() const {
return m_showInParametertSlot;
}
virtual void setShowInParameterSlot(double show) {
m_showInParametertSlot = show;
}
////////////////////////////////////////////////////////////////////////////////
// Value Settings
////////////////////////////////////////////////////////////////////////////////
virtual const double& getDefault() const {
return m_default;
}
virtual void setDefault(const double& defaultValue) {
m_default = defaultValue;
}
virtual const double& getMinimum() const {
return m_minimum;
}
virtual void setMinimum(const double& minimum) {
m_minimum = minimum;
}
virtual const double& getMaximum() const {
return m_maximum;
}
virtual void setMaximum(const double& maximum) {
m_maximum = maximum;
}
virtual void appendStep(const QPair<QString, double>& step) {
m_steps.append(step);
}
virtual const QList<QPair<QString, double> >& getSteps() const {
return m_steps;
}
private:
QString debugString() const {
return QString("EffectManifestParameter(%1)").arg(m_id);
}
QString m_id;
QString m_name;
QString m_shortName;
QString m_description;
ControlHint m_controlHint;
SemanticHint m_semanticHint;
UnitsHint m_unitsHint;
LinkType m_defaultLinkType;
LinkInversion m_defaultLinkInversion;
double m_neutralPointOnScale;
double m_default;
double m_minimum;
double m_maximum;
// Used to describe steps of
// CONTROL_KNOB_STEPPING and CONTROL_TOGGLE_STEPPING
// effect parameters
// Each pair has the following form:
// name - value
QList<QPair<QString, double> > m_steps;
bool m_showInParametertSlot;
};
QDebug operator<<(QDebug dbg, const EffectManifestParameter& parameter);
#endif /* EFFECTMANIFESTPARAMETER_H */