Jamoma API  0.6.0.a19
TTPresetManager.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularLibrary
4  *
5  * @brief A PresetManager 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_MANAGER_H__
18 #define __TT_PRESET_MANAGER_H__
19 
20 #include "TTModularIncludes.h"
21 
22 /** TTPresetManager ... TODO : an explanation
23 
24 
25  */
26 
27 class TTPreset;
28 typedef TTPreset* TTPresetPtr;
29 
30 class TTXmlHandler;
32 
33 class TTMODULAR_EXPORT TTPresetManager : public TTObjectBase
34 {
35  TTCLASS_SETUP(TTPresetManager)
36 
37 private:
38 
39  TTAddress mAddress; ///< ATTRIBUTE : the container address to manage
40  TTValue mNames; ///< ATTRIBUTE : presets are ordered by name
41  TTSymbol mCurrent; ///< ATTRIBUTE : the current preset name
42  TTUInt32 mCurrentPosition; ///< ATTRIBUTE : the current cue position
43 
44  TTHash mPresets; ///< a hash table containing <name, TTPresetPtr>
45  TTObject mCurrentPreset; ///< the current preset
46 
47  TTObject mReturnLineCallback; ///< Callback to return back cue lines to the owner of this presetmanager
48 
49  /** */
50  TTErr getPresets(TTValue& value);
51 
52  /** */
53  TTErr setAddress(const TTValue& value);
54 
55  /** */
56  TTErr getValue(TTValue& value);
57 
58  /** */
59  TTErr setValue(const TTValue& value);
60 
61  /** */
62  TTErr Clear();
63 
64  /** */
65  TTErr New(const TTValue& inputValue, TTValue& outputValue);
66 
67  /** */
68  TTErr Update(const TTValue& inputValue, TTValue& outputValue);
69 
70  /** */
71  TTErr Recall(const TTValue& inputValue, TTValue& outputValue);
72 
73  /** Output a preset using the mReturnLineCallback :
74  name/id : output the preset.
75  nothing : output the current preset */
76  TTErr Output(const TTValue& inputValue, TTValue& outputValue);
77 
78  /** */
79  TTErr Interpolate(const TTValue& inputValue, TTValue& outputValue);
80 
81  /** */
82  TTErr Mix(const TTValue& inputValue, TTValue& outputValue);
83 
84  /** Move a preset :
85  name + position : move the preset to the given position. */
86  TTErr Move(const TTValue& inputValue, TTValue& outputValue);
87 
88  /** */
89  TTErr Delete(const TTValue& inputValue, TTValue& outputValue);
90 
91  /** Reorder the preset list*/
92  TTErr Order(const TTValue& inputValue, TTValue& outputValue);
93 
94  /** Rename a preset :
95  name + newName: rename the preset with the newName */
96  TTErr Rename(const TTValue& inputValue, TTValue& outputValue);
97 
98  /** Copy a preset :
99  name : copy the preset (and optionally give a new name + a position) */
100  TTErr Copy(const TTValue& inputValue, TTValue& outputValue);
101 
102  /** needed to be handled by a TTXmlHandler */
103  TTErr WriteAsXml(const TTValue& inputValue, TTValue& outputValue);
104  TTErr ReadFromXml(const TTValue& inputValue, TTValue& outputValue);
105 
106  /** needed to be handled by a TTTextHandler */
107  TTErr WriteAsText(const TTValue& inputValue, TTValue& outputValue);
108  TTErr ReadFromText(const TTValue& inputValue, TTValue& outputValue);
109 
110  /** */
111  TTErr notifyValueObservers();
112 
113  /** */
114  TTErr notifyNamesObservers();
115 };
116 
117 typedef TTPresetManager* TTPresetManagerPtr;
118 
119 #endif // __TT_PRESET_MANAGER_H__
TTModular Library.
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
Base class for all first-class Jamoma objects.
Definition: TTObjectBase.h:109
Maintain a collection of TTValue objects indexed by TTSymbol pointers.
Definition: TTHash.h:36
#define TTCLASS_SETUP(className)
TODO Doxygen: need more comments here.
Definition: TTFoundation.h:54
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
std::uint32_t TTUInt32
32 bit unsigned integer
Definition: TTBase.h:178
Write / Read mecanism.
Definition: TTXmlHandler.h:48
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34