本文整理汇总了C++中TTObject::valid方法的典型用法代码示例。如果您正苦于以下问题:C++ TTObject::valid方法的具体用法?C++ TTObject::valid怎么用?C++ TTObject::valid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTObject
的用法示例。
在下文中一共展示了TTObject::valid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: data_new_address
void data_new_address(TTPtr self, t_symbol *relativeAddress)
{
WrappedModularInstancePtr x = (WrappedModularInstancePtr)self;
long argc = 0;
t_atom *argv = NULL;
TTUInt32 number;
TTUInt32 i;
TTAddress newAddress = relativeAddress->s_name;
TTAddress returnedAddress;
TTNodePtr returnedNode = NULL;
TTNodePtr returnedContextNode = NULL;
t_symbol *instanceAddress;
TTObject anObject;
TTObject aSubscriber;
TTValue v;
x->useInternals = YES;
x->internals->clear();
x->internals->setThreadProtection(YES);
x->cursor = kTTSymEmpty;
x->arrayAddress = newAddress;
if (x->arrayAddress.getType() == kAddressRelative) {
number = jamoma_parse_bracket(relativeAddress, x->arrayFormatInteger, x->arrayFormatString);
// don't resize to 0
if (number && number <= MAX_ARRAY_SIZE) {
// Starts iteration on internals
x->iterateInternals = YES;
x->arraySize = number;
EXTRA->objectsSorted->clear();
for (i = 1; i <= x->arraySize; i++) {
jamoma_edit_numeric_instance(x->arrayFormatInteger, &instanceAddress, i);
// create a data
#ifdef JMOD_MESSAGE
data_array_create(self, anObject, kTTSym_message, i);
#endif
#if JMOD_RETURN
data_array_create(self, anObject, kTTSym_return, i);
#endif
#ifndef JMOD_MESSAGE
#ifndef JMOD_RETURN
data_array_create(self, anObject, kTTSym_parameter, i);
#endif
#endif
if (!jamoma_subscriber_create((t_object*)x, anObject, TTAddress(instanceAddress->s_name), aSubscriber, returnedAddress, &returnedNode, &returnedContextNode)) {
if (aSubscriber.valid()) {
// append the data to the internals table
v = TTValue(anObject);
v.append(TTSymbol(instanceAddress->s_name));
v.append(aSubscriber);
x->internals->append(TTSymbol(instanceAddress->s_name), v);
// inverse objects order for iteration purpose (see in data_array_return_value : array mode)
EXTRA->objectsSorted->insert(0, anObject);
}
}
}
// Ends iteration on internals
x->iterateInternals = NO;
// handle args
jamoma_ttvalue_to_Atom(x->arrayArgs, &argc, &argv);
if (argc && argv)
attr_args_process(x, argc, argv);
// select all datas
wrappedModularClass_ArraySelect(self, gensym("*"), 0, NULL);
#ifndef JMOD_MESSAGE
// init all datas created dynamically
if (!EXTRA->firstArray)
defer((t_object*)x, (method)wrappedModularClass_anything, _sym_init, 0, NULL);
#endif
}
else if (number > MAX_ARRAY_SIZE)
object_error((t_object*)x, "the size is greater than the maximum array size (%d)", MAX_ARRAY_SIZE);
EXTRA->firstArray = NO;
}
else
object_error((t_object*)x, "can't register because %s is not a relative address", relativeAddress->s_name);
}