ASPiK SDK
Loading...
Searching...
No Matches
pluginparameter.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2// ASPiK Plugin Kernel File: pluginparameter.h
3//
12// -----------------------------------------------------------------------------
13#ifndef _PluginParameter_H_
14#define _PluginParameter_H_
15
16#include <string>
17#include <vector>
18#include <sstream>
19#include <atomic>
20#include <map>
21#include <iomanip>
22#include <iostream>
23
24#include <math.h>
25#include "pluginstructures.h"
26#include "guiconstants.h"
27
28
52{
53public:
55 PluginParameter(int _controlID, const char* _controlName, const char* _controlUnits,
56 controlVariableType _controlType, double _minValue, double _maxValue, double _defaultValue,
57 taper _controlTaper = taper::kLinearTaper, uint32_t _displayPrecision = 2);
58
60 PluginParameter(int _controlID, const char* _controlName, std::vector<std::string> _stringList, std::string _defaultString);
61
63 PluginParameter(int _controlID, const char* _controlName, const char* _commaSeparatedList, std::string _defaultString);
64
66 PluginParameter(int _controlID, const char* _controlName, double _meterAttack_ms, double _meterRelease_ms,
67 uint32_t _detectorMode, meterCal _meterCal = meterCal::kLinearMeter);
68
70 PluginParameter(int _controlID, const char* _controlName = "", controlVariableType _controlType = controlVariableType::kNonVariableBoundControl);
71
74
76 PluginParameter(const PluginParameter& initGuiControl);
77
79 virtual ~PluginParameter();
80
81 uint32_t getControlID() { return controlID; }
82 void setControlID(uint32_t cid) { controlID = cid; }
83
84 const char* getControlName() { return controlName.c_str(); }
85 void setControlName(const char* name) { controlName.assign(name); }
86
87 const char* getControlUnits() { return controlUnits.c_str(); }
88 void setControlUnits(const char* units) { controlUnits.assign(units); }
89
91 void setControlVariableType(controlVariableType ctrlVarType) { controlType = ctrlVarType; }
92
93 double getMinValue() { return minValue; }
94 void setMinValue(double value) { minValue = value; }
95
96 double getMaxValue() { return maxValue; }
97 void setMaxValue(double value) { maxValue = value; }
98
99 double getDefaultValue() { return defaultValue; }
100 void setDefaultValue(double value) { defaultValue = value; }
101
103 void setIsDiscreteSwitch(bool _isDiscreteSwitch) { isDiscreteSwitch = _isDiscreteSwitch; }
104
106 void setControlTaper(taper ctrlTaper) { controlTaper = ctrlTaper; }
107
108 // -- taper getters
109 bool isLinearTaper() { return controlTaper == taper::kLinearTaper ? true : false; }
110 bool isLogTaper() { return controlTaper == taper::kLogTaper ? true : false; }
111 bool isAntiLogTaper() { return controlTaper == taper::kAntiLogTaper ? true : false; }
112 bool isVoltOctaveTaper() { return controlTaper == taper::kVoltOctaveTaper ? true : false; }
113
114 // --- control type getters
115 bool isMeterParam() { return controlType == controlVariableType::kMeter ? true : false; }
116 bool isStringListParam() { return controlType == controlVariableType::kTypedEnumStringList ? true : false; }
117 bool isFloatParam() { return controlType == controlVariableType::kFloat ? true : false; }
118 bool isDoubleParam() { return controlType == controlVariableType::kDouble ? true : false; }
119 bool isIntParam() { return controlType == controlVariableType::kInt ? true : false; }
120 bool isNonVariableBoundParam() { return controlType == controlVariableType::kNonVariableBoundControl ? true : false; }
121
122 uint32_t getDisplayPrecision() { return displayPrecision; }
123 void setDisplayPrecision(uint32_t precision) { displayPrecision = precision; }
124
126 void setMeterAttack_ms(double value) { meterAttack_ms = value; }
127
129 void setMeterRelease_ms(double value) { meterRelease_ms = value; }
130
131 uint32_t getDetectorMode() { return detectorMode; }
132 void setMeterDetectorMode(uint32_t value) { detectorMode = value; }
133
134 bool getLogMeter() { return logMeter; }
135 void setLogMeter(bool value) { logMeter = value; }
136
137 bool getInvertedMeter() { return invertedMeter; }
138 void setInvertedMeter(bool value) { invertedMeter = value; }
139
141 void setIsProtoolsGRMeter(bool value) { protoolsGRMeter = value; }
142
144 void setParameterSmoothing(bool value) { useParameterSmoothing = value; }
145
147 void setSmoothingTimeMsec(double value) { smoothingTimeMsec = value; }
148
151
152 bool getIsWritable() { return isWritable; }
153 void setIsWritable(bool value) { isWritable = value; }
154
157
158 // --- for aux attributes
159 AuxParameterAttribute* getAuxAttribute(uint32_t attributeID);
160 uint32_t setAuxAttribute(uint32_t attributeID, const AuxParameterAttribute& auxParameterAtribute);
161
167 inline double getControlValue() { return getAtomicControlValueDouble(); }
168
175 inline void setControlValue(double actualParamValue, bool ignoreSmoothing = false)
176 {
177 if (controlType == controlVariableType::kDouble ||
178 controlType == controlVariableType::kFloat)
179 {
180 if (useParameterSmoothing && !ignoreSmoothing)
181 setSmoothedTargetValue(actualParamValue);
182 else
183 setAtomicControlValueDouble(actualParamValue);
184 }
185 else
186 setAtomicControlValueDouble(actualParamValue);
187 }
188
196 inline double setControlValueNormalized(double normalizedValue, bool applyTaper = true, bool ignoreParameterSmoothing = false)
197 {
198 // --- set according to smoothing option
199 double actualParamValue = getControlValueWithNormalizedValue(normalizedValue, applyTaper);
200
201 if (controlType == controlVariableType::kDouble ||
202 controlType == controlVariableType::kFloat)
203 {
204 if (useParameterSmoothing && !ignoreParameterSmoothing)
205 setSmoothedTargetValue(actualParamValue);
206 else
207 setAtomicControlValueDouble(actualParamValue);
208 }
209 else
210 setAtomicControlValueDouble(actualParamValue);
211
212 return actualParamValue;
213 }
214
220 std::string getControlValueAsString();
221
227 size_t getStringCount(){return stringList.size();}
228
235
240
244 void setStringList(std::vector<std::string> _stringList) {stringList = _stringList;}
245
247 std::string getStringByIndex(uint32_t index);
248
254 {
255 // --- apply taper as needed
256 switch (controlTaper)
257 {
258 case taper::kLinearTaper:
260
261 case taper::kLogTaper:
263
264 case taper::kAntiLogTaper:
266
267 case taper::kVoltOctaveTaper:
269
270 default:
271 return 0.0;
272 }
273 }
274
279 inline double getControlValueNormalized(bool applyTaper = true)
280 {
281 // --- for edit controls specifically
282 if(!applyTaper)
284
285 // --- apply taper as needed
286 switch (controlTaper)
287 {
288 case taper::kLinearTaper:
290
291 case taper::kLogTaper:
293
294 case taper::kAntiLogTaper:
296
297 case taper::kVoltOctaveTaper:
299
300 default:
301 return 0.0;
302 }
303 }
304
309 inline double getControlValueWithNormalizedValue(double normalizedValue, bool applyTaper = true)
310 {
311 if(!applyTaper)
312 return getControlValueFromNormalizedValue(normalizedValue);
313
314 double newValue = 0;
315
316 // --- apply taper as needed
317 switch (controlTaper)
318 {
319 case taper::kLinearTaper:
320 newValue = getControlValueFromNormalizedValue(normalizedValue);
321 break;
322
323 case taper::kLogTaper:
324 newValue = getControlValueFromNormalizedValue(normToLogNorm(normalizedValue));
325 break;
326
327 case taper::kAntiLogTaper:
328 newValue = getControlValueFromNormalizedValue(normToAntiLogNorm(normalizedValue));
329 break;
330
331 case taper::kVoltOctaveTaper:
332 newValue = getVoltOctaveControlValueFromNormValue(normalizedValue);
333 break;
334
335 default:
336 break; // --- no update
337 }
338
339 return newValue;
340 }
341
346 inline double getNormalizedControlValueWithActualValue(double actualValue) { return getNormalizedControlValueWithActual(actualValue); }
347
349 double getGUIMin() { return 0.0; }
350
352 double getGUIMax()
353 {
354 if(controlType == controlVariableType::kTypedEnumStringList)
355 return (double)getStringCount() - 1;
356
357 return 1.0;
358 }
359
365 int findStringIndex(std::string searchString)
366 {
367 auto it = std::find(stringList.begin (), stringList.end (), searchString);
368
369 if (it == stringList.end())
370 {
371 return -1;
372 }
373 else
374 {
375 return (int)std::distance(stringList.begin(), it);
376 }
377
378 return -1;
379 }
380
382 inline double normToLogNorm(double normalizedValue)
383 {
384 if (normalizedValue <= 0.0) return 0.0;
385 if (normalizedValue >= 1.0) return 1.0;
386 return kCTCorrFactorUnity*(1.0 + kCTCoefficient*log10(normalizedValue + kCTCorrFactorZero));
387 }
388
390 inline double logNormToNorm(double logNormalizedValue)
391 {
392 if (logNormalizedValue <= 0.0) return 0.0;
393 if (logNormalizedValue >= 1.0) return 1.0;
394 return kCTCorrFactorAnitZero * (pow(10.0, (logNormalizedValue - 1.0) / kCTCoefficient) - kCTCorrFactorZero);
395 }
396
398 inline double normToAntiLogNorm(double normalizedValue)
399 {
400 if (normalizedValue <= 0.0) return 0.0;
401 if (normalizedValue >= 1.0) return 1.0;
402 double transformed = -kCTCoefficient*kCTCorrFactorAntiLogScale*log10(1.0 - normalizedValue + kCTCorrFactorZero) + kCTCorrFactorAntiLog;
403 if (transformed >= 1.0) transformed = 1.0;
404 return transformed;
405 }
406
408 inline double antiLogNormToNorm(double aLogNormalizedValue)
409 {
410 if (aLogNormalizedValue <= 0.0) return 0.0;
411 if (aLogNormalizedValue >= 1.0) return 1.0;
412 return (kCTCorrFactorAntiUnity)*(-pow(10.0, (-aLogNormalizedValue / kCTCoefficient)) + 1.0);
413 }
414
420 void initParamSmoother(double sampleRate)
421 {
423 sampleRate,
425 minValue,
426 maxValue,
428 }
429
435 void updateSampleRate(double sampleRate)
436 {
437 paramSmoother.setSampleRate(sampleRate);
438 }
439
446 {
447 if(!useParameterSmoothing) return false;
448 double smoothedValue = 0.0;
449 bool smoothed = paramSmoother.smoothParameter(getSmoothedTargetValue(), smoothedValue);
450 if(smoothed)
451 setAtomicControlValueDouble(smoothedValue);
452 return smoothed;
453 }
454
461 void setBoundVariable(void* boundVariable, boundVariableType dataType)
462 {
463 boundVariableDataType = dataType;
464
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;
473
474 // --- initialize it
476 }
477
484
491 {
492 if (boundVariableUInt)
493 {
494 *boundVariableUInt = (uint32_t)getControlValue();
495 return true;
496 }
497 else if (boundVariableInt)
498 {
499 *boundVariableInt = (int)getControlValue();
500 return true;
501 }
502 else if (boundVariableFloat)
503 {
504 *boundVariableFloat = (float)getControlValue();
505 return true;
506 }
507 else if (boundVariableDouble)
508 {
509 *boundVariableDouble = getControlValue();
510 return true;
511 }
512 return false;
513 }
514
521 {
522 if (boundVariableUInt)
523 {
524 setControlValue((double)*boundVariableUInt);
525 return true;
526 }
527 else if (boundVariableInt)
528 {
529 setControlValue((double)*boundVariableInt);
530 return true;
531 }
532 else if (boundVariableFloat)
533 {
534 setControlValue((double)*boundVariableFloat);
535 return true;
536 }
537 else if (boundVariableDouble)
538 {
539 setControlValue(*boundVariableDouble);
540 return true;
541 }
542 return false;
543 }
544
550 void setParameterUpdateQueue(IParameterUpdateQueue* _parameterUpdateQueue) { parameterUpdateQueue = _parameterUpdateQueue; }
551
557 IParameterUpdateQueue* getParameterUpdateQueue() { return parameterUpdateQueue; } // may be NULL - that is OK
558
560 PluginParameter& operator=(const PluginParameter& aPluginParameter) // need this override for collections to work
561 {
562 if (this == &aPluginParameter)
563 return *this;
564
565 controlID = aPluginParameter.controlID;
566 controlName = aPluginParameter.controlName;
567 controlUnits = aPluginParameter.controlUnits;
569 controlType = aPluginParameter.controlType;
570 minValue = aPluginParameter.minValue;
571 maxValue = aPluginParameter.maxValue;
572 defaultValue = aPluginParameter.defaultValue;
573 controlTaper = aPluginParameter.controlTaper;
575 displayPrecision = aPluginParameter.displayPrecision;
576 stringList = aPluginParameter.stringList;
578 smoothingType = aPluginParameter.smoothingType;
579 smoothingTimeMsec = aPluginParameter.smoothingTimeMsec;
580 meterAttack_ms = aPluginParameter.meterAttack_ms;
581 meterRelease_ms = aPluginParameter.meterRelease_ms;
582 detectorMode = aPluginParameter.detectorMode;
583 logMeter = aPluginParameter.logMeter;
584 isWritable = aPluginParameter.isWritable;
585 isDiscreteSwitch = aPluginParameter.isDiscreteSwitch;
586 invertedMeter = aPluginParameter.invertedMeter;
587
588 return *this;
589 }
590
591protected:
592 int controlID = -1;
593 std::string controlName = "ControlName";
594 std::string controlUnits = "Units";
595 controlVariableType controlType = controlVariableType::kDouble;
596
597 // --- min/max/def
598 double minValue = 0.0;
599 double maxValue = 1.0;
600 double defaultValue = 0.0;
601
602 // --- *the* control value
603 // --- atomic float as control value
604 // atomic double will not behave properly between 32/64 bit
605 std::atomic<float> controlValueAtomic;
606
607 float getAtomicControlValueFloat() const { return controlValueAtomic.load(std::memory_order_relaxed); }
608 void setAtomicControlValueFloat(float value) { controlValueAtomic.store(value, std::memory_order_relaxed); }
609
610 double getAtomicControlValueDouble() const { return (double)controlValueAtomic.load(std::memory_order_relaxed); }
611 void setAtomicControlValueDouble(double value) { controlValueAtomic.store((float)value, std::memory_order_relaxed); }
612
613 std::atomic<float> smoothedTargetValueAtomic;
614 void setSmoothedTargetValue(double value){ smoothedTargetValueAtomic.store((float)value); }
615 double getSmoothedTargetValue() const { return (double)smoothedTargetValueAtomic.load(); }
616
617 // --- control tweakers
618 taper controlTaper = taper::kLinearTaper;
619 uint32_t displayPrecision = 2;
620
621 // --- for enumerated string list
622 std::vector<std::string> stringList;
624
625 // --- gui specific
626 bool appendUnits = true;
627 bool isWritable = false;
628 bool isDiscreteSwitch = false;
629
630 // --- for VU meters
631 double meterAttack_ms = 10.0;
632 double meterRelease_ms = 500.0;
634 bool logMeter = false;
635 bool invertedMeter = false;
636 bool protoolsGRMeter = false;
637
638 // --- parameter smoothing
640 smoothingMethod smoothingType = smoothingMethod::kLPFSmoother;
641 double smoothingTimeMsec = 100.0;
643
644 // --- variable binding
645 boundVariableType boundVariableDataType = boundVariableType::kFloat;
646
647 // --- our sample accurate interface for VST3
649
650 // --- default is enabled; you can disable this for controls that have a long postUpdate cooking time
652
659 inline double getVoltOctaveControlValueFromNormValue(double normalizedValue)
660 {
661 double octaves = log2(maxValue / minValue);
662 if (normalizedValue == 0)
663 return minValue;
664
665 return minValue*pow(2.0, normalizedValue*octaves);
666 }
667
673 {
675 }
676
682 {
684 }
685
691 {
692 if (minValue == 0)
694
695 return log2(getAtomicControlValueDouble() / minValue) / (log2(maxValue / minValue));
696 }
697
704 inline double getNormalizedControlValueWithActual(double actualValue)
705 {
706 // --- calculate normalized value from actual
707 return (actualValue - minValue) / (maxValue - minValue);
708 }
709
715 {
716 // --- calculate normalized value from actual
717 //double d = (getAtomicControlValueDouble() - minValue) / (maxValue - minValue);
719 }
720
727 inline double getControlValueFromNormalizedValue(double normalizedValue)
728 {
729 // --- calculate the control Value using normalized input
730 //double d = (maxValue - minValue)*normalizedValue + minValue;
731 return (maxValue - minValue)*normalizedValue + minValue;
732 }
733
740 {
741 // --- calculate normalized value from actual
742 //double d = (defaultValue - minValue) / (maxValue - minValue);
743 return (defaultValue - minValue) / (maxValue - minValue);
744 }
745
752 {
754 }
755
762 {
764 }
765
772 {
773 if (minValue == 0)
774 return defaultValue;
775
776 return log2(defaultValue / minValue) / (log2(maxValue / minValue));
777 }
778
779private:
780 // --- for variable-binding support
781 uint32_t* boundVariableUInt = nullptr;
782 int* boundVariableInt = nullptr;
783 float* boundVariableFloat = nullptr;
784 double* boundVariableDouble = nullptr;
785
786 typedef std::map<uint32_t, AuxParameterAttribute*> auxParameterAttributeMap;
787 auxParameterAttributeMap auxAttributeMap;
788
789};
790
791#endif
792
Interface for VST3 parameter value update queue (sample accurate automation)
Definition: pluginstructures.h:1650
The ParamSmoother object performs parameter smoothing on GUI control information. You can choose line...
Definition: guiconstants.h:320
bool smoothParameter(T in, T &out)
Definition: guiconstants.h:371
void setSampleRate(T samplingRate)
Definition: guiconstants.h:327
void initParamSmoother(T smoothingTimeInMs, T samplingRate, T initValue, T minControlValue, T maxControlValue, smoothingMethod smoother=smoothingMethod::kLPFSmoother)
Definition: guiconstants.h:347
The PluginParameter object stores all of the data needed for any type of plugin parameter....
Definition: pluginparameter.h:52
void setAtomicControlValueDouble(double value)
get atomic variable as double
Definition: pluginparameter.h:611
std::vector< std::string > stringList
string list
Definition: pluginparameter.h:622
float getAtomicControlValueFloat() const
set atomic variable with float
Definition: pluginparameter.h:607
bool getInvertedMeter()
query inverted meter flag
Definition: pluginparameter.h:137
double getNormalizedControlValue()
get control value as normalized value (helper)
Definition: pluginparameter.h:714
bool getEnableVSTSampleAccurateAutomation()
query VST3 sample accurate automation
Definition: pluginparameter.h:155
controlVariableType getControlVariableType()
get variable type associated with parameter
Definition: pluginparameter.h:90
double getNormalizedAntiLogDefaultValue()
get anti-log default value in normalized form
Definition: pluginparameter.h:761
bool isFloatParam()
query: float param?
Definition: pluginparameter.h:117
bool logMeter
meter is log
Definition: pluginparameter.h:634
bool invertedMeter
meter is inverted
Definition: pluginparameter.h:635
const char * getCommaSeparatedStringList()
get the strings in a string-list control as a comma separated list
Definition: pluginparameter.h:234
boundVariableType boundVariableDataType
bound data type
Definition: pluginparameter.h:645
double getControlValue()
the main function to access the underlying atomic double value
Definition: pluginparameter.h:167
void setControlName(const char *name)
set name as const char*
Definition: pluginparameter.h:85
double getNormalizedVoltOctaveControlValue()
get get volt/octave control value in normalized form
Definition: pluginparameter.h:690
void setIsDiscreteSwitch(bool _isDiscreteSwitch)
get is switch (not used)
Definition: pluginparameter.h:103
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
void setStringList(std::vector< std::string > _stringList)
set the string-list using a vector of strings
Definition: pluginparameter.h:244
bool getParameterSmoothing()
query parameter smoothing flag
Definition: pluginparameter.h:143
uint32_t displayPrecision
sig digits for display
Definition: pluginparameter.h:619
double getNormalizedDefaultValue()
get default value as a normalized value (helper)
Definition: pluginparameter.h:739
const char * getControlUnits()
get units as const char*
Definition: pluginparameter.h:87
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
bool protoolsGRMeter
meter is a Pro Tools gain reduction meter
Definition: pluginparameter.h:636
bool isNonVariableBoundParam()
query: non-bound param?
Definition: pluginparameter.h:120
double getNormalizedControlValueWithActual(double actualValue)
convert actual control value into normalized value (helper)
Definition: pluginparameter.h:704
bool isLogTaper()
query: log taper
Definition: pluginparameter.h:110
double getGUIMin()
Definition: pluginparameter.h:349
virtual ~PluginParameter()
only need to clean out the aux parameters - everything else is self deleting
Definition: pluginparameter.cpp:211
double getAtomicControlValueDouble() const
set atomic variable with double
Definition: pluginparameter.h:610
bool enableVSTSampleAccurateAutomation
VST3 sample accurate flag.
Definition: pluginparameter.h:651
controlVariableType controlType
the control type
Definition: pluginparameter.h:595
double getControlValueFromNormalizedValue(double normalizedValue)
get control value with a normalized value (helper)
Definition: pluginparameter.h:727
double getMeterAttack_ms()
get meter attack time (ballistics)
Definition: pluginparameter.h:125
double getMinValue()
get minimum value
Definition: pluginparameter.h:93
double getNormalizedLogControlValue()
get get log control value in normalized form
Definition: pluginparameter.h:672
void setControlValue(double actualParamValue, bool ignoreSmoothing=false)
the main function to set the underlying atomic double value
Definition: pluginparameter.h:175
bool isStringListParam()
query: string list para,?
Definition: pluginparameter.h:116
IParameterUpdateQueue * getParameterUpdateQueue()
retrieves the update queue for VST3 sample accuate automation; note this is only used during actual D...
Definition: pluginparameter.h:557
bool isMeterParam()
query: meter param?
Definition: pluginparameter.h:115
void setControlTaper(taper ctrlTaper)
set taper
Definition: pluginparameter.h:106
double normToLogNorm(double normalizedValue)
Definition: pluginparameter.h:382
void setSmoothingMethod(smoothingMethod smoothingMethod)
set smoothing method
Definition: pluginparameter.h:150
bool smoothParameterValue()
perform smoothing operation on data
Definition: pluginparameter.h:445
double getNormalizedAntiLogControlValue()
get get anti-log control value in normalized form
Definition: pluginparameter.h:681
bool isLinearTaper()
query: linear taper
Definition: pluginparameter.h:109
PluginParameter & operator=(const PluginParameter &aPluginParameter)
Definition: pluginparameter.h:560
bool updateOutBoundVariable()
perform the variable binding update on meter data
Definition: pluginparameter.h:520
void setMinValue(double value)
set minimum value
Definition: pluginparameter.h:94
double meterAttack_ms
meter attack time in milliseconds
Definition: pluginparameter.h:631
uint32_t getDisplayPrecision()
get sig digits
Definition: pluginparameter.h:122
bool isIntParam()
query: int param?
Definition: pluginparameter.h:119
ParamSmoother< double > paramSmoother
param smoothing object
Definition: pluginparameter.h:642
boundVariableType getBoundVariableType()
get the datatype of the bound variable
Definition: pluginparameter.h:483
std::atomic< float > controlValueAtomic
the underlying atomic variable
Definition: pluginparameter.h:605
double getControlValueNormalized(bool applyTaper=true)
get control value as normalied value
Definition: pluginparameter.h:279
int findStringIndex(std::string searchString)
find a string in the list of a string-list parameter
Definition: pluginparameter.h:365
double getSmoothingTimeMsec()
query smoothing time
Definition: pluginparameter.h:146
uint32_t setAuxAttribute(uint32_t attributeID, const AuxParameterAttribute &auxParameterAtribute)
set aux data
Definition: pluginparameter.cpp:314
double smoothingTimeMsec
param smoothing time
Definition: pluginparameter.h:641
const char * getControlName()
get name as const char*
Definition: pluginparameter.h:84
void setIsProtoolsGRMeter(bool value)
set inverted meter flag
Definition: pluginparameter.h:141
void setBoundVariable(void *boundVariable, boundVariableType dataType)
save the variable for binding operation
Definition: pluginparameter.h:461
void setAtomicControlValueFloat(float value)
get atomic variable as float
Definition: pluginparameter.h:608
double maxValue
the max for the parameter
Definition: pluginparameter.h:599
void setIsWritable(bool value)
set writable control (meter)
Definition: pluginparameter.h:153
IParameterUpdateQueue * parameterUpdateQueue
interface for VST3 sample accurate updates
Definition: pluginparameter.h:648
taper getControlTaper()
get taper
Definition: pluginparameter.h:105
AuxParameterAttribute * getAuxAttribute(uint32_t attributeID)
get aux data
Definition: pluginparameter.cpp:331
std::string controlUnits
the units string for the parameter
Definition: pluginparameter.h:594
double getDefaultValueNormalized()
get default value as normalied value
Definition: pluginparameter.h:253
PluginParameter()
simple constructor - you can always use this and then use the massive number of get/set functions to ...
Definition: pluginparameter.cpp:169
double getVoltOctaveControlValueFromNormValue(double normalizedValue)
get volt/octave control value from a normalized value
Definition: pluginparameter.h:659
bool updateInBoundVariable()
perform the variable binding update (change the value)
Definition: pluginparameter.h:490
void setEnableVSTSampleAccurateAutomation(bool value)
set VST3 sample accurate automation
Definition: pluginparameter.h:156
bool isDiscreteSwitch
flag for switches (not currently used in ASPiK)
Definition: pluginparameter.h:628
void setSmoothedTargetValue(double value)
set atomic TARGET smoothing variable with double
Definition: pluginparameter.h:614
void setParameterSmoothing(bool value)
set inverted meter flag
Definition: pluginparameter.h:144
double getSmoothedTargetValue() const
set atomic TARGET smoothing variable with double
Definition: pluginparameter.h:615
size_t getStringCount()
get the number of individual strings in a string-list control
Definition: pluginparameter.h:227
taper controlTaper
the taper
Definition: pluginparameter.h:618
void updateSampleRate(double sampleRate)
change any sample-rate dependent members
Definition: pluginparameter.h:435
double getNormalizedVoltOctaveDefaultValue()
get volt/octave default value in normalized form
Definition: pluginparameter.h:771
std::atomic< float > smoothedTargetValueAtomic
the underlying atomic variable TARGET for smoothing
Definition: pluginparameter.h:613
void setControlUnits(const char *units)
set units as const char*
Definition: pluginparameter.h:88
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 getNormalizedLogDefaultValue()
get log default value in normalized form
Definition: pluginparameter.h:751
void setControlID(uint32_t cid)
set ID value
Definition: pluginparameter.h:82
bool isDoubleParam()
query: double param?
Definition: pluginparameter.h:118
void initParamSmoother(double sampleRate)
initialize or reset the parameter smoother object
Definition: pluginparameter.h:420
bool useParameterSmoothing
enable param smoothing
Definition: pluginparameter.h:639
double meterRelease_ms
meter release time in milliseconds
Definition: pluginparameter.h:632
void setSmoothingTimeMsec(double value)
set inverted meter flag
Definition: pluginparameter.h:147
bool getIsDiscreteSwitch()
set is switch (not used)
Definition: pluginparameter.h:102
void setCommaSeparatedStringList()
convert the string-list into a comma-separated list (during construction)
Definition: pluginparameter.cpp:293
bool getIsWritable()
query writable control (meter)
Definition: pluginparameter.h:152
uint32_t getDetectorMode()
get meter detect mode
Definition: pluginparameter.h:131
bool isVoltOctaveTaper()
query: volt/octave taper
Definition: pluginparameter.h:112
double getGUIMax()
Definition: pluginparameter.h:352
std::string commaSeparatedStringList
string list a somma separated string
Definition: pluginparameter.h:623
double getMeterRelease_ms()
get meter release time (ballistics)
Definition: pluginparameter.h:128
bool getLogMeter()
query log meter flag
Definition: pluginparameter.h:134
bool isAntiLogTaper()
query: antilog taper
Definition: pluginparameter.h:111
void setLogMeter(bool value)
set log meter flag
Definition: pluginparameter.h:135
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
void setDisplayPrecision(uint32_t precision)
set sig digits
Definition: pluginparameter.h:123
void setMeterAttack_ms(double value)
set meter attack time (ballistics)
Definition: pluginparameter.h:126
double getMaxValue()
get maximum value
Definition: pluginparameter.h:96
uint32_t detectorMode
meter detector mode
Definition: pluginparameter.h:633
smoothingMethod getSmoothingMethod()
query smoothing method
Definition: pluginparameter.h:149
double minValue
the min for the parameter
Definition: pluginparameter.h:598
void setMeterRelease_ms(double value)
set meter release time (ballistics)
Definition: pluginparameter.h:129
double normToAntiLogNorm(double normalizedValue)
Definition: pluginparameter.h:398
double antiLogNormToNorm(double aLogNormalizedValue)
Definition: pluginparameter.h:408
bool isWritable
flag for meter variables
Definition: pluginparameter.h:627
double getNormalizedControlValueWithActualValue(double actualValue)
get the new normalized control value as if it were set with an actual value
Definition: pluginparameter.h:346
void setMeterDetectorMode(uint32_t value)
set meter detect mode
Definition: pluginparameter.h:132
std::string controlName
the name string for the parameter
Definition: pluginparameter.h:593
void setDefaultValue(double value)
set default value
Definition: pluginparameter.h:100
double logNormToNorm(double logNormalizedValue)
Definition: pluginparameter.h:390
void setMaxValue(double value)
set maximum value
Definition: pluginparameter.h:97
int controlID
the ID value for the parameter
Definition: pluginparameter.h:592
double getDefaultValue()
get default value
Definition: pluginparameter.h:99
bool isProtoolsGRMeter()
query pro tools GR meter flag
Definition: pluginparameter.h:140
void setInvertedMeter(bool value)
set inverted meter flag
Definition: pluginparameter.h:138
std::string getStringByIndex(uint32_t index)
get string-list string by index
Definition: pluginparameter.cpp:281
void setControlVariableType(controlVariableType ctrlVarType)
set variable type associated with parameter
Definition: pluginparameter.h:91
smoothingMethod smoothingType
param smoothing type
Definition: pluginparameter.h:640
std::string getControlValueAsString()
the main function to access the underlying atomic double value as a string
Definition: pluginparameter.cpp:227
double defaultValue
the default value for the parameter
Definition: pluginparameter.h:600
const double kCTCorrFactorUnity
concave/convex transform correction factor at x = 1
Definition: guiconstants.h:156
const double kCTCorrFactorAntiLogScale
concave/convex transform scaling factor
Definition: guiconstants.h:177
const double kCTCorrFactorAnitZero
inverse concave/convex transform factor at x = 0
Definition: guiconstants.h:149
const double kCTCoefficient
concave and/or convex transform correction factor
Definition: guiconstants.h:135
smoothingMethod
Use this strongly typed enum to easily set the smoothing type.
Definition: guiconstants.h:240
const double kCTCorrFactorAntiUnity
inverse concave/convex transform correction factor at x = 1
Definition: guiconstants.h:163
controlVariableType
Use this strongly typed enum to easily set the control's behavior; this tells the PluginParameter obj...
Definition: guiconstants.h:288
meterCal
Use this strongly typed enum to easily set meter calibration.
Definition: guiconstants.h:270
boundVariableType
Use this strongly typed enum to easily set the control's linked variable datatype (for automatic vari...
Definition: guiconstants.h:304
const double kCTCorrFactorAntiLog
concave/convex transform correction factor
Definition: guiconstants.h:170
const double kCTCorrFactorZero
concave/convex transform correction factor at x = 0
Definition: guiconstants.h:142
const uint32_t ENVELOPE_DETECT_MODE_RMS
SQRT((1/N)|x|^2)
Definition: guiconstants.h:201
taper
Use this strongly typed enum to easily set the control taper.
Definition: guiconstants.h:255
globally utilized constants and enumerations
globally utilized structures and enumerations
Information about auxilliary parameter details - purely customizeable. This uses the attributeValue u...
Definition: pluginstructures.h:923