DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit bb29962a512a8911860de2b9b1da468b3f771538
parent 8c27ddb0bb103c8e3e0332db538bbed029a836c8
Author: falkTX <falktx@gmail.com>
Date:   Fri, 10 Feb 2017 15:36:28 +0100

Add Parameter::initDesignation()

Diffstat:
Mdistrho/DistrhoPlugin.hpp | 41++++++++++++++++++++++++-----------------
1 file changed, 24 insertions(+), 17 deletions(-)

diff --git 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; + } + } }; /**