| AAX SDK 2.6.1 Avid Audio Extensions Development Kit

- Welcome
- Manual
- Classes
- Files
- Lists
- Support

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
List of all members | Public Member Functions
AAX_CUnitPrefixDisplayDelegateDecorator< T > Class Template Reference
AAX SDK Manual » AAX Library features » Parameter Manager » Display delegates » Display delegate decorators

`#include <AAX_CUnitPrefixDisplayDelegateDecorator.h>`

Inheritance diagram for AAX_CUnitPrefixDisplayDelegateDecorator< T >:
[legend]
Collaboration diagram for AAX_CUnitPrefixDisplayDelegateDecorator< T >:
[legend]

## Description

template<typename T>
class AAX_CUnitPrefixDisplayDelegateDecorator< T >

A unit prefix 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 unit prefixes such as the k in kHz or the m in mm. It takes the value passed in and determines if the value is large or small enough to benefit from a unit modifier. If so, it adds that unit prefix character to the display string after scaling the number and calling deeper into the decorator pattern to get the concrete ValueToString() result.

The inverse is also supported, so if you type 1.5k in a text box and this decorator is in place, it should find the k and multiply the value by 1000 before converting it to a real value.

This decorator supports the following unit prefixes:

- M (mega-)
- k (kilo-)
- m (milli-)
- u (micro-)

Note
  This class is not implemented for integer values as the conversions result in fractional numbers. Those would get truncated through the system and be pretty much useless.

## Public Member Functions
| AAX_CUnitPrefixDisplayDelegateDecorator (const AAX_IDisplayDelegate< T > &displayDelegate)
AAX_CUnitPrefixDisplayDelegateDecorator< T > * | Clone () const AAX_OVERRIDE
| Constructs and returns a copy of the display delegate.
bool | ValueToString (T value, AAX_CString *valueString) const AAX_OVERRIDE
| Converts a real parameter value to a string representation.
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.
bool | StringToValue (const AAX_CString &valueString, T *value) const AAX_OVERRIDE
| Converts a string to a real parameter value.
Public Member Functions inherited from AAX_IDisplayDelegateDecorator< T >
| AAX_IDisplayDelegateDecorator (const AAX_IDisplayDelegate< T > &displayDelegate)
| Constructor.
| AAX_IDisplayDelegateDecorator (const AAX_IDisplayDelegateDecorator &other)
| Copy constructor.
| ~AAX_IDisplayDelegateDecorator () AAX_OVERRIDE
| Virtual destructor.
AAX_IDisplayDelegateDecorator< T > * | Clone () const AAX_OVERRIDE
| Constructs and returns a copy of the display delegate decorator.
bool | ValueToString (T value, AAX_CString *valueString) const AAX_OVERRIDE
| Converts a string to a real parameter value.
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.
bool | StringToValue (const AAX_CString &valueString, T *value) const AAX_OVERRIDE
| Converts a string to a real parameter value.
virtual AAX_IDisplayDelegate * | Clone () const =0
| Constructs and returns a copy of the display delegate.
virtual bool | ValueToString (T value, AAX_CString *valueString) const =0
| Converts a real parameter value to a string representation.
virtual bool | ValueToString (T value, int32_t maxNumChars, AAX_CString *valueString) const =0
| Converts a real parameter value to a string representation using a size hint, useful for control surfaces and other character limited displays.
virtual bool | StringToValue (const AAX_CString &valueString, T *value) const =0
| Converts a string to a real parameter value.
Public Member Functions inherited from AAX_IDisplayDelegateBase
virtual | ~AAX_IDisplayDelegateBase ()
| Virtual destructor.

## Constructor & Destructor Documentation

## ◆ AAX_CUnitPrefixDisplayDelegateDecorator()

template<typename T >

AAX_CUnitPrefixDisplayDelegateDecorator< T >::AAX_CUnitPrefixDisplayDelegateDecorator | ( | const AAX_IDisplayDelegate< T > & | displayDelegate | ) |

## Member Function Documentation

## ◆ Clone()

template<typename T >

AAX_CUnitPrefixDisplayDelegateDecorator< T > * AAX_CUnitPrefixDisplayDelegateDecorator< T >::Clone | ( |  | ) | const
| virtual

Constructs and returns a copy of the display delegate.

In general, this method's implementation can use a simple copy constructor:

template <typename T>
AAX_CSubclassDisplayDelegate<T>* AAX_CSubclassDisplayDelegate<T>::Clone() const
{
return new AAX_CSubclassDisplayDelegate(*this);
}

Implements AAX_IDisplayDelegate< T >.

## ◆ ValueToString() [1/2]

template<typename T >

bool AAX_CUnitPrefixDisplayDelegateDecorator< T >::ValueToString | ( | T | value,
|  | AAX_CString * | valueString
| ) |  | const
| virtual

Converts a real parameter value to a string representation.

Parameters

  [in] | value | The real parameter value that will be converted
  [out] | valueString | A string corresponding to value

Return values

  true | The string conversion was successful
  false | The string conversion was unsuccessful

Implements AAX_IDisplayDelegate< T >.

References AAX_IDisplayDelegateDecorator< T >::ValueToString().

Here is the call graph for this function:

## ◆ ValueToString() [2/2]

template<typename T >

bool AAX_CUnitPrefixDisplayDelegateDecorator< T >::ValueToString | ( | T | value,
|  | int32_t | maxNumChars,
|  | AAX_CString * | valueString
| ) |  | const
| virtual

Converts a real parameter value to a string representation using a size hint, useful for control surfaces and other character limited displays.

Parameters

  [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

Return values

  true | The string conversion was successful
  false | The string conversion was unsuccessful

Implements AAX_IDisplayDelegate< T >.

References AAX_IDisplayDelegateDecorator< T >::ValueToString().

Here is the call graph for this function:

## ◆ StringToValue()

template<typename T >

bool AAX_CUnitPrefixDisplayDelegateDecorator< T >::StringToValue | ( | const AAX_CString & | valueString,
|  | T * | value
| ) |  | const
| virtual

Converts a string to a real parameter value.

Parameters

  [in] | valueString | The string that will be converted
  [out] | value | The real parameter value corresponding to valueString

Return values

  true | The string conversion was successful
  false | The string conversion was unsuccessful

Implements AAX_IDisplayDelegate< T >.

References AAX_CString::Erase(), AAX_CString::Length(), and AAX_IDisplayDelegateDecorator< T >::StringToValue().

Here is the call graph for this function:

The documentation for this class was generated from the following file:

- AAX_CUnitPrefixDisplayDelegateDecorator.h