Jamoma API  0.6.0.a19
TTCueManager.h
Go to the documentation of this file.
1 /** @file
2  *
3  * @ingroup modularLibrary
4  *
5  * @brief A CueManager 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_CUE_MANAGER_H__
18 #define __TT_CUE_MANAGER_H__
19 
20 #include "TTModularIncludes.h"
21 
22 /** TTCueManager ... TODO : an explanation
23 
24 
25  */
26 
27 class TTCue;
28 typedef TTCue* TTCuePtr;
29 
30 class TTXmlHandler;
32 
33 // a namespace is a TTList
34 typedef TTList* NamespacePtr;
35 
36 class TTMODULAR_EXPORT TTCueManager : public TTObjectBase
37 {
38  TTCLASS_SETUP(TTCueManager)
39 
40 private:
41 
42  TTValue mNames; ///< ATTRIBUTE : cues are ordered by name
43  TTSymbol mCurrent; ///< ATTRIBUTE : the current cue name
44  TTUInt32 mCurrentPosition; ///< ATTRIBUTE : the current cue position
45  TTSymbol mNamespace; ///< ATTRIBUTE : the name of the namespace selection to use
46  TTAddress mAddress; ///< ATTRIBUTE : an address to make the mangment relative to
47  TTHash mCues; ///< ATTRIBUTE : a hash table containing <name, #TTCue>
48 
49  TTObject mCurrentCue; ///< the current cue
50  TTAddressItemPtr mDefaultNamespace; ///< an internal default namespace
51 
52  TTObject mReturnLineCallback; ///< Callback to return back cue lines to the owner of this cuemanager
53 
54  TTSymbol mLastCurrent; ///< ATTRIBUTE : remember the current cue when parsing a file
55 
56  /** */
57  TTErr getCues(TTValue& value);
58 
59  /** */
60  TTErr getCurrentDescription(TTValue& value);
61  TTErr setCurrentDescription(const TTValue& value);
62 
63  /** */
64  TTErr getCurrentRamp(TTValue& value);
65  TTErr setCurrentRamp(const TTValue& value);
66 
67  /** */
68  TTErr setAddress(const TTValue& value);
69 
70  /** Select a set of absolute addresses
71  @param inputValue a set of absolute addresses
72  @param outputValue nothing
73  @return kTTErrNone */
74  TTErr NamespaceSelect(const TTValue& inputValue, TTValue& outputValue);
75 
76  /** Unselect a set of absolute addresses
77  @param inputValue a set of absolute addresses
78  @param outputValue nothing
79  @return kTTErrNone */
80  TTErr NamespaceUnselect(const TTValue& inputValue, TTValue& outputValue);
81 
82  /** Select only the addresses which are in a cue
83  @param inputValue name of a cue or nothing (use the current cue)
84  @param outputValue nothing
85  @return kTTErrNone */
86  TTErr NamespaceGrab(const TTValue& inputValue, TTValue& outputValue);
87 
88  /** */
89  TTErr Clear();
90 
91  /** New a cue :
92  name/id : create a new cue.
93  nothing : store into the current cue */
94  TTErr New(const TTValue& inputValue, TTValue& outputValue);
95 
96  /** Update a cue :
97  name/id : update an existing cue.
98  nothing : update the current cue */
99  TTErr Update(const TTValue& inputValue, TTValue& outputValue);
100 
101  /** Append a line to a cue :
102  name/id line : append line to the cue */
103  TTErr Append(const TTValue& inputValue, TTValue& outputValue);
104 
105  /** Recall a cue :
106  name/id : recall the cue.
107  nothing : recall the current cue */
108  TTErr Recall(const TTValue& inputValue, TTValue& outputValue);
109 
110  /** Output a cue using the mReturnLineCallback :
111  name/id : output the cue.
112  nothing : output the current cue */
113  TTErr Output(const TTValue& inputValue, TTValue& outputValue);
114 
115  /** Interpolate 2 cues :
116  name1, name2, position : interpolate between the 2 given cues
117  TODO : name1, position : interpolate between the current cue and the given cue */
118  TTErr Interpolate(const TTValue& inputValue, TTValue& outputValue);
119 
120  /** Mix several cues :
121  name1, factor1, name2, factor2, ... : mix each given cues */
122  TTErr Mix(const TTValue& inputValue, TTValue& outputValue);
123 
124  /** Move a cue :
125  name + position : move the cue to the given position. */
126  TTErr Move(const TTValue& inputValue, TTValue& outputValue);
127 
128  /** Delete a cue :
129  name : remove the cue.
130  nothing : remove the current cue */
131  TTErr Delete(const TTValue& inputValue, TTValue& outputValue);
132 
133  /** Reorder the list */
134  TTErr Order(const TTValue& inputValue, TTValue& outputValue);
135 
136  /** Rename a cue :
137  name + newName: rename the cue with the newName */
138  TTErr Rename(const TTValue& inputValue, TTValue& outputValue);
139 
140  /** Copy a cue :
141  name : copy the cue (and optionally give a new name + a position) */
142  TTErr Copy(const TTValue& inputValue, TTValue& outputValue);
143 
144  /** Optimize a sub set of cues clearing redundant command lines :
145  name1, name2, name3, ... : make the optimization between all given cues. */
146  TTErr Optimize(const TTValue& inputValue, TTValue& outputValue);
147 
148  /** needed to be handled by a TTXmlHandler */
149  TTErr WriteAsXml(const TTValue& inputValue, TTValue& outputValue);
150  TTErr ReadFromXml(const TTValue& inputValue, TTValue& outputValue);
151 
152  /** needed to be handled by a TTTextHandler */
153  TTErr WriteAsText(const TTValue& inputValue, TTValue& outputValue);
154  TTErr ReadFromText(const TTValue& inputValue, TTValue& outputValue);
155 
156  /** */
157  TTErr notifyNamesObservers();
158 
159  /** */
160  TTAddressItemPtr getNamespace();
161 };
162 
163 typedef TTCueManager* TTCueManagerPtr;
164 
165 #endif // __TT_CUE_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
std::uint32_t TTUInt32
32 bit unsigned integer
Definition: TTBase.h:178
TTCue ...
Definition: TTCue.h:30
Write / Read mecanism.
Definition: TTXmlHandler.h:48
[doxygenAppendixC_copyExample]
Definition: TTValue.h:34