35#ifndef AAX_CDECIBELDISPLAYDELEGATEDECORATOR_H
36#define AAX_CDECIBELDISPLAYDELEGATEDECORATOR_H
99 bool succeeded =
false;
108 value = (T)(20.0*log10(value));
109 if ( value > -0.01f && value < 0.0f)
125 if (maxNumChars >= 7)
126 valueString->
Append(
" dB");
130 value = (T)(20.0*log10(value));
131 if ( value > -0.01f && value < 0.0f)
137 uint32_t strlen = valueString->
Length();
138 const uint32_t maxNumCharsUnsigned = (0 <= maxNumChars) ?
static_cast<uint32_t
>(maxNumChars) : 0;
139 if (maxNumCharsUnsigned >= (strlen + 2))
149 if (valueString.
Length() <= 2)
152 *value = (T)pow((T)10.0, (*value / (T)20.0));
162 *value = (T)pow((T)10.0, *value / (T)20.0);
170 *value = (T)pow((T)10.0, *value / (T)20.0);
#define AAX_OVERRIDE
override keyword macro
Definition: AAX.h:164
The base class for all concrete display delegate decorators.
A percent decorator conforming to AAX_IDisplayDelegateDecorator.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:67
bool ValueToString(T value, AAX_CString *valueString) const AAX_OVERRIDE
Converts a real parameter value to a string representation.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:97
AAX_CDecibelDisplayDelegateDecorator< T > * Clone() const AAX_OVERRIDE
Constructs and returns a copy of the display delegate.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:91
bool StringToValue(const AAX_CString &valueString, T *value) const AAX_OVERRIDE
Converts a string to a real parameter value.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:146
AAX_CDecibelDisplayDelegateDecorator(const AAX_IDisplayDelegate< T > &displayDelegate)
Definition: AAX_CDecibelDisplayDelegateDecorator.h:84
A generic AAX string class with similar functionality to std::string
Definition: AAX_CString.h:57
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)
Definition: AAX_IDisplayDelegate.h:79
The base class for all concrete display delegate decorators.
Definition: AAX_IDisplayDelegateDecorator.h:54
bool StringToValue(const AAX_CString &valueString, T *value) const AAX_OVERRIDE
Converts a string to a real parameter value.
Definition: AAX_IDisplayDelegateDecorator.h:207
bool ValueToString(T value, AAX_CString *valueString) const AAX_OVERRIDE
Converts a string to a real parameter value.
Definition: AAX_IDisplayDelegateDecorator.h:195