Exemplo n.º 1
0
void data_return_value(TTPtr self, t_symbol *msg, long argc, t_atom *argv)
{
	WrappedModularInstancePtr	x = (WrappedModularInstancePtr)self;
	
	// avoid blank before data
	if (msg == _sym_nothing)
		outlet_atoms(x->outlets[data_out], argc, argv);
	else
		outlet_anything(x->outlets[data_out], msg, argc, argv);
}
Exemplo n.º 2
0
void in_return_signal(TTPtr self, SymbolPtr msg, AtomCount argc, AtomPtr argv)
{
	WrappedModularInstancePtr	x = (WrappedModularInstancePtr)self;
	
	// avoid blank before data
	if (msg == _sym_nothing)
		outlet_atoms(x->outlets[signal_out], argc, argv);
	else
		outlet_anything(x->outlets[signal_out], msg, argc, argv);
}
Exemplo n.º 3
0
void data_address(TTPtr self, t_symbol *address)
{
	WrappedModularInstancePtr	x = (WrappedModularInstancePtr)self;
	
	// Avoid succession of address changes
    if (!EXTRA->changingAddress) {
        
        EXTRA->changingAddress = YES;
        
        // filter repetitions
        if (!(x->arrayAddress == TTAddress(address->s_name))) {
            
            if (!x->iterateInternals) {
                
                // unregister internals
                wrappedModularClass_unregister(x);
                
                x->arraySize = 0;

                // rebuild internals
                defer(self,(method)data_new_address, address, 0, NULL);
                
                // for array mode : output the array once afterward
                if (x->arrayAttrFormat == gensym("array")) {
                    
                    TTValue     array;
                    t_symbol	*msg;
                    long		argc = 0;
                    t_atom		*argv = NULL;
                    TTBoolean	shifted = NO;
                    
                    data_edit_array(self, array);
                    
                    jamoma_ttvalue_to_typed_Atom(array, &msg, &argc, &argv, shifted);
                    
                    // avoid blank before data
                    if (msg == _sym_nothing)
                        outlet_atoms(x->outlets[data_out], argc, argv);
                    else
                        outlet_anything(x->outlets[data_out], msg, argc, argv);
                    
                    if (shifted)
                        argv--;
                    sysmem_freeptr(argv);
                }
            }
        }
        
        EXTRA->changingAddress = NO;
        return;
	}
	
    object_error((t_object*)x, "can't change to %s address. Please defer low", address->s_name);
}
Exemplo n.º 4
0
void data_array_return_value(const TTValue& baton, const TTValue& v)
{
	WrappedModularInstancePtr	x;
	TTValue                     array;
	t_symbol					*msg;
	TTUInt32					i;
	long						argc = 0;
	t_atom						*argv = NULL;
	TTBoolean					shifted = NO;

	// unpack baton (a t_object, the index of the value and the instance symbol)
	x = WrappedModularInstancePtr((TTPtr)baton[0]);
	i = baton[1];
	
	// output index
	if (x->arrayIndex == 0)
        x->cursor = baton[2];
	
	outlet_int(x->outlets[index_out], i);
	
	// in array output mode 
	// edit a value containing all values
	if (x->arrayAttrFormat == gensym("array")) {
        
        // don't output array when changing address
        if (EXTRA->changingAddress)
            return;
        
        data_edit_array(x, array);
		
		jamoma_ttvalue_to_typed_Atom(array, &msg, &argc, &argv, shifted);
	}
	else
		// output single value
		jamoma_ttvalue_to_typed_Atom(v, &msg, &argc, &argv, shifted);
	
	// avoid blank before data
	if (msg == _sym_nothing)
		outlet_atoms(x->outlets[data_out], argc, argv);
	else
		outlet_anything(x->outlets[data_out], msg, argc, argv);
	
	if (shifted)
		argv--;
	sysmem_freeptr(argv);
}
Exemplo n.º 5
0
void map_return_value(TTPtr self, SymbolPtr msg, AtomCount argc, AtomPtr argv)
{
	WrappedModularInstancePtr x = (WrappedModularInstancePtr)self;
	outlet_atoms(x->outlets[data_out], argc, argv);
}