Skip to content

Commit

Permalink
Add Parameter::initDesignation()
Browse files Browse the repository at this point in the history
  • Loading branch information
falkTX committed Feb 10, 2017
1 parent 8c27ddb commit bb29962
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions distrho/DistrhoPlugin.hpp
Expand Up @@ -195,23 +195,6 @@ struct ParameterRanges {
min(mn),
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.
*/
Expand Down Expand Up @@ -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;
}
}
};

/**
Expand Down

0 comments on commit bb29962

Please sign in to comment.