commit 09d7caaa263be5102d7ed44d8a579537277cb694
parent b9fe8db5901a9c17042936689d0093046f0bef92
Author: Johannes Lorenz <[email protected]>
Date: Sat, 16 Dec 2017 19:21:51 +0100
Make Effect ports rOption like
Diffstat:
7 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/Effects/Alienwah.cpp b/src/Effects/Alienwah.cpp
@@ -42,7 +42,7 @@ rtosc::Ports Alienwah::ports = {
"Effect Frequency"),
rEffPar(Pfreqrnd, 3, rShort("rand"), rPreset(1, 106) rDefault(0),
"Frequency Randomness"),
- rEffPar(PLFOtype, 4, rShort("shape"),
+ rEffParOpt(PLFOtype, 4, rShort("shape"),
rOptions(sine, triangle), rPresets(sine, sine, triangle, triangle),
"LFO Shape"),
rEffPar(PStereo, 5, rShort("stereo"), rPresets(62, 101, 100, 66),
diff --git a/src/Effects/Chorus.cpp b/src/Effects/Chorus.cpp
@@ -47,7 +47,7 @@ rtosc::Ports Chorus::ports = {
rEffPar(Pfreqrnd, 3, rShort("rand"),
rPreset(4, 117) rPreset(6, 34) rPreset(7, 34) rPreset(9, 105)
rDefault(0), "Frequency Randomness"),
- rEffPar(PLFOtype, 4, rShort("shape"),
+ rEffParOpt(PLFOtype, 4, rShort("shape"),
rOptions(sine, tri),
rPresets(sine, sine, tri, sine, sine, sine, tri, tri, tri, sine),
"LFO Shape"),
diff --git a/src/Effects/Distorsion.cpp b/src/Effects/Distorsion.cpp
@@ -45,7 +45,7 @@ rtosc::Ports Distorsion::ports = {
"Input amplification"),
rEffPar(Plevel, 4, rShort("output"), rPresets(70, 75, 80, 62, 75, 75),
"Output amplification"),
- rEffPar(Ptype, 5, rShort("type"),
+ rEffParOpt(Ptype, 5, rShort("type"),
rOptions(Arctangent, Asymmetric, Pow, Sine, Quantisize,
Zigzag, Limiter, Upper Limiter, Lower Limiter,
Inverse Limiter, Clip, Asym2, Pow2, sigmoid),
diff --git a/src/Effects/DynamicFilter.cpp b/src/Effects/DynamicFilter.cpp
@@ -42,8 +42,8 @@ rtosc::Ports DynamicFilter::ports = {
"Effect Frequency"),
rEffPar(Pfreqrnd, 3, rShort("rand"), rDefault(0),
"Frequency Randomness"),
- rEffPar(PLFOtype, 4, rShort("shape"), rOptions(sin, tri), rDefault(sin),
- "LFO Shape"),
+ rEffParOpt(PLFOtype, 4, rShort("shape"), rOptions(sin, tri),
+ rDefault(sin), "LFO Shape"),
rEffPar(PStereo, 5, rShort("stereo"), rPresets(64, 80, 50, 64, 96),
"Stereo Mode"),
rEffPar(Pdepth, 6, rShort("depth"), rPresets(0, 70, 80, 0, 64),
diff --git a/src/Effects/Effect.h b/src/Effects/Effect.h
@@ -24,6 +24,12 @@
#define rEffPar(name, idx, ...) \
{STRINGIFY(name) "::i", rProp(parameter) rDefaultDepends(preset) \
DOC(__VA_ARGS__), NULL, rEffParCb(idx)}
+#define rEffParOpt(name, idx, ...) \
+ {STRINGIFY(name) "::i:c:S", rProp(parameter) rDefaultDepends(preset) \
+ rProp(enumerated) DOC(__VA_ARGS__), NULL, \
+ rBOIL_BEGIN \
+ rCOptionCb_(obj->getpar(idx), obj->changepar(idx, var)) \
+ rBOIL_END }
#define rEffParTF(name, idx, ...) \
{STRINGIFY(name) "::T:F", rProp(parameter) rDefaultDepends(preset) \
DOC(__VA_ARGS__), NULL, rEffParTFCb(idx)}
diff --git a/src/Effects/Phaser.cpp b/src/Effects/Phaser.cpp
@@ -62,7 +62,7 @@ rtosc::Ports Phaser::ports = {
rEffPar(lfo.Prandomness, 3, rShort("rnd."),
rPreset(5, 100), rPreset(7, 5), rPresetsAt(9, 10, 10, 10),
rDefault(0), "LFO randomness"),
- rEffPar(lfo.PLFOtype, 4, rShort("type"),
+ rEffParOpt(lfo.PLFOtype, 4, rShort("type"),
rPreset(4, tri), rPresetsAt(6, tri, tri), rPreset(11, tri),
rDefault(sine),
rOptions(sine, tri), "lfo shape"),
diff --git a/src/Effects/Reverb.cpp b/src/Effects/Reverb.cpp
@@ -60,7 +60,7 @@ rtosc::Ports Reverb::ports = {
rPresets(83, 71, 78, 78, 71, 106, 77, 71, 78, 64, 88, 77, 74)
"Dampening"),
//Todo make this a selector
- rEffPar(Ptype, 10, rShort("type"),
+ rEffParOpt(Ptype, 10, rShort("type"),
rOptions(Random, Freeverb, Bandwidth),
rPresets(Freeverb, Random, Freeverb, Freeverb, Freeverb, Random,
Freeverb, Random, Freeverb, Freeverb, Freeverb, Random,