![]() |
AAX SDK
2.4.1
Avid Audio Extensions Development Kit
|
#include <AAX_CPercentDisplayDelegateDecorator.h>
A percent decorator conforming to AAX_IDisplayDelegateDecorator.
This class is an AAX_IDisplayDelegateDecorator, meaning that it acts as a wrapper for other display delegates or concrete display types. For more information about display delegate decorators in AAX, see Display delegate decorators
The behavior of this class it to provide string conversion to and from percentage (%) values. When converting a parameter value to a string, it takes the real value and performs a % conversion before passing the value on to a concrete implementation to get a value string. It then adds on the "%" string at the end to signify that the value was converted. This allows something like a gain value to remain internally linear at all times even though its display is converted to a percentage.
The inverse operation is also supported; this class can convert a percentage-formatted string into its associated real value. The string will first be converted to a number, then that number will have the inverse % calculation applied to it to retrieve the parameter's actual value.
Public Member Functions | |
AAX_CPercentDisplayDelegateDecorator (const AAX_IDisplayDelegate< T > &displayDelegate) | |
AAX_CPercentDisplayDelegateDecorator< T > * | Clone () const AAX_OVERRIDE |
Constructs and returns a copy of the display delegate. More... | |
bool | ValueToString (T value, AAX_CString *valueString) const AAX_OVERRIDE |
Converts a real parameter value to a string representation. More... | |
bool | ValueToString (T value, int32_t maxNumChars, AAX_CString *valueString) const AAX_OVERRIDE |
Converts a real parameter value to a string representation using a size hint, useful for control surfaces and other character limited displays. More... | |
bool | StringToValue (const AAX_CString &valueString, T *value) const AAX_OVERRIDE |
Converts a string to a real parameter value. More... | |
![]() | |
AAX_IDisplayDelegateDecorator (const AAX_IDisplayDelegate< T > &displayDelegate) | |
Constructor. More... | |
AAX_IDisplayDelegateDecorator (const AAX_IDisplayDelegateDecorator &other) | |
Copy constructor. More... | |
~AAX_IDisplayDelegateDecorator () AAX_OVERRIDE | |
Virtual destructor. More... | |
AAX_IDisplayDelegateDecorator< T > * | Clone () const AAX_OVERRIDE |
Constructs and returns a copy of the display delegate decorator. More... | |
bool | ValueToString (T value, AAX_CString *valueString) const AAX_OVERRIDE |
Converts a string to a real parameter value. More... | |
bool | ValueToString (T value, int32_t maxNumChars, AAX_CString *valueString) const AAX_OVERRIDE |
Converts a string to a real parameter value with a size constraint. More... | |
bool | StringToValue (const AAX_CString &valueString, T *value) const AAX_OVERRIDE |
Converts a string to a real parameter value. More... | |
![]() | |
virtual | ~AAX_IDisplayDelegateBase () |
Virtual destructor. More... | |
AAX_CPercentDisplayDelegateDecorator< T >::AAX_CPercentDisplayDelegateDecorator | ( | const AAX_IDisplayDelegate< T > & | displayDelegate | ) |
|
virtual |
Constructs and returns a copy of the display delegate.
In general, this method's implementation can use a simple copy constructor:
Implements AAX_IDisplayDelegate< T >.
|
virtual |
Converts a real parameter value to a string representation.
[in] | value | The real parameter value that will be converted |
[out] | valueString | A string corresponding to value |
true | The string conversion was successful |
false | The string conversion was unsuccessful |
Implements AAX_IDisplayDelegate< T >.
References AAX_IDisplayDelegateDecorator< T >::ValueToString().
|
virtual |
Converts a real parameter value to a string representation using a size hint, useful for control surfaces and other character limited displays.
[in] | value | The real parameter value that will be converted |
[in] | maxNumChars | Size hint for the desired maximum number of characters in the string (not including null termination) |
[out] | valueString | A string corresponding to value |
true | The string conversion was successful |
false | The string conversion was unsuccessful |
Implements AAX_IDisplayDelegate< T >.
References AAX_IDisplayDelegateDecorator< T >::ValueToString().
|
virtual |
Converts a string to a real parameter value.
[in] | valueString | The string that will be converted |
[out] | value | The real parameter value corresponding to valueString |
true | The string conversion was successful |
false | The string conversion was unsuccessful |
Implements AAX_IDisplayDelegate< T >.
References AAX_CString::Length(), AAX_IDisplayDelegateDecorator< T >::StringToValue(), and AAX_CString::SubString().