summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfalkTX <falktx@gmail.com>2017-02-10 15:36:55 +0100
committerfalkTX <falktx@gmail.com>2017-02-10 15:36:55 +0100
commitbb29962a512a8911860de2b9b1da468b3f771538 (patch)
treeca0153d42cee37c132eafc68cbf0d1b9b734908e
parent8c27ddb0bb103c8e3e0332db538bbed029a836c8 (diff)
Add Parameter::initDesignation()
-rw-r--r--distrho/DistrhoPlugin.hpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/distrho/DistrhoPlugin.hpp b/distrho/DistrhoPlugin.hpp
index c026f3bf..fcb40dd5 100644
--- a/distrho/DistrhoPlugin.hpp
+++ b/distrho/DistrhoPlugin.hpp
@@ -196,23 +196,6 @@ struct ParameterRanges {
max(mx) {}
/**
- Adjust ranges for a specific parameter designation.
- */
- void adjustForDesignation(ParameterDesignation d) noexcept
- {
- switch (d)
- {
- case kParameterDesignationNull:
- break;
- case kParameterDesignationBypass:
- def = 0.0f;
- min = 0.0f;
- max = 1.0f;
- break;
- }
- }
-
- /**
Fix the default value within range.
*/
void fixDefault() noexcept
@@ -365,6 +348,30 @@ struct Parameter {
ranges(def, min, max),
designation(kParameterDesignationNull),
midiCC(0) {}
+
+ /**
+ Initialize a parameter for a specific designation.
+ */
+ void initDesignation(ParameterDesignation d) noexcept
+ {
+ designation = d;
+
+ switch (d)
+ {
+ case kParameterDesignationNull:
+ break;
+ case kParameterDesignationBypass:
+ hints = kParameterIsAutomable|kParameterIsBoolean|kParameterIsInteger;
+ name = "Bypass";
+ symbol = "dpf_bypass";
+ unit = "";
+ midiCC = 0;
+ ranges.def = 0.0f;
+ ranges.min = 0.0f;
+ ranges.max = 1.0f;
+ break;
+ }
+ }
};
/**