Jamoma API
0.6.0.a19
|
Base class for each dataspace. More...
#include <TTDataspace.h>
Public Member Functions | |
TTDataspace () | |
Constructor. | |
virtual | ~TTDataspace () |
Destructor. | |
TTErr | convert (const TTValue &input, TTValue &output) |
Converts a value from one unit to another. More... | |
TTErr | setInputUnit (TTSymbol inUnitName) |
Set the input unit type for this dataspace object by it's name as a symbol. More... | |
TTSymbol & | getInputUnit () |
Get the input unit type for this dataspace object as a symbol. More... | |
TTErr | setOutputUnit (TTSymbol outUnitName) |
Set the output unit type for this dataspace object by it's name as a symbol. More... | |
TTSymbol & | getOutputUnit () |
Get the output unit type for this dataspace object as a symbol. More... | |
TTErr | getAvailableUnits (TTValue &unitNames) |
Return a list of all available units for this dataspace. More... | |
Public Attributes | |
TTSymbol | neutralUnit |
The neutral unit of the dataspace as a symbol. | |
Protected Member Functions | |
void | registerUnit (const TTSymbol &className, const TTSymbol &unitName) |
Called by subclasses to register units with the dataspace. More... | |
Base class for each dataspace.
Definition at line 30 of file TTDataspace.h.
Converts a value from one unit to another.
Internally in the dataspace the conversion is done in two steps: First the input value is converted to the neutral unit, and that value is then converted to the output value. If a dataspace has N alternative units, this prevents us from having to provide NxN methods for conversions. Instead we make do with 2xN methods, making the DataspaceLib more manageable and scaleable.
input | The input value, described using the input unit. |
output | The output value, converted to the output unit. |
Definition at line 36 of file TTDataspace.cpp.
References TTDataspaceUnit::convertFromNeutral(), TTDataspaceUnit::convertToNeutral(), kTTErrNone, and TTDataspaceUnit::name.
Return a list of all available units for this dataspace.
unitNames | Returns a list of all available units for this dataspace. |
Definition at line 120 of file TTDataspace.cpp.
References TTHash::getKeys().
TTSymbol & TTDataspace::getInputUnit | ( | ) |
Get the input unit type for this dataspace object as a symbol.
Definition at line 75 of file TTDataspace.cpp.
References TTDataspaceUnit::name.
TTSymbol & TTDataspace::getOutputUnit | ( | ) |
Get the output unit type for this dataspace object as a symbol.
Definition at line 106 of file TTDataspace.cpp.
References TTDataspaceUnit::name.
Called by subclasses to register units with the dataspace.
className | |
unitName |
Definition at line 112 of file TTDataspace.cpp.
References TTHash::append().
Set the input unit type for this dataspace object by it's name as a symbol.
inUnitName | The input unit type for this dataspace object as a symbol. |
Definition at line 50 of file TTDataspace.cpp.
References kTTErrNone, TTHash::lookup(), TTDataspaceUnit::name, and TTObjectBaseInstantiate().
Set the output unit type for this dataspace object by it's name as a symbol.
outUnitName | The input unit type for this dataspace object as a symbol. |
Definition at line 81 of file TTDataspace.cpp.
References kTTErrNone, TTHash::lookup(), TTDataspaceUnit::name, and TTObjectBaseInstantiate().