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);
167 #endif //AAX_CDECIBELDISPLAYDELEGATEDECORATOR_H
AAX_CDecibelDisplayDelegateDecorator(const AAX_IDisplayDelegate< T > &displayDelegate)
Definition: AAX_CDecibelDisplayDelegateDecorator.h:74
AAX_CDecibelDisplayDelegateDecorator< T > * Clone() const
Constructs and returns a copy of the display delegate.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:81
bool ValueToString(T value, AAX_CString *valueString) const
Converts a real parameter value to a string representation.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:87
Classes for parameter value string conversion.
Definition: AAX_IDisplayDelegate.h:68
The base class for all concrete display delegate decorators.
bool StringToValue(const AAX_CString &valueString, T *value) const
Converts a string to a real parameter value.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:136
A generic AAX string class with similar functionality to std::string.
Definition: AAX_CString.h:35
A percent decorator conforming to AAX_IDisplayDelegateDecorator.
Definition: AAX_CDecibelDisplayDelegateDecorator.h:56
The base class for all concrete display delegate decorators.
Definition: AAX_IDisplayDelegateDecorator.h:43
AAX_CString & Append(const AAX_CString &str)
virtual uint32_t Length() const
void SubString(uint32_t pos, uint32_t n, AAX_IString *outputStr) const
bool StringToValue(const AAX_CString &valueString, T *value) const
Converts a string to a real parameter value.
Definition: AAX_IDisplayDelegateDecorator.h:197
bool ValueToString(T value, AAX_CString *valueString) const
Converts a string to a real parameter value.
Definition: AAX_IDisplayDelegateDecorator.h:185