当前位置: 首页>>代码示例>>C++>>正文


C++ TTObject::valid方法代码示例

本文整理汇总了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);
}
开发者ID:avilleret,项目名称:JamomaMax,代码行数:96,代码来源:j.parameter_array.cpp


注:本文中的TTObject::valid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。