22#ifndef AAX_CDECIBELDISPLAYDELEGATEDECORATOR_H
23#define AAX_CDECIBELDISPLAYDELEGATEDECORATOR_H
86 bool succeeded =
false;
95 value = (T)(20.0*log10(value));
96 if ( value > -0.01f && value < 0.0f)
112 if (maxNumChars >= 7)
113 valueString->
Append(
" dB");
117 value = (T)(20.0*log10(value));
118 if ( value > -0.01f && value < 0.0f)
124 uint32_t strlen = valueString->
Length();
125 const uint32_t maxNumCharsUnsigned = (0 <= maxNumChars) ?
static_cast<uint32_t
>(maxNumChars) : 0;
126 if (maxNumCharsUnsigned >= (strlen + 2))
136 if (valueString.
Length() <= 2)
139 *value = (T)pow((T)10.0, (*value / (T)20.0));
149 *value = (T)pow((T)10.0, *value / (T)20.0);
157 *value = (T)pow((T)10.0, *value / (T)20.0);
#define AAX_OVERRIDE
override keyword macro
Definition: AAX.h:151
The base class for all concrete display delegate decorators.
A percent decorator conforming to AAX_IDisplayDelegateDecorator.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:54
bool ValueToString(T value, AAX_CString *valueString) const AAX_OVERRIDE
Converts a real parameter value to a string representation.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:84
AAX_CDecibelDisplayDelegateDecorator< T > * Clone() const AAX_OVERRIDE
Constructs and returns a copy of the display delegate.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:78
bool StringToValue(const AAX_CString &valueString, T *value) const AAX_OVERRIDE
Converts a string to a real parameter value.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:133
AAX_CDecibelDisplayDelegateDecorator(const AAX_IDisplayDelegate< T > &displayDelegate)
Definition: AAX_CDecibelDisplayDelegateDecorator.h:71
A generic AAX string class with similar functionality to std::string
Definition: AAX_CString.h:44
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:66
The base class for all concrete display delegate decorators.
Definition: AAX_IDisplayDelegateDecorator.h:41
bool StringToValue(const AAX_CString &valueString, T *value) const AAX_OVERRIDE
Converts a string to a real parameter value.
Definition: AAX_IDisplayDelegateDecorator.h:194
bool ValueToString(T value, AAX_CString *valueString) const AAX_OVERRIDE
Converts a string to a real parameter value.
Definition: AAX_IDisplayDelegateDecorator.h:182