TTErr TTScoreTimeProcessCreate(TTTimeProcessPtr *timeProcess, const std::string timeProcessClass, TTTimeEventPtr startEvent, TTTimeEventPtr endEvent, TTTimeContainerPtr timeContainer) { TTValue args; *timeProcess = NULL; if (timeContainer) { TTValue out; TTErr err; args = TTSymbol(timeProcessClass); args.append(TTObjectBasePtr(startEvent)); args.append(TTObjectBasePtr(endEvent)); err = timeContainer->sendMessage(TTSymbol("TimeProcessCreate"), args, out); if (!err) *timeProcess = TTTimeProcessPtr(TTObjectBasePtr(out[0])); return err; } else { args = TTObjectBasePtr(startEvent); args.append(TTObjectBasePtr(endEvent)); return TTObjectBaseInstantiate(timeProcessClass.c_str(), TTObjectBaseHandle(timeProcess), args); } }
TTErr TTScoreTimeEventRelease(TTTimeEventPtr *timeEvent, TTTimeContainerPtr timeContainer) { if (timeContainer) { TTValue none; return timeContainer->sendMessage(TTSymbol("TimeEventRelease"), TTObjectBasePtr(*timeEvent), none); } else return TTObjectBaseRelease(TTObjectBaseHandle(timeEvent)); }
OSCSenderManager::~OSCSenderManager() { TTValue keys, v; TTSymbol key; TTObjectBasePtr anObject; mSenders->getKeys(keys); for (TTUInt8 i = 0; i < keys.size(); i++) { key = keys[i]; mSenders->lookup(key, v); anObject = v[0]; TTObjectBaseRelease(TTObjectBaseHandle(&anObject)); } delete mSenders; }
TTErr TTScoreTimeEventCreate(TTTimeEventPtr *timeEvent, TTUInt32 date, TTTimeContainerPtr timeContainer) { *timeEvent = NULL; if (timeContainer) { TTErr err; TTValue out; err = timeContainer->sendMessage(TTSymbol("TimeEventCreate"), date, out); if (!err) *timeEvent = TTTimeEventPtr(TTObjectBasePtr(out[0])); return err; } else return TTObjectBaseInstantiate(kTTSym_TimeEvent, TTObjectBaseHandle(timeEvent), TTValue(date)); }
TTErr TTScoreTimeProcessRelease(TTTimeProcessPtr *timeProcess, TTTimeContainerPtr timeContainer, TTTimeEventPtr *startEvent, TTTimeEventPtr *endEvent) { if (timeContainer) { TTValue out; TTErr err; err = timeContainer->sendMessage(TTSymbol("TimeProcessRelease"), TTObjectBasePtr(*timeProcess), out); if (!err && *startEvent && *endEvent) { *startEvent = TTTimeEventPtr(TTObjectBasePtr(out[0])); *endEvent = TTTimeEventPtr(TTObjectBasePtr(out[1])); } return err; } else return TTObjectBaseRelease(TTObjectBaseHandle(timeProcess)); }