DPF

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

commit aa6288df7c9ef5108e1ef2cb85548cb6922cba9b
parent 9b69b9da63eeef62c47a170b94b28923aa9420f1
Author: falkTX <falktx@gmail.com>
Date:   Wed,  1 Feb 2017 12:00:58 +0100

Add parameter designation API (unused for now)

Diffstat:
Mdistrho/DistrhoPlugin.hpp | 47+++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+), 0 deletions(-)

diff --git a/distrho/DistrhoPlugin.hpp b/distrho/DistrhoPlugin.hpp @@ -134,6 +134,29 @@ struct AudioPort { }; /** + Parameter designation.@n + Allows a parameter to be specially designated for a task, like bypass. + + Each designation is unique, there must be only one parameter that uses it.@n + The use of designated parameters is completely optional. + + @note Designated parameters have strict ranges. + @see ParameterRanges::adjustForDesignation() + */ +enum ParameterDesignation { + /** + Null or unset designation. + */ + kParameterDesignationNull = 0, + + /** + Bypass designation.@n + When on (> 0.5f), it means the plugin must run in a bypassed state. + */ + kParameterDesignationBypass = 1 +}; + +/** Parameter ranges.@n This is used to set the default, minimum and maximum values of a parameter. @@ -173,6 +196,23 @@ 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 @@ -290,6 +330,11 @@ struct Parameter { ParameterRanges ranges; /** + Designation for this parameter. + */ + ParameterDesignation designation; + + /** MIDI CC to use by default on this parameter.@n A value of 0 or 32 (bank change) is considered invalid.@n Must also be less or equal to 120. @@ -306,6 +351,7 @@ struct Parameter { symbol(), unit(), ranges(), + designation(kParameterDesignationNull), midiCC(0) {} /** @@ -317,6 +363,7 @@ struct Parameter { symbol(s), unit(u), ranges(def, min, max), + designation(kParameterDesignationNull), midiCC(0) {} };