19 #define thisTTClass TTCue
20 #define thisTTClassName "Cue"
21 #define thisTTClassTags "cue"
23 TT_MODULAR_CONSTRUCTOR,
25 mDescription(
"something about this cue"),
54 mScript =
TTObject(kTTSym_Script, arguments);
68 mScript.
get(kTTSym_lines, v);
69 lines = TTListPtr((
TTPtr)v[0]);
72 for (lines->begin(); lines->end(); lines->next()) {
78 aLine->
lookup(kTTSym_name, v);
100 mScript.
get(kTTSym_lines, v);
101 lines = TTListPtr((
TTPtr)v[0]);
104 for (lines->begin(); lines->end(); lines->next()) {
110 aLine->
lookup(kTTSym_name, v);
132 mScript.
get(kTTSym_lines, v);
133 lines = TTListPtr((
TTPtr)v[0]);
136 for (lines->begin(); lines->end(); lines->next()) {
142 aLine->
lookup(kTTSym_name, v);
145 if (name == kTTSym_description) {
153 mDescription = value[0];
165 mScript.
get(kTTSym_lines, v);
166 lines = TTListPtr((
TTPtr)v[0]);
169 for (lines->begin(); lines->end(); lines->next()) {
175 aLine->
lookup(kTTSym_name, v);
178 if (name == kTTSym_description) {
180 mDescription = value;
191 searchRamp(mScript, mRamp);
205 aScript.
get(kTTSym_lines, v);
206 lines = TTListPtr((
TTPtr)v[0]);
209 for (lines->begin(); lines->end(); lines->next()) {
213 if (aLine->
getSchema() == kTTSym_command) {
216 if (!aLine->
lookup(kTTSym_ramp, v)) {
222 else if (aLine->
getSchema() == kTTSym_script) {
228 if (aSubScript.
valid())
229 searchRamp(aSubScript, ramp);
244 mScript.
get(kTTSym_flattened, v);
248 mScript.
send(kTTSym_Flatten, kTTAdrsRoot);
251 return processRamp(mScript, mRamp);
267 aScript.
get(
"flattenedLines", v);
268 lines = TTListPtr((
TTPtr)v[0]);
271 for (lines->begin(); lines->end(); lines->next()) {
276 if (!aLine->
lookup(kTTSym_target, v)) {
285 if (anObject.
valid()) {
287 if (anObject.
name() == kTTSym_Data) {
289 anObject.
get(kTTSym_rampDrive, v);
292 if (rampDrive != kTTSym_none) {
296 aLine->
append(kTTSym_ramp, r);
298 aLine->
remove(kTTSym_ramp);
311 TTAddressItemPtr aSelection = NULL;
316 if (inputValue.
size() == 1) {
319 aSelection = TTAddressItemPtr((
TTPtr)inputValue[0]);
322 name = inputValue[0];
334 mScript.
send(
"AppendFlag", v, parsedLine);
339 mScript.
send(
"AppendFlag", v, parsedLine);
343 mScript.
send(
"AppendComment", v, parsedLine);
347 if (mAddress != kTTAdrsRoot)
348 if (aSelection->find(mAddress, & aSelection))
353 processStore(mScript, aSelection, aNode);
357 mScript.
send(
"AppendComment", v, parsedLine);
361 mScript.
send(
"AppendComment", v, parsedLine);
364 if (mRamp) setRamp(mRamp);
368 mScript.
send(
"Flatten");
379 if (aSelection->isEmpty())
382 TTAddressItemPtr nameItem, instanceItem;
387 TTList aNodeList, childrenNodes;
388 TTListPtr instanceOptions;
389 TTAddress scriptAddress, childAddress, address;
395 scriptNode = nodeToProcess;
404 for (aSelection->begin(); aSelection->end(); aSelection->next()) {
406 nameItem = aSelection->current();
409 if (scriptAddress == kTTAdrsRoot) {
414 if (nameItem->getSize() == 1) {
421 scriptNode = aDirectory->
getRoot();
425 instanceItem = nameItem->current();
428 nameInstance = nameItem->getSymbol().
c_str();
433 aLine = TTScriptParseScript(v);
440 err = processStore(aSubScript, instanceItem, scriptNode);
446 aScript.
send(
"AppendComment", none, parsedLine);
447 aScript.
send(
"AppendComment", none, parsedLine);
451 aScript.
send(
"Append", v, parsedLine);
464 for (nameItem->begin(); nameItem->end(); nameItem->next()) {
466 instanceItem = nameItem->current();
468 if (!instanceItem->getSelection())
472 scriptNode->
getChildren(nameItem->getSymbol(), instanceItem->getSymbol(), childrenNodes);
474 for (childrenNodes.begin(); childrenNodes.end(); childrenNodes.next()) {
482 nameInstance += C_INSTANCE;
490 if (anObject.
valid()) {
493 if (anObject.
name() == kTTSym_Data)
496 anObject.
get(kTTSym_service, v);
499 if (service == kTTSym_parameter)
502 instanceOptions = instanceItem->getOptions();
504 for (instanceOptions->begin(); instanceOptions->end(); instanceOptions->next())
506 option = instanceOptions->current()[0];
508 if (option == kTTSymEmpty)
509 option = kTTSym_value;
512 anObject.
get(option, v);
517 if (option == kTTSym_value)
524 aScript.
send(
"AppendCommand", v, parsedLine);
537 aLine = TTScriptParseScript(v);
544 err = processStore(aSubScript, instanceItem, aNode);
549 if (anObject.
valid())
552 if (anObject.
name() == kTTSym_Container)
553 aScript.
send(
"AppendComment", none, parsedLine);
558 aScript.
send(
"Append", v, parsedLine);
566 instanceItem->setSelection(NO);
586 mScript.
get(kTTSym_flattened, v);
590 mScript.
send(kTTSym_Flatten, kTTAdrsRoot);
592 return processUpdate(mScript);
606 aScript.
get(
"flattenedLines", v);
607 lines = TTListPtr((
TTPtr)v[0]);
610 for (lines->begin(); lines->end(); lines->next()) {
615 if (!aLine->
lookup(kTTSym_target, v)) {
624 if (anObject.
valid()) {
626 if (anObject.
name() == kTTSym_Data) {
629 anObject.
get(kTTSym_service, v);
633 if (service == kTTSym_parameter) {
636 err = anObject.
get(kTTSym_value, v);
641 aLine->
remove(kTTSym_value);
642 aLine->
append(kTTSym_value, v);
656 return mScript.
send(
"Append", inputValue, outputValue);
661 return mScript.
send(
"Clear");
670 if (inputValue.
size() == 1)
673 anAddress = inputValue[0];
680 mScript.
get(kTTSym_flattened, v);
684 mScript.
send(kTTSym_Flatten, mAddress);
687 if (anAddress != kTTAdrsRoot)
688 return mScript.
send(
"RunCommand", anAddress);
692 return mScript.
send(kTTSym_Run, inputValue);
701 if (inputValue.
size() == 1)
704 anAddress = inputValue[0];
711 mScript.
get(kTTSym_flattened, v);
715 mScript.
send(kTTSym_Flatten, mAddress);
718 if (anAddress != kTTAdrsRoot)
719 return mScript.
send(
"DumpLine", anAddress);
723 return mScript.
send(kTTSym_Dump, inputValue);
728 TTAddressItemPtr aSelection = NULL;
731 if (inputValue.
size() == 1) {
734 aSelection = TTAddressItemPtr((
TTPtr)inputValue[0]);
737 name = inputValue[0];
745 aSelection->setSelection(NO, YES);
748 return processSelect(mScript, aSelection);
754 TTErr TTCue::processSelect(
TTObject aScript, TTAddressItemPtr aSelection)
757 TTAddressItemPtr anItem;
764 aScript.
get(kTTSym_lines, v);
765 lines = TTListPtr((
TTPtr)v[0]);
768 for (lines->begin(); lines->end(); lines->next()) {
775 aLine->
lookup(kTTSym_address, v);
779 err = aSelection->find(address, &anItem);
784 anItem->setSelection(YES);
787 if (aLine->
getSchema() == kTTSym_script) {
793 if (aSubScript.
valid())
794 processSelect(aSubScript, anItem);
837 mScript.
send(
"AppendFlag", v, parsedLine);
853 TTTextHandlerPtr aTextHandler = (TTTextHandlerPtr)o.
instance();
871 mScript.
send(
"Flatten");
875 aTextHandler->setAttributeValue(kTTSym_object, v);
876 aTextHandler->sendMessage(
TTSymbol(
"Write"));
884 TTTextHandlerPtr aTextHandler = (TTTextHandlerPtr)o.
instance();
892 if (aTextHandler->mFirstLine)
895 if (aTextHandler->mLine->size() == 0)
899 if ((*(aTextHandler->mLine))[0].type() !=
kTypePointer) {
901 line = TTScriptParseLine(*(aTextHandler->mLine));
914 line->
lookup(kTTSym_name, v);
917 if (flagName ==
TTSymbol(
"description")) {
929 aTextHandler->setAttributeValue(kTTSym_object, v);
930 aTextHandler->sendMessage(
TTSymbol(
"Read"));
934 if (aTextHandler->mLastLine)
935 mScript.
send(
"Flatten");
942 #pragma mark Some Methods
975 for (i = 0; i < cues.
size(); i++) {
989 return TTScriptMix(scripts, factors);
TTErr sendMessage(const TTSymbol name)
TODO: Document this function.
TTAddress appendAddress(const TTAddress &toAppend)
Return a new TTAddress with the appended part.
bool TTBoolean
Boolean flag, same as Boolean on the Mac.
#define accessApplicationDirectoryFrom(anAddress)
Access to an application directory using an address.
TTDictionaryBase * TTDictionaryBasePtr
Pointer to a TTDictionary.
TTErr send(const TTSymbol aName)
Send a message to this object with no arguments.
TTAddress appendAttribute(TTSymbol anAttribute)
Return a new TTAddress with attribute part.
TTSymbol & getName()
Get the name of the node.
#define addAttribute(name, type)
A convenience macro to be used by subclasses for registering attributes with a custom getter...
We build a directory of TTNodes, and you can request a pointer for any TTNode, or add an observer to ...
A type that contains a key and a value.
TTSymbol getName() const
Return the name of this class.
const char * c_str() const
Return a pointer to the internal C-string.
TTErr setValue(const TTValue &newValue)
TODO: Add documentation.
TTNodePtr getRoot()
Get the root of the TTNodeDirectory.
The TTAddress class is used to represent a string and efficiently pass and compare that string...
Create and use Jamoma object instances.
TTObject & getObject()
Get the object binded by this node.
size_type size() const noexcept
Return the number of elements.
TTAddressItemPtr TTMODULAR_EXPORT TTModularSelectionLookup(const TTSymbol selectionName)
Get a selection or create one if it doesn't exist yet.
this flag means that an address have no leading slash
const TTSymbol getSchema() const
TODO: Add documentation.
TTErr setAttributeValue(const TTSymbol name, TTValue &value)
Set an attribute value for an object.
double TTFloat64
64 bit floating point number
void prepend(const TTValue &aValueToPrepend)
Insert another TTValue before the first element.
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.
TTSymbol name() const
Return the name of this class.
TTSymbol & getInstance()
Get the instance of the node.
The TTSymbol class is used to represent a string and efficiently pass and compare that string...
TTBoolean mXmlNodeStart
true if the Reader starts to read a Node
#define accessApplicationDirectory(applicationName)
Access to an application directory by name.
#define addMessageWithArguments(name)
A convenience macro to be used by subclasses for registering messages.
TTErr lookup(const TTSymbol key, TTValue &value) const
Find the value for the given key.
const char * c_str() const
Return a pointer to the internal string as a C-string.
void clear()
Clear all values from the vector, leaving with size of 0.
TTErr getAddress(TTAddress &returnedAddress, TTAddress from=kTTAdrsEmpty)
Get the address of the node.
Something went wrong, but what exactly is not known. Typically used for context-specific problems...
TTAddressType getType()
Get the type.
TTErr
Jamoma Error Codes Enumeration of error codes that might be returned by any of the TTBlue functions a...
TTErr append(const TTSymbol key, const TTValue &value)
Insert an item into the hash table.
TTSymbol mXmlNodeName
the Node name being read by the Reader
std::uint32_t TTUInt32
32 bit unsigned integer
TTErr get(const TTSymbol aName, T &aReturnedValue)
Get an attribute value for an object This is the same as calling getAttributeValue().
TTErr remove(const TTSymbol key)
Remove an item from the hash table.
#define addMessage(name)
A convenience macro to be used by subclasses for registering messages.
TTErr getChildren(TTSymbol &name, TTSymbol &instance, TTList &returnedChildren)
Get a linklist of children of the node : select them by name and instance (use wilcards to select the...
32-bit unsigned integer, range is 0 through 4,294,967,295.
TTObjectBase * instance() const
Return a direct pointer to the internal instance.
The TTString class is used to represent a string.
TTBoolean valid() const
Determine if the object contained by this TTObject is truly ready for use.
We build a tree of TTNodes, and you can request a pointer for any TTNode, or add an observer to any T...
[doxygenAppendixC_copyExample]
TTErr getValue(TTValue &returnedValue) const
TODO: Add documentation.
#define addAttributeWithGetterAndSetter(name, type)
A convenience macro to be used by subclasses for registering attributes with a custom getter and sett...
#define addMessageProperty(messageName, propertyName, initialValue)
A convenience macro to be used for registering properties of messages.