-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathequalizer_util.h
75 lines (65 loc) · 3.15 KB
/
equalizer_util.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
#pragma once
#include <QObject>
#include "effects/backends/effectmanifest.h"
class EqualizerUtil {
public:
// Creates common EQ parameters like low/mid/high gain and kill buttons.
static void createCommonParameters(EffectManifest* pManifest, bool linear) {
EffectManifestParameter::ValueScaler valueScaler =
EffectManifestParameter::ValueScaler::Logarithmic;
double maximum = 4.0;
if (linear) {
valueScaler = EffectManifestParameter::ValueScaler::Linear;
maximum = 2.0;
}
EffectManifestParameterPointer low = pManifest->addParameter();
low->setId("low");
low->setName(QObject::tr("Low"));
low->setDescription(QObject::tr("Gain for Low Filter"));
low->setValueScaler(valueScaler);
low->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown);
low->setNeutralPointOnScale(0.5);
low->setRange(0, 1.0, maximum);
EffectManifestParameterPointer killLow = pManifest->addParameter();
killLow->setId("killLow");
killLow->setName(QObject::tr("Kill Low"));
killLow->setDescription(QObject::tr("Kill the Low Filter"));
killLow->setValueScaler(EffectManifestParameter::ValueScaler::Toggle);
killLow->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown);
killLow->setRange(0, 0, 1);
EffectManifestParameterPointer mid = pManifest->addParameter();
mid->setId("mid");
mid->setName(QObject::tr("Mid"));
mid->setDescription(QObject::tr("Gain for Mid Filter"));
mid->setValueScaler(valueScaler);
mid->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown);
mid->setNeutralPointOnScale(0.5);
mid->setRange(0, 1.0, maximum);
EffectManifestParameterPointer killMid = pManifest->addParameter();
killMid->setId("killMid");
killMid->setName(QObject::tr("Kill Mid"));
killMid->setDescription(QObject::tr("Kill the Mid Filter"));
killMid->setValueScaler(EffectManifestParameter::ValueScaler::Toggle);
killMid->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown);
killMid->setRange(0, 0, 1);
EffectManifestParameterPointer high = pManifest->addParameter();
high->setId("high");
high->setName(QObject::tr("High"));
high->setDescription(QObject::tr("Gain for High Filter"));
high->setValueScaler(valueScaler);
high->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown);
high->setNeutralPointOnScale(0.5);
high->setRange(0, 1.0, maximum);
EffectManifestParameterPointer killHigh = pManifest->addParameter();
killHigh->setId("killHigh");
killHigh->setName(QObject::tr("Kill High"));
killHigh->setDescription(QObject::tr("Kill the High Filter"));
killHigh->setValueScaler(EffectManifestParameter::ValueScaler::Toggle);
killHigh->setUnitsHint(EffectManifestParameter::UnitsHint::Unknown);
killHigh->setRange(0, 0, 1);
}
static QString adjustFrequencyShelvesTip() {
return QObject::tr(
"To adjust frequency shelves, go to Preferences -> Mixer.");
}
};