Jamoma API  0.6.0.a19
Modular/library/includes/TTRamp.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularLibrary
4  *
5  * @brief #TTRamp class embedes a scheduling mechanism from #TTDrive and a function from #TTFunction
6  *
7  * @details
8  *
9  * @authors Tim Place, Théo de la Hogue
10  *
11  * @copyright © 2008, Tim Place, Théo de la Hogue @n
12  * This code is licensed under the terms of the "New BSD License" @n
13  * http://creativecommons.org/licenses/BSD/
14  */
15 
16 
17 #ifndef __TT_RAMP_H__
18 #define __TT_RAMP_H__
19 
20 #include "TTModularIncludes.h"
21 #include "TTClock.h"
22 
23 typedef void (*TTRampCallback)(void *, TTUInt32, TTFloat64 *);
24 
25 /****************************************************************************************************/
26 // Class Specification
27 
28 
29 // Specification of our base class
30 class TTMODULAR_EXPORT TTRamp : public TTObjectBase {
31 
33 
34 public: ///< It is public in order to be able to extend clock or function unit parameters as attributes of another object
35 
36  TTObject mDriveUnit; ///< The actual clock unit object defined by mDrive // TODO: Jamomacore #294 : Ease the access of the object of a kTypeObject attribute of a TTObject
37 #ifndef TT_NO_DSP
38  TTObject mFunctionUnit; ///< The actual function unit object defined by mFunction // TODO: Jamomacore #294 : Ease the access of the object of a kTypeObject attribute of a TTObject
39 #endif
40 
41 private:
42 
43  TTSymbol mDrive; ///< ATTRIBUTE : The name of the clock to drive the ramp
44 #ifndef TT_NO_DSP
45  TTSymbol mFunction; ///< ATTRIBUTE : The name of the function unit
46 #endif
47  TTFloat64 mRampTime; ///< ATTRIBUTE : The time of ramp in millisecond
48  TTUInt32 mNumValues;
49 
50  TTRampCallback mCallback; ///<
51  TTPtr mBaton; ///<
52 
53  TTFloat64 *startValue;
54  TTFloat64 *targetValue;
55  TTFloat64 *currentValue;
56 
57  /** Attribute getter */
58  TTErr getRunning(TTValue& value);
59 
60  /** Attribute setter */
61  // TODO: Jamomacore #294 : Ease the access of the object of a kTypeObject attribute of a TTObject
62  TTErr setDrive(const TTValue& clockName);
63  TTErr getDriveLibrary(TTValue& value);
64  TTErr getDriveParameters(TTValue& value);
65  TTErr getDriveParameterValue(TTValue& value);
66  TTErr setDriveParameterValue(const TTValue& value);
67 
68 #ifndef TT_NO_DSP
69  // TODO: Jamomacore #294 : Ease the access of the object of a kTypeObject attribute of a TTObject
70  TTErr setFunction(const TTValue& functionName);
71  TTErr getFunctionLibrary(TTValue& value);
72  TTErr getFunctionParameters(TTValue& value);
73  TTErr getFunctionParameterValue(TTValue& value);
74  TTErr setFunctionParameterValue(const TTValue& value);
75 #endif
76  TTErr setNumValues(const TTValue& inputValue);
77 
78  /** Message */
79  TTErr Set(const TTValue& inputValue, TTValue& outputValue);
80 
81  TTErr Target(const TTValue& inputValue, TTValue& outputValue);
82 
83  TTErr Go(const TTValue& inputValue, TTValue& outputValue);
84 
85  TTErr Slide(const TTValue& inputValue, TTValue& outputValue);
86 
87  TTErr Tick();
88 
89  TTErr Stop();
90 
91 public: ///< It is public in order to be able to extend clock or function unit parameters as attributes of another object
92 
93 
94 
95 #ifndef TT_NO_DSP
96 
97 #endif
98  friend void TTMODULAR_EXPORT TTRampDriveCallback(TTPtr object, TTFloat64 position, TTFloat64 date);
99 };
100 typedef TTRamp* TTRampPtr;
101 
102 /**
103  @param baton ..
104  @param data ..
105  @return an error code */
106 void TTMODULAR_EXPORT TTRampDriveCallback(TTPtr object, TTFloat64 position, TTFloat64 date);
107 
108 #endif // __TT_RAMP_H__
TTModular Library.
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...
Create and use Jamoma object instances.
Definition: TTObject.h:29
Base class for all first-class Jamoma objects.
Definition: TTObjectBase.h:109
double TTFloat64
64 bit floating point number
Definition: TTBase.h:188
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
void * TTPtr
A generic pointer.
Definition: TTBase.h:248
void TTMODULAR_EXPORT TTRampDriveCallback(TTPtr object, TTFloat64 position, TTFloat64 date)
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
Definition: TTSymbol.h:26
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
Definition: TTBase.h:342
std::uint32_t TTUInt32
32 bit unsigned integer
Definition: TTBase.h:178
A Clock interface.
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34