25 #ifndef AAX_CDECIBELDISPLAYDELEGATEDECORATOR_H
26 #define AAX_CDECIBELDISPLAYDELEGATEDECORATOR_H
89 bool succeeded =
false;
98 value = (T)(20.0*log10(value));
99 if ( value > -0.01f && value < 0.0f)
109 template <
typename T>
115 if (maxNumChars >= 7)
116 valueString->
Append(
" dB");
120 value = (T)(20.0*log10(value));
121 if ( value > -0.01f && value < 0.0f)
127 uint32_t strlen = valueString->
Length();
128 const uint32_t maxNumCharsUnsigned = (0 <= maxNumChars) ?
static_cast<uint32_t
>(maxNumChars) : 0;
129 if (maxNumCharsUnsigned >= (strlen + 2))
135 template <
typename T>
139 if (valueString.
Length() <= 2)
142 *value = (T)pow((T)10.0, (*value / (T)20.0));
152 *value = (T)pow((T)10.0, *value / (T)20.0);
160 *value = (T)pow((T)10.0, *value / (T)20.0);
#define AAX_OVERRIDE
override keyword macro
Definition: AAX.h:141
The base class for all concrete display delegate decorators.
A percent decorator conforming to AAX_IDisplayDelegateDecorator.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:57
bool ValueToString(T value, AAX_CString *valueString) const AAX_OVERRIDE
Converts a real parameter value to a string representation.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:87
AAX_CDecibelDisplayDelegateDecorator< T > * Clone() const AAX_OVERRIDE
Constructs and returns a copy of the display delegate.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:81
bool StringToValue(const AAX_CString &valueString, T *value) const AAX_OVERRIDE
Converts a string to a real parameter value.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:136
AAX_CDecibelDisplayDelegateDecorator(const AAX_IDisplayDelegate< T > &displayDelegate)
Definition: AAX_CDecibelDisplayDelegateDecorator.h:74
A generic AAX string class with similar functionality to std::string
Definition: AAX_CString.h:46
uint32_t Length() const AAX_OVERRIDE
void SubString(uint32_t pos, uint32_t n, AAX_IString *outputStr) const
AAX_CString & Append(const AAX_CString &str)
Classes for parameter value string conversion.
Definition: AAX_IDisplayDelegate.h:69
The base class for all concrete display delegate decorators.
Definition: AAX_IDisplayDelegateDecorator.h:44
bool StringToValue(const AAX_CString &valueString, T *value) const AAX_OVERRIDE
Converts a string to a real parameter value.
Definition: AAX_IDisplayDelegateDecorator.h:197
bool ValueToString(T value, AAX_CString *valueString) const AAX_OVERRIDE
Converts a string to a real parameter value.
Definition: AAX_IDisplayDelegateDecorator.h:185