Jamoma API
0.6.0.a19
|
[doxygenAppendixC_copyExample] More...
#include <TTValue.h>
Inherits std::vector< T >.
Public Member Functions | |
TTValue () | |
[doxygenAppendixC_copyExample] More... | |
template<class T > | |
TTValue (const T &anInitialValue) | |
Constructor with a single initial element. More... | |
TTValue (const TTFloat64 v) | |
Specialized constructor for the float64 case because it is so often performance sensitive. More... | |
template<class T , class U > | |
TTValue (const T &aFirstElementInitialValue, const U &aSecondElementInitialValue) | |
Constructor with two initial elements. More... | |
template<class T , class U , class V > | |
TTValue (const T &aFirstElementInitialValue, const U &aSecondElementInitialValue, const V &aThirdElementInitialValue) | |
Constructor with three initial elements. More... | |
template<class T , class U , class V , class W > | |
TTValue (const T &aFirstElementInitialValue, const U &aSecondElementInitialValue, const V &aThirdElementInitialValue, const W &aFourthElementInitialValue) | |
Constructor with four initial elements. More... | |
~TTValue () | |
Destructor. | |
TTFloat64 | float64 () const |
Fast fetch of float64 elements without range/type checking or conversion. | |
TTValue & | float64 (TTFloat64 v) |
Fast assignment of float64 elements without range/type checking or conversion. More... | |
void | clear () |
Clear all values from the vector, leaving with size of 0. | |
void | copyRange (const TTValue &obj, TTUInt16 startIndex, TTUInt16 endIndex) |
Copy a value starting from an index until another index. | |
void | copyFrom (const TTValue &obj, TTUInt16 index) |
Copy a value starting from an index until the last element. | |
void | prepend (const TTValue &aValueToPrepend) |
Insert another TTValue before the first element. More... | |
template<class T > | |
TTValue & | operator= (T value) |
Assign a value to TTValue. More... | |
template<class T > | |
operator T () const | |
Get a value from TTValue. | |
operator TTSymbol () const | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
operator TTObject () const | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<class T > | |
void | append (const T &anElementValueToAppend) |
Insert a single TTElement at the end. | |
void | append (const TTValue &aValueToAppend) |
Insert another TTValue after the last element. More... | |
void | clip (const TTFloat64 &aLowBound, const TTFloat64 &aHighBound) |
Clip numerical values between low and high boundaries. More... | |
void | cliplow (const TTFloat64 &aLowBound) |
Clip numerical values below a specified boundary. More... | |
void | cliphigh (const TTFloat64 &aHighBound) |
Clip numerical values above a specified boundary. More... | |
void | fold (const TTFloat64 &aLowBound, const TTFloat64 &aHighBound) |
Fold numerical values to remain between low and high boundaries. More... | |
void | wrap (const TTFloat64 &aLowBound, const TTFloat64 &aHighBound) |
Wrap numerical values to remain between low and high boundaries. More... | |
void | round () |
Round float & double elements to the nearest whole number. | |
void | truncate () |
Truncate float & double elements so that only whole number remains. | |
void | booleanize () |
Booleanize numerical elements. More... | |
TTString | toString (TTBoolean quotes=YES) const |
Return the content as a single string with spaces between elements. More... | |
void | toString (TTBoolean quotes=YES) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | fromString (TTBoolean numberAsSymbol=NO) |
Convert a single string into individual elements using space to divide items. More... | |
TTErr | transformCSVStringToSymbolArray () |
Convert a comma-separated-value string into an array of TTSymbols. More... | |
size_type | size () const noexcept |
Return the number of elements. More... | |
void | resize (size_type n) |
Change the number of elements. More... | |
TTUInt16 | getSize () const |
DEPRECATED. More... | |
void | setSize (const TTUInt16 arg) |
DEPRECATED. More... | |
TTDataType | getType (const TTUInt16 index=0) const |
DEPRECATED. More... | |
template<class T > | |
void | set (const TTUInt16 index, const T &anElementValue) |
DEPRECATED. More... | |
template<class T > | |
void | get (const TTUInt16 index, T &returnedElementValue) const |
DEPRECATED. More... | |
TTFloat64 | getUInt8 (TTUInt16 index=0) const |
DEPRECATED. More... | |
TTFloat64 | getInt32 (TTUInt16 index=0) const |
DEPRECATED. More... | |
TTFloat64 | getFloat32 (TTUInt16 index=0) const |
DEPRECATED. More... | |
TTFloat64 | getFloat64 (TTUInt16 index=0) const |
DEPRECATED. More... | |
void | getArray (TTUInt8 *arrayToFill, TTUInt16 maxSize) const |
DEPRECATED. More... | |
void | getArray (TTInt32 *arrayToFill, TTUInt16 maxSize) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | getArray (TTFloat32 *arrayToFill, TTUInt16 maxSize) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
void | getArray (TTFloat64 *arrayToFill, TTUInt16 maxSize) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Friends | |
bool | operator== (const TTValue &a, const TTValue &b) |
Test equality of two values. | |
template<class T > | |
bool | operator== (const TTValue &a, const T b) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
[doxygenAppendixC_copyExample]
Provides a common way of representing composite values. TTValue is the primary interface used to pass values to and from methods in Jamoma Core. Methods for a given TTObject should be passed both an input and output value to complete its operation, while the return is reserved for a TTErr.
Each TTValue may be composed of a single element or many elements because it has been defined as a subclass of the C++ standard library's vector class. This also enables our class to inherit familiar functions such as size() and from its parent class.
Individual items within the TTValue are defined by the TTElement class. These individual elements may be one of the defined types in the TTDataType enumeration.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Booleanize numerical elements.
Sets all non-zero numerical elements to true, while those that are zero will be set to false. Changes the TTDataType of these elements to kTypeBoolean.
Clip numerical values between low and high boundaries.
[in] | aLowBound | Lowest value that should be preserved. Anything lower will be set to this value. |
[in] | aHighBound | Highest value that should be preserved. Anything higher will be set to this value. |
Definition at line 279 of file TTValue.h.
Referenced by TTObjectBase::setAttributeValue().
|
inline |
Clip numerical values above a specified boundary.
[in] | aHighBound | Highest value that should be preserved. Anything higher will be set to this value. |
Definition at line 299 of file TTValue.h.
Referenced by TTObjectBase::setAttributeValue().
|
inline |
Clip numerical values below a specified boundary.
[in] | aLowBound | Lowest value that should be preserved. Anything lower will be set to this value. |
Definition at line 289 of file TTValue.h.
Referenced by LinearAmplitudeUnit::convertToNeutral(), and TTObjectBase::setAttributeValue().
|
inline |
Convert a single string into individual elements using space to divide items.
numberAsSymbol | optional TTBoolean determines whether method leaves numbers as symbols, default is NO |
Definition at line 386 of file TTValue.h.
References TTString::c_str(), clear(), kTypeString, resize(), TTString::size(), and TTString::substr().
Referenced by TTXmlHandler::fromXmlChar().
|
inline |
DEPRECATED.
Definition at line 649 of file TTValue.h.
References size().
DEPRECATED.
DEPRECATED.
DEPRECATED.
|
inline |
DEPRECATED.
Definition at line 521 of file TTValue.h.
References size().
|
inline |
DEPRECATED.
Old syntax:
New syntax:
DEPRECATED.
|
inline |
|
inline |
Insert another TTValue before the first element.
The following example code would result in TTValue b having elements ordered <1, 2, 3, ga, bu, zo, meu>:
Definition at line 162 of file TTValue.h.
References append().
Referenced by TTSampleMatrix::load(), ramp_functionParameter(), ramp_schedulerParameter(), TTSampleMatrix::resizeThenLoad(), TTApplicationManagerProtocolActivityInCallback(), TTApplicationManagerProtocolActivityOutCallback(), and TTContainerValueAttributeCallback().
void TTValue::resize | ( | size_type | n | ) |
Change the number of elements.
Inherited from the C++ standard library's vector class
n | number of elements for resulting TTValue |
Referenced by append(), Cartesian3DUnit::convertFromNeutral(), CMYUnit::convertFromNeutral(), Cartesian2DUnit::convertFromNeutral(), EulerUnit::convertFromNeutral(), HSLUnit::convertFromNeutral(), SphericalUnit::convertFromNeutral(), AxisUnit::convertFromNeutral(), HSVUnit::convertFromNeutral(), PolarUnit::convertFromNeutral(), OpenGlUnit::convertFromNeutral(), RGB8Unit::convertFromNeutral(), CylindricalUnit::convertFromNeutral(), Cartesian3DUnit::convertToNeutral(), CMYUnit::convertToNeutral(), Cartesian2DUnit::convertToNeutral(), EulerUnit::convertToNeutral(), HSLUnit::convertToNeutral(), SphericalUnit::convertToNeutral(), AxisUnit::convertToNeutral(), HSVUnit::convertToNeutral(), PolarUnit::convertToNeutral(), OpenGlUnit::convertToNeutral(), RGB8Unit::convertToNeutral(), CylindricalUnit::convertToNeutral(), copyRange(), fromString(), TTNode::getAddress(), TTMutesolo::getChannelMute(), TTMutesolo::getChannelSolo(), TTMatrixBase::getDimensions(), TTSpatBase::getSinkPosition(), TTSpatBase::getSourcePosition(), TTSpat::getSpatFunctions(), TTTrajectory::getTypes(), TTAllpass1::init(), TTAverage::init(), jamoma_ttvalue_from_Atom(), operator=(), PackNew(), TTXmlHandler::Read(), setSize(), RosenbergGlottalPulseWindow::test(), TTMatrixBase::test(), KaiserWindow::test(), TTDataParseCommand(), TTDataRampCallback(), TTValue(), and TTXmlHandler::Write().
|
inline |
DEPRECATED.
Old syntax:
New syntax:
Definition at line 569 of file TTValue.h.
Referenced by TTViewerDataspaceCallback(), and TTViewerDataspaceUnitCallback().
|
inline |
DEPRECATED.
Definition at line 528 of file TTValue.h.
References resize().
|
noexcept |
Return the number of elements.
Inherited from the C++ standard library's vector class
none |
Referenced by append(), TTProtocol::ApplicationRegister(), TTProtocol::ApplicationRename(), TTProtocol::ApplicationUnregister(), copyFrom(), copyRange(), TTMatrixBase::fill(), filter_gettypes(), TTMatrixBase::get(), TTApplicationManager::getApplicationProtocolNames(), getArray(), TTObjectBase::getAttributeNames(), TTEnvironment::getClassNamesWithTags(), TTTrajectory::getCurrentAttributeNames(), TTFreeHandFunction::getCurveList(), TTObjectBase::getMessageNames(), getSize(), TTXmlHandler::getXmlNextAttribute(), jamoma_callback_return_address(), jamoma_callback_return_signal_audio(), jamoma_callback_return_value(), jamoma_callback_return_value_typed(), jamoma_patcher_share_info(), jamoma_subscriber_create(), jamoma_ttvalue_to_Atom(), jamoma_ttvalue_to_typed_Atom(), TTSoundfileLoader::load(), model_get_amenities(), model_preset_edit(), model_set_amenities(), model_subscribe(), TTSampleMatrix::normalize(), TTNodeDirectory::notifyObservers(), operator T(), operator TTObject(), operator TTSymbol(), TTTrajectory::ramp(), ramp_list(), TTXmlHandler::Read(), TTEnvironment::registerClass(), TTNodeDirectory::replaceAlias(), score_doread(), TTAudioObjectBaseArray::set(), TTMatrixBase::set(), TTMutesolo::setChannelMute(), TTMutesolo::setChannelSolo(), TTFreeHandFunction::setCurveList(), TTMatrixBase::setDimensions(), TTClock::setDuration(), TTMultiMixer::setGain(), TTMixer::setGain(), TTUiInfo::setHighlight(), TTMixer::setLinearGain(), TTMixer::setMidiGain(), TTWavetable::setMode(), TTNode::setNameInstance(), TTClock::setOffset(), WindowFunction::setParameter(), TTAttribute::setrange(), TTClock::setSpeed(), TTSampleMatrix::setValueAtIndex(), TTMutesolo::test(), toString(), TTContainerValueAttributeCallback(), TTDataParseCommand(), TTExplorerDirectoryCallback(), TTMapperInputCreationCallback(), TTMapperOutputCreationCallback(), wrapAsMaxAudioGraph(), wrappedModularClass_anything(), wrappedModularClass_attrSet(), wrapTTModularClassAsMaxClass(), wrapTTModularClassAsPdClass(), TTXmlHandler::Write(), TTObjectBase::~TTObjectBase(), and TTProtocol::~TTProtocol().
Return the content as a single string with spaces between elements.
none |
Definition at line 351 of file TTValue.h.
References TTString::append(), and size().
Referenced by WrappedInputClass_new(), and WrappedOutputClass_new().
|
inline |
Convert a comma-separated-value string into an array of TTSymbols.
Definition at line 463 of file TTValue.h.
References append(), TTString::c_str(), clear(), kTTErrInvalidType, kTTErrNone, kTypeString, and TTString::size().
Referenced by TTEnvironment::registerClass().
Wrap numerical values to remain between low and high boundaries.
[in] | aLowBound | Lowest value that should be preserved. Anything lower will be wrapped. |
[in] | aHighBound | Highest value that should be preserved. Anything higher will be wrapped. |