19#ifndef __LOGTAPERDELEGATE_H
20#define __LOGTAPERDELEGATE_H
22#include "AAX_ITaperDelegate.h"
23#include "AAX_UtilsNative.h"
29template <
typename T,
int32_t RealPrecision=1000>
53 T GetMinimumValue()
const {
return mMinValue; }
54 T GetMaximumValue()
const {
return mMaxValue; }
55 T ConstrainRealValue(T value)
const;
56 T NormalizedToReal(
double normalizedValue)
const;
57 double RealToNormalized(T realValue)
const;
60 T Round(
double iValue)
const;
64 inline double calcLogParameter(
double fNormalizedParam)
const
66 if(fNormalizedParam <= 0.0)
return 0.0;
67 if(fNormalizedParam >= 1.0)
return 1.0;
75 inline double calcLogPluginValue(
double fPluginValue)
const
77 if(fPluginValue <= 0.0)
return 0.0;
78 if(fPluginValue >= 1.0)
return 1.0;
89template <
typename T,
int32_t RealPrecision>
92 double precision = RealPrecision;
94 return static_cast<T
>(floor(iValue * precision + 0.5) / precision);
95 return static_cast<T
>(iValue);
98template <
typename T,
int32_t RealPrecision>
106template <
typename T,
int32_t RealPrecision>
112template <
typename T,
int32_t RealPrecision>
116 value = Round(value);
118 if (value > mMaxValue)
120 if (value < mMinValue)
125template <
typename T,
int32_t RealPrecision>
128 normalizedValue = calcLogPluginValue(normalizedValue);
129 double doubleRealValue = normalizedValue*(mMaxValue - mMinValue) + mMinValue;
131 T realValue = (T) doubleRealValue;
133 return ConstrainRealValue(realValue);
136template <
typename T,
int32_t RealPrecision>
139 double normValue = (realValue - mMinValue)/(mMaxValue - mMinValue);
140 return calcLogParameter(normValue);
The LogTaperDelegate object encapsulates a log parameter. Note that the standard log potentiometer in...
Definition: LogTaperDelegate.h:47
const double kCTCorrFactorUnity
concave/convex transform correction factor at x = 1
Definition: guiconstants.h:156
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
const double kCTCorrFactorZero
concave/convex transform correction factor at x = 0
Definition: guiconstants.h:142
globally utilized constants and enumerations