24 #ifndef AAX_CLOGTAPERDELEGATE_H
25 #define AAX_CLOGTAPERDELEGATE_H
60 template <
typename T,
int32_t RealPrecision=1000>
82 T
Round(
double iValue)
const;
89 template <
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);
98 template <
typename T,
int32_t RealPrecision>
106 template <
typename T,
int32_t RealPrecision>
112 template <
typename T,
int32_t RealPrecision>
116 value = Round(value);
118 if (value > mMaxValue)
120 if (value < mMinValue)
125 template <
typename T,
int32_t RealPrecision>
128 double minLog = AAX::SafeLog(
double(mMinValue));
129 double maxLog = AAX::SafeLog(
double(mMaxValue));
131 double doubleRealValue = exp(normalizedValue * (maxLog - minLog) + minLog);
132 T realValue = (T) doubleRealValue;
134 return ConstrainRealValue(realValue);
137 template <
typename T,
int32_t RealPrecision>
140 double minLog = AAX::SafeLog(
double(mMinValue));
141 double maxLog = AAX::SafeLog(
double(mMaxValue));
143 realValue = ConstrainRealValue(realValue);
144 double normalizedValue = (AAX::SafeLog(
double(realValue)) - minLog) / (maxLog - minLog);
145 return normalizedValue;
148 #endif // AAX_CLOGTAPERDELEGATE_H
T Round(double iValue) const
Definition: AAX_CLogTaperDelegate.h:90
T GetMaximumValue() const
Returns the taper's maximum real value.
Definition: AAX_CLogTaperDelegate.h:76
Various utility definitions for AAX.
Defines the taper conversion behavior for a parameter.
AAX_CLogTaperDelegate< T, RealPrecision > * Clone() const
Constructs and returns a copy of the taper delegate.
Definition: AAX_CLogTaperDelegate.h:107
A logarithmic taper conforming to AAX_ITaperDelegate.
Definition: AAX_CLogTaperDelegate.h:61
double RealToNormalized(T realValue) const
Normalizes a real parameter value.
Definition: AAX_CLogTaperDelegate.h:138
Various utility definitions for AAX Native.
Classes for conversion to and from normalized parameter values.
Definition: AAX_ITaperDelegate.h:88
T GetMinimumValue() const
Returns the taper's minimum real value.
Definition: AAX_CLogTaperDelegate.h:75
T ConstrainRealValue(T value) const
Applies a contraint to the value and returns the constrained value.
Definition: AAX_CLogTaperDelegate.h:113
AAX_CLogTaperDelegate(T minValue=0, T maxValue=1)
Constructs a Log Taper with specified minimum and maximum values.
Definition: AAX_CLogTaperDelegate.h:99
T NormalizedToReal(double normalizedValue) const
Converts a normalized value to a real value.
Definition: AAX_CLogTaperDelegate.h:126