Jamoma API  0.6.0.a19
TTPreset.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularLibrary
4  *
5  * @brief A Preset Object
6  *
7  * @details
8  *
9  * @authors Théo de la Hogue
10  *
11  * @copyright © 2010, 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_PRESET_H__
18 #define __TT_PRESET_H__
19 
20 #include "TTModularIncludes.h"
21 
22 class TTScript;
23 typedef TTScript* TTScriptPtr;
24 
25 /** TTPreset ... TODO : an explanation
26 
27 
28  */
29 
30 class TTMODULAR_EXPORT TTPreset : public TTObjectBase
31 {
33 
34 private :
35 
36  TTSymbol mName; ///< ATTRIBUTE : the name of the preset
37  TTSymbol mDescription; ///< ATTRIBUTE : the description of the preset
38  TTAddress mAddress; ///< ATTRIBUTE : the parent address from where to search object to store
39 
40  TTNodeDirectoryPtr mDirectory; ///< a preset depends on a directory
41  TTObject mScript; ///< a script containing relativeAddress and value
42 
43  /** */
44  TTErr setAddress(const TTValue& value);
45 
46  /** */
47  TTErr Clear();
48 
49  /** */
50  TTErr Store();
51 
52  /** Update the whole preset */
53  TTErr Update();
54 
55  /** */
56  TTErr Recall(const TTValue& inputValue, TTValue& outputValue);
57 
58  /** Output the preset from an address (default : kAdrsRoot to output all the preset) */
59  TTErr Output(const TTValue& inputValue, TTValue& outputValue);
60 
61  /** needed to be handled by a TTXmlHandler */
62  TTErr WriteAsXml(const TTValue& inputValue, TTValue& outputValue);
63  TTErr ReadFromXml(const TTValue& inputValue, TTValue& outputValue);
64 
65  /** needed to be handled by a TTTextHandler */
66  TTErr WriteAsText(const TTValue& inputValue, TTValue& outputValue);
67  TTErr ReadFromText(const TTValue& inputValue, TTValue& outputValue);
68 
69  /** a method to update each Data value */
70  TTErr processUpdate(TTObject& aScript);
71 
72  friend TTErr TTMODULAR_EXPORT TTPresetInterpolate(TTObject preset1, TTObject preset2, TTFloat64 position);
73  friend TTErr TTMODULAR_EXPORT TTPresetMix(const TTValue& presets, const TTValue& factors);
74  friend TTErr TTMODULAR_EXPORT TTPresetCopy(TTObject aPresetToCopy, TTObject aPresetCopy);
75 };
76 
77 typedef TTPreset* TTPresetPtr;
78 
79 /** Return Yes if the node have to be part of the preset */
80 TTBoolean TTMODULAR_EXPORT TTPresetTestObject(TTNodePtr node, TTPtr args);
81 
82 TTErr TTMODULAR_EXPORT TTPresetInterpolate(TTObject preset1, TTObject preset2, TTFloat64 position);
83 
84 TTErr TTMODULAR_EXPORT TTPresetMix(const TTValue& presets, const TTValue& factors);
85 
86 TTErr TTMODULAR_EXPORT TTPresetCopy(TTObject aPresetToCopy, TTObject aPresetCopy);
87 
88 #endif // __TT_PRESET_H__
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
Definition: TTBase.h:167
TTModular Library.
We build a directory of TTNodes, and you can request a pointer for any TTNode, or add an observer to ...
Definition: TTNode.h:59
The TTAddress class is used to represent a string and efficiently pass and compare that string...
Definition: TTAddress.h:29
Create and use Jamoma object instances.
Definition: TTObject.h:29
About line schemas :
Definition: TTScript.h:40
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
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
TTPreset ...
Definition: TTPreset.h:30
We build a tree of TTNodes, and you can request a pointer for any TTNode, or add an observer to any T...
TTBoolean TTMODULAR_EXPORT TTPresetTestObject(TTNodePtr node, TTPtr args)
Return Yes if the node have to be part of the preset.
Definition: TTPreset.cpp:414
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34