![]() |
AAX SDK
2.4.1
Avid Audio Extensions Development Kit
|
Classes for parameter value string conversion.
Display delegates are used to convert real parameter values to and from their formatted string representations. All display delegates implement the AAX_IDisplayDelegate interface, which contains two conversion functions:
The AAX SDK utilizes a decorator pattern in order to provide code re-use while accounting for a wide variety of possible parameter display formats. The SDK includes a number of sample display delegate decorator classes.
Each concrete display delegate decorator implements AAX_IDisplayDelegateDecorator and adheres to the decorator pattern. The decorator pattern allows multiple display behaviors to be composited or wrapped together at run time. For instance it is possible to implement a dBV (dB Volts) decorator, by wrapping an AAX_CDecibelDisplayDelegateDecorator with an AAX_CUnitDisplayDelegateDecorator.
By implementing AAX_IDisplayDelegateDecorator, each concrete display delegate decorator class implements the full AAX_IDisplayDelegate interface. In addition, it retains a pointer to the AAX_IDisplayDelegateDecorator that it wraps. When the decorator performs a conversion, it calls into its wrapped class so that the wrapped decorator may apply its own conversion formatting. By repeating this pattern in each decorator, all of the decorator subclasses call into their "wrapper" in turn, resulting in a final string to which all of the decorators' conversions have been applied in sequence.
Here is the relevant implementation from AAX_IDisplayDelegateDecorator :
Here is a concrete example of how a decibel decorator might be implemented
Notice in this example that the ValueToString() method is called in the parent class, AAX_IDisplayDelegateDecorator. This results in a call into the wrapped class' implementation of ValueToString(), which converts the decorated value to a redecorated string, and so forth for additional decorators.
Classes | |
class | AAX_IDisplayDelegateBase |
Defines the display behavior for a parameter. More... | |
class | AAX_IDisplayDelegate< T > |
Classes for parameter value string conversion. More... | |
Documents | |
Display delegate decorators | |
Classes for adapting parameter value strings. | |