13 #ifndef _PluginParameter_H_ 14 #define _PluginParameter_H_ 55 PluginParameter(
int _controlID,
const char* _controlName,
const char* _controlUnits,
57 taper _controlTaper = taper::kLinearTaper, uint32_t _displayPrecision = 2);
60 PluginParameter(
int _controlID,
const char* _controlName, std::vector<std::string> _stringList, std::string _defaultString);
63 PluginParameter(
int _controlID,
const char* _controlName,
const char* _commaSeparatedList, std::string _defaultString);
66 PluginParameter(
int _controlID,
const char* _controlName,
double _meterAttack_ms,
double _meterRelease_ms,
67 uint32_t _detectorMode,
meterCal _meterCal = meterCal::kLinearMeter);
212 return actualParamValue;
258 case taper::kLinearTaper:
261 case taper::kLogTaper:
264 case taper::kAntiLogTaper:
267 case taper::kVoltOctaveTaper:
288 case taper::kLinearTaper:
291 case taper::kLogTaper:
294 case taper::kAntiLogTaper:
297 case taper::kVoltOctaveTaper:
319 case taper::kLinearTaper:
323 case taper::kLogTaper:
327 case taper::kAntiLogTaper:
331 case taper::kVoltOctaveTaper:
354 if(
controlType == controlVariableType::kTypedEnumStringList)
375 return (
int)std::distance(
stringList.begin(), it);
384 if (normalizedValue <= 0.0)
return 0.0;
385 if (normalizedValue >= 1.0)
return 1.0;
392 if (logNormalizedValue <= 0.0)
return 0.0;
393 if (logNormalizedValue >= 1.0)
return 1.0;
400 if (normalizedValue <= 0.0)
return 0.0;
401 if (normalizedValue >= 1.0)
return 1.0;
403 if (transformed >= 1.0) transformed = 1.0;
410 if (aLogNormalizedValue <= 0.0)
return 0.0;
411 if (aLogNormalizedValue >= 1.0)
return 1.0;
448 double smoothedValue = 0.0;
465 if(dataType == boundVariableType::kDouble)
466 boundVariableDouble = (
double*)boundVariable;
467 else if(dataType == boundVariableType::kFloat)
468 boundVariableFloat = (
float*)boundVariable;
469 else if(dataType == boundVariableType::kInt)
470 boundVariableInt = (
int*)boundVariable;
471 else if(dataType == boundVariableType::kUInt)
472 boundVariableUInt = (uint32_t*)boundVariableUInt;
492 if (boundVariableUInt)
497 else if (boundVariableInt)
502 else if (boundVariableFloat)
507 else if (boundVariableDouble)
522 if (boundVariableUInt)
527 else if (boundVariableInt)
532 else if (boundVariableFloat)
537 else if (boundVariableDouble)
562 if (
this == &aPluginParameter)
662 if (normalizedValue == 0)
665 return minValue*pow(2.0, normalizedValue*octaves);
781 uint32_t* boundVariableUInt =
nullptr;
782 int* boundVariableInt =
nullptr;
783 float* boundVariableFloat =
nullptr;
784 double* boundVariableDouble =
nullptr;
786 typedef std::map<uint32_t, AuxParameterAttribute*> auxParameterAttributeMap;
787 auxParameterAttributeMap auxAttributeMap;
void setAtomicControlValueFloat(float value)
get atomic variable as float
Definition: pluginparameter.h:608
double getNormalizedVoltOctaveDefaultValue()
get volt/octave default value in normalized form
Definition: pluginparameter.h:771
bool getParameterSmoothing()
query parameter smoothing flag
Definition: pluginparameter.h:143
double getControlValue()
the main function to access the underlying atomic double value
Definition: pluginparameter.h:167
bool isMeterParam()
query: meter param?
Definition: pluginparameter.h:115
void setParameterSmoothing(bool value)
set inverted meter flag
Definition: pluginparameter.h:144
void setSmoothedTargetValue(double value)
set atomic TARGET smoothing variable with double
Definition: pluginparameter.h:614
void setControlVariableType(controlVariableType ctrlVarType)
set variable type associated with parameter
Definition: pluginparameter.h:91
uint32_t detectorMode
meter detector mode
Definition: pluginparameter.h:633
double setControlValueNormalized(double normalizedValue, bool applyTaper=true, bool ignoreParameterSmoothing=false)
the main function to set the underlying atomic double value using a normalized value; this is the ope...
Definition: pluginparameter.h:196
double minValue
the min for the parameter
Definition: pluginparameter.h:598
bool isDiscreteSwitch
flag for switches (not currently used in ASPiK)
Definition: pluginparameter.h:628
std::atomic< float > controlValueAtomic
the underlying atomic variable
Definition: pluginparameter.h:605
AuxParameterAttribute * getAuxAttribute(uint32_t attributeID)
get aux data
Definition: pluginparameter.cpp:331
double getVoltOctaveControlValueFromNormValue(double normalizedValue)
get volt/octave control value from a normalized value
Definition: pluginparameter.h:659
double getSmoothingTimeMsec()
query smoothing time
Definition: pluginparameter.h:146
bool protoolsGRMeter
meter is a Pro Tools gain reduction meter
Definition: pluginparameter.h:636
Interface for VST3 parameter value update queue (sample accurate automation)
Definition: pluginstructures.h:1649
bool isLinearTaper()
query: linear taper
Definition: pluginparameter.h:109
void initParamSmoother(T smoothingTimeInMs, T samplingRate, T initValue, T minControlValue, T maxControlValue, smoothingMethod smoother=smoothingMethod::kLPFSmoother)
Definition: guiconstants.h:347
double getMaxValue()
get maximum value
Definition: pluginparameter.h:96
const double kCTCorrFactorAntiLogScale
concave/convex transform scaling factor
Definition: guiconstants.h:177
std::atomic< float > smoothedTargetValueAtomic
the underlying atomic variable TARGET for smoothing
Definition: pluginparameter.h:613
bool smoothParameter(T in, T &out)
Definition: guiconstants.h:371
bool getInvertedMeter()
query inverted meter flag
Definition: pluginparameter.h:137
void setEnableVSTSampleAccurateAutomation(bool value)
set VST3 sample accurate automation
Definition: pluginparameter.h:156
smoothingMethod smoothingType
param smoothing type
Definition: pluginparameter.h:640
double antiLogNormToNorm(double aLogNormalizedValue)
Definition: pluginparameter.h:408
int findStringIndex(std::string searchString)
find a string in the list of a string-list parameter
Definition: pluginparameter.h:365
bool getIsWritable()
query writable control (meter)
Definition: pluginparameter.h:152
void setBoundVariable(void *boundVariable, boundVariableType dataType)
save the variable for binding operation
Definition: pluginparameter.h:461
void setIsDiscreteSwitch(bool _isDiscreteSwitch)
get is switch (not used)
Definition: pluginparameter.h:103
double logNormToNorm(double logNormalizedValue)
Definition: pluginparameter.h:390
std::string controlUnits
the units string for the parameter
Definition: pluginparameter.h:594
double getNormalizedVoltOctaveControlValue()
get get volt/octave control value in normalized form
Definition: pluginparameter.h:690
double getControlValueNormalized(bool applyTaper=true)
get control value as normalied value
Definition: pluginparameter.h:279
uint32_t getControlID()
get ID value
Definition: pluginparameter.h:81
bool appendUnits
flag to append units in GUI controls (use with several built-in custom views)
Definition: pluginparameter.h:626
smoothingMethod
Use this strongly typed enum to easily set the smoothing type.
Definition: guiconstants.h:240
const double kCTCorrFactorZero
concave/convex transform correction factor at x = 0
Definition: guiconstants.h:142
bool isLogTaper()
query: log taper
Definition: pluginparameter.h:110
std::string getControlValueAsString()
the main function to access the underlying atomic double value as a string
Definition: pluginparameter.cpp:227
bool getIsDiscreteSwitch()
set is switch (not used)
Definition: pluginparameter.h:102
uint32_t displayPrecision
sig digits for display
Definition: pluginparameter.h:619
double getGUIMin()
Definition: pluginparameter.h:349
void setSmoothingTimeMsec(double value)
set inverted meter flag
Definition: pluginparameter.h:147
void setMeterAttack_ms(double value)
set meter attack time (ballistics)
Definition: pluginparameter.h:126
PluginParameter()
simple constructor - you can always use this and then use the massive number of get/set functions to ...
Definition: pluginparameter.cpp:169
double normToAntiLogNorm(double normalizedValue)
Definition: pluginparameter.h:398
void setControlID(uint32_t cid)
set ID value
Definition: pluginparameter.h:82
double normToLogNorm(double normalizedValue)
Definition: pluginparameter.h:382
globally utilized structures and enumerations
const double kCTCorrFactorAntiLog
concave/convex transform correction factor
Definition: guiconstants.h:170
boundVariableType boundVariableDataType
bound data type
Definition: pluginparameter.h:645
meterCal
Use this strongly typed enum to easily set meter calibration.
Definition: guiconstants.h:270
bool updateInBoundVariable()
perform the variable binding update (change the value)
Definition: pluginparameter.h:490
uint32_t getDetectorMode()
get meter detect mode
Definition: pluginparameter.h:131
bool isAntiLogTaper()
query: antilog taper
Definition: pluginparameter.h:111
void setDisplayPrecision(uint32_t precision)
set sig digits
Definition: pluginparameter.h:123
double getSmoothedTargetValue() const
set atomic TARGET smoothing variable with double
Definition: pluginparameter.h:615
void setControlTaper(taper ctrlTaper)
set taper
Definition: pluginparameter.h:106
double getNormalizedControlValue()
get control value as normalized value (helper)
Definition: pluginparameter.h:714
bool isDoubleParam()
query: double param?
Definition: pluginparameter.h:118
PluginParameter & operator=(const PluginParameter &aPluginParameter)
Definition: pluginparameter.h:560
void initParamSmoother(double sampleRate)
initialize or reset the parameter smoother object
Definition: pluginparameter.h:420
uint32_t setAuxAttribute(uint32_t attributeID, const AuxParameterAttribute &auxParameterAtribute)
set aux data
Definition: pluginparameter.cpp:314
double getNormalizedDefaultValue()
get default value as a normalized value (helper)
Definition: pluginparameter.h:739
bool isVoltOctaveTaper()
query: volt/octave taper
Definition: pluginparameter.h:112
void setControlUnits(const char *units)
set units as const char*
Definition: pluginparameter.h:88
std::string getStringByIndex(uint32_t index)
get string-list string by index
Definition: pluginparameter.cpp:281
bool enableVSTSampleAccurateAutomation
VST3 sample accurate flag.
Definition: pluginparameter.h:651
double getDefaultValue()
get default value
Definition: pluginparameter.h:99
ParamSmoother< double > paramSmoother
param smoothing object
Definition: pluginparameter.h:642
void setCommaSeparatedStringList()
convert the string-list into a comma-separated list (during construction)
Definition: pluginparameter.cpp:293
controlVariableType
Use this strongly typed enum to easily set the control's behavior; this tells the PluginParameter obj...
Definition: guiconstants.h:288
double getMinValue()
get minimum value
Definition: pluginparameter.h:93
double getNormalizedAntiLogDefaultValue()
get anti-log default value in normalized form
Definition: pluginparameter.h:761
boundVariableType getBoundVariableType()
get the datatype of the bound variable
Definition: pluginparameter.h:483
bool isProtoolsGRMeter()
query pro tools GR meter flag
Definition: pluginparameter.h:140
double getControlValueWithNormalizedValue(double normalizedValue, bool applyTaper=true)
get the new control value as if it were set with a normalized value
Definition: pluginparameter.h:309
bool logMeter
meter is log
Definition: pluginparameter.h:634
bool updateOutBoundVariable()
perform the variable binding update on meter data
Definition: pluginparameter.h:520
std::vector< std::string > stringList
string list
Definition: pluginparameter.h:622
double meterAttack_ms
meter attack time in milliseconds
Definition: pluginparameter.h:631
smoothingMethod getSmoothingMethod()
query smoothing method
Definition: pluginparameter.h:149
void setInvertedMeter(bool value)
set inverted meter flag
Definition: pluginparameter.h:138
bool useParameterSmoothing
enable param smoothing
Definition: pluginparameter.h:639
double getMeterRelease_ms()
get meter release time (ballistics)
Definition: pluginparameter.h:128
IParameterUpdateQueue * getParameterUpdateQueue()
retrieves the update queue for VST3 sample accuate automation; note this is only used during actual D...
Definition: pluginparameter.h:557
double getControlValueFromNormalizedValue(double normalizedValue)
get control value with a normalized value (helper)
Definition: pluginparameter.h:727
bool isFloatParam()
query: float param?
Definition: pluginparameter.h:117
const double kCTCoefficient
concave and/or convex transform correction factor
Definition: guiconstants.h:135
const char * getControlName()
get name as const char*
Definition: pluginparameter.h:84
bool isNonVariableBoundParam()
query: non-bound param?
Definition: pluginparameter.h:120
size_t getStringCount()
get the number of individual strings in a string-list control
Definition: pluginparameter.h:227
std::string commaSeparatedStringList
string list a somma separated string
Definition: pluginparameter.h:623
void setControlValue(double actualParamValue, bool ignoreSmoothing=false)
the main function to set the underlying atomic double value
Definition: pluginparameter.h:175
bool invertedMeter
meter is inverted
Definition: pluginparameter.h:635
double getGUIMax()
Definition: pluginparameter.h:352
taper getControlTaper()
get taper
Definition: pluginparameter.h:105
void setParameterUpdateQueue(IParameterUpdateQueue *_parameterUpdateQueue)
stores the update queue for VST3 sample accuate automation; note this is only used during actual DAW ...
Definition: pluginparameter.h:550
double getDefaultValueNormalized()
get default value as normalied value
Definition: pluginparameter.h:253
void updateSampleRate(double sampleRate)
change any sample-rate dependent members
Definition: pluginparameter.h:435
bool isIntParam()
query: int param?
Definition: pluginparameter.h:119
globally utilized constants and enumerations
boundVariableType
Use this strongly typed enum to easily set the control's linked variable datatype (for automatic vari...
Definition: guiconstants.h:304
controlVariableType getControlVariableType()
get variable type associated with parameter
Definition: pluginparameter.h:90
void setIsProtoolsGRMeter(bool value)
set inverted meter flag
Definition: pluginparameter.h:141
double maxValue
the max for the parameter
Definition: pluginparameter.h:599
void setDefaultValue(double value)
set default value
Definition: pluginparameter.h:100
double getAtomicControlValueDouble() const
set atomic variable with double
Definition: pluginparameter.h:610
void setAtomicControlValueDouble(double value)
get atomic variable as double
Definition: pluginparameter.h:611
Information about auxilliary parameter details - purely customizeable. This uses the attributeValue u...
Definition: pluginstructures.h:922
void setStringList(std::vector< std::string > _stringList)
set the string-list using a vector of strings
Definition: pluginparameter.h:244
virtual ~PluginParameter()
only need to clean out the aux parameters - everything else is self deleting
Definition: pluginparameter.cpp:211
void setSmoothingMethod(smoothingMethod smoothingMethod)
set smoothing method
Definition: pluginparameter.h:150
controlVariableType controlType
the control type
Definition: pluginparameter.h:595
const double kCTCorrFactorAnitZero
inverse concave/convex transform factor at x = 0
Definition: guiconstants.h:149
bool smoothParameterValue()
perform smoothing operation on data
Definition: pluginparameter.h:445
void setMinValue(double value)
set minimum value
Definition: pluginparameter.h:94
The PluginParameter object stores all of the data needed for any type of plugin parameter. It is a large object, but it is not complex as it really just stores LOTS of information about plugin parameters.
Definition: pluginparameter.h:51
int controlID
the ID value for the parameter
Definition: pluginparameter.h:592
void setMaxValue(double value)
set maximum value
Definition: pluginparameter.h:97
const double kCTCorrFactorAntiUnity
inverse concave/convex transform correction factor at x = 1
Definition: guiconstants.h:163
double getNormalizedControlValueWithActual(double actualValue)
convert actual control value into normalized value (helper)
Definition: pluginparameter.h:704
const char * getControlUnits()
get units as const char*
Definition: pluginparameter.h:87
float getAtomicControlValueFloat() const
set atomic variable with float
Definition: pluginparameter.h:607
std::string controlName
the name string for the parameter
Definition: pluginparameter.h:593
const char * getCommaSeparatedStringList()
get the strings in a string-list control as a comma separated list
Definition: pluginparameter.h:234
IParameterUpdateQueue * parameterUpdateQueue
interface for VST3 sample accurate updates
Definition: pluginparameter.h:648
bool isStringListParam()
query: string list para,?
Definition: pluginparameter.h:116
double getNormalizedControlValueWithActualValue(double actualValue)
get the new normalized control value as if it were set with an actual value
Definition: pluginparameter.h:346
double getNormalizedLogDefaultValue()
get log default value in normalized form
Definition: pluginparameter.h:751
double getNormalizedAntiLogControlValue()
get get anti-log control value in normalized form
Definition: pluginparameter.h:681
void setControlName(const char *name)
set name as const char*
Definition: pluginparameter.h:85
void setLogMeter(bool value)
set log meter flag
Definition: pluginparameter.h:135
double getMeterAttack_ms()
get meter attack time (ballistics)
Definition: pluginparameter.h:125
bool getLogMeter()
query log meter flag
Definition: pluginparameter.h:134
void setSampleRate(T samplingRate)
Definition: guiconstants.h:327
double getNormalizedLogControlValue()
get get log control value in normalized form
Definition: pluginparameter.h:672
const uint32_t ENVELOPE_DETECT_MODE_RMS
SQRT((1/N)|x|^2)
Definition: guiconstants.h:201
bool getEnableVSTSampleAccurateAutomation()
query VST3 sample accurate automation
Definition: pluginparameter.h:155
void setMeterRelease_ms(double value)
set meter release time (ballistics)
Definition: pluginparameter.h:129
double smoothingTimeMsec
param smoothing time
Definition: pluginparameter.h:641
void setIsWritable(bool value)
set writable control (meter)
Definition: pluginparameter.h:153
bool isWritable
flag for meter variables
Definition: pluginparameter.h:627
uint32_t getDisplayPrecision()
get sig digits
Definition: pluginparameter.h:122
void setMeterDetectorMode(uint32_t value)
set meter detect mode
Definition: pluginparameter.h:132
taper controlTaper
the taper
Definition: pluginparameter.h:618
const double kCTCorrFactorUnity
concave/convex transform correction factor at x = 1
Definition: guiconstants.h:156
double defaultValue
the default value for the parameter
Definition: pluginparameter.h:600
double meterRelease_ms
meter release time in milliseconds
Definition: pluginparameter.h:632
taper
Use this strongly typed enum to easily set the control taper.
Definition: guiconstants.h:255