Browse Source

Add Parameter::initDesignation()

pull/20/merge
falkTX 7 years ago
parent
commit
bb29962a51
1 changed files with 24 additions and 17 deletions
  1. +24
    -17
      distrho/DistrhoPlugin.hpp

+ 24
- 17
distrho/DistrhoPlugin.hpp View File

@@ -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.
*/
@@ -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;
}
}
};

/**


Loading…
Cancel
Save