19 #define thisTTClass TTRamp
20 #define thisTTClassName "Ramp"
21 #define thisTTClassTags "ramp"
23 TT_MODULAR_CONSTRUCTOR,
26 mFunction(kTTSymEmpty),
38 if (arguments.size() == 2) {
40 mCallback = TTRampCallback((
TTPtr)arguments[0]);
41 mBaton = (
TTPtr)arguments[1];
49 this->findAttribute(
TTSymbol(
"driveParameterValue"), &anAttribute);
58 this->findAttribute(
TTSymbol(
"functionParameterValue"), &anAttribute);
73 setAttributeValue(kTTSym_function,
TTSymbol(
"linear"));
81 delete [] currentValue;
82 delete [] targetValue;
99 newDriveName = inputValue[0];
101 if (newDriveName == mDrive)
104 mDrive = newDriveName;
109 if (TTClockLib::isClockNameAvailable(mDrive))
112 if (mDrive != kTTSymEmpty && mDrive != kTTSym_none) {
144 if (value.
size() == 1) {
148 parameterName = value[0];
158 TTErr TTRamp::setDriveParameterValue(
const TTValue& value)
163 if (value.
size() > 1) {
167 parameterName = value[0];
181 newFunctionName = inputValue[0];
183 if (newFunctionName ==
TTSymbol(
"none"))
184 newFunctionName =
TTSymbol(
"linear");
186 if (newFunctionName == mFunction)
189 mFunction = newFunctionName;
218 if (aName == kTTSym_bypass || aName == kTTSym_mute || aName == kTTSym_maxNumChannels || aName == kTTSym_sampleRate)
236 if (value.
size() == 1) {
240 parameterName = value[0];
250 TTErr TTRamp::setFunctionParameterValue(
const TTValue& value)
257 if (value.
size() > 1) {
261 parameterName = value[0];
280 mNumValues = inputValue.
size();
284 for (i = 0; i < mNumValues; i++)
285 startValue[i] =
TTFloat64(inputValue[i]);
301 if (mNumValues == inputValue.
size()) {
303 currentValue =
new TTFloat64[mNumValues];
306 for (i = 0; i < mNumValues; i++) {
307 currentValue[i] = startValue[i];
308 targetValue[i] =
TTFloat64(inputValue[i]);
322 if (inputValue.
size() == 1) {
324 mRampTime = inputValue[0];
328 if (startValue && currentValue && targetValue)
338 if (inputValue.
size() == 1) {
342 if (startValue && currentValue && targetValue) {
375 TTFloat64 *current = aRamp->currentValue;
384 for (i = 0; i < aRamp->mNumValues; i++)
385 current[i] = start[i] + ((target[i] - start[i]) * mapped);
387 (aRamp->mCallback)(aRamp->mBaton, aRamp->mNumValues, current);
394 for (i = 0; i < aRamp->mNumValues; i++)
395 current[i] = start[i] + ((target[i] - start[i]) * mapped);
397 (aRamp->mCallback)(aRamp->mBaton, aRamp->mNumValues, current);
TTErr(TTObjectBase::* TTSetterMethod)(const TTAttribute &attribute, const TTValue &value)
A type that can be used to store a pointer to a message for an object.
void TTRampDriveCallback(TTPtr object, TTFloat64 position, TTFloat64 date)
TTErr send(const TTSymbol aName)
Send a message to this object with no arguments.
TTRamp generates a linear traversal from 0.0 to 1.0 over the course of a specified time period...
TTObject mFunctionUnit
The actual function unit object defined by mFunction // TODO: Jamomacore #294 : Ease the access of th...
#define addAttribute(name, type)
A convenience macro to be used by subclasses for registering attributes with a custom getter...
void copyFrom(const TTValue &obj, TTUInt16 index)
Copy a value starting from an index until the last element.
friend void TTMODULAR_EXPORT TTRampDriveCallback(TTPtr object, TTFloat64 position, TTFloat64 date)
< It is public in order to be able to extend clock or function unit parameters as attributes of anoth...
Create and use Jamoma object instances.
size_type size() const noexcept
Return the number of elements.
static TTErr GetRegisteredClassNamesForTags(TTValue &classNames, const TTValue &searchTags)
Query TTEnvironment for names of all registered TTObjectBase classes that share specific tags...
This class represents a single attribute, as used by the TTObjectBase class.
double TTFloat64
64 bit floating point number
This is a special type used by TTAttribute to indicate that a value is a TTValue and is locally maint...
void append(const T &anElementValueToAppend)
Insert a single TTElement at the end.
void * TTPtr
A generic pointer.
TTErr get(const TTSymbol aName, T &aReturnedValue) const
Get an attribute value for an object.
TTAudioObjectBase * TTAudioObjectBasePtr
Pointer to a TTAudioObjectBase.
TTErr set(const TTSymbol aName, T aValue)
Set an attribute value for an object.
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
TTErr Stop()
Stop the current ramp.
#define addMessageWithArguments(name)
A convenience macro to be used by subclasses for registering messages.
void clear()
Clear all values from the vector, leaving with size of 0.
Something went wrong, but what exactly is not known. Typically used for context-specific problems...
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
void attributes(TTValue &returnedAttributeNames) const
Return a list of names of the available attributes.
std::uint32_t TTUInt32
32 bit unsigned integer
TTErr sethidden(const TTValue &newHiddenFlag)
Set the hidden flag for the attribute, determining if this attribute is private/invisible to the outs...
#define addAttributeWithSetter(name, type)
A convenience macro to be used by subclasses for registering attributes with a custom setter...
#define addMessage(name)
A convenience macro to be used by subclasses for registering messages.
TTObjectBase * instance() const
Return a direct pointer to the internal instance.
TTBoolean valid() const
Determine if the object contained by this TTObject is truly ready for use.
TTErr(TTObjectBase::* TTGetterMethod)(const TTAttribute &attribute, TTValue &value)
A type that can be used to store a pointer to a message for an object.
[doxygenAppendixC_copyExample]
TTObject mDriveUnit
< It is public in order to be able to extend clock or function unit parameters as attributes of anoth...