// LIST INPUT void return_list(t_return *x, t_symbol *msg, long argc, t_atom *argv) { short i; if (!x->attrEnable) return; if (x->common.attr_repetitions == 0) { if (param_list_compare(x->output+1, x->input_len, argv, argc)) return; // nothing to do } for (i=1; i<=argc; i++) { jcom_core_atom_copy(&x->output[i], argv++); x->output_len++; } x->input_len = x->output_len-1; outlet_anything(x->outlets[k_outlet_thru], msg, x->output_len-1, &x->output[1]); return_send_feedback(x); }
// SYMBOL INPUT void return_symbol(t_return *x, t_symbol *msg, long argc, t_atom *argv) { short i; if (!x->attrEnable) return; if (x->common.attr_repetitions == 0) { if (msg == atom_getsym(&x->output[1])) return; } atom_setsym(&x->output[1], msg); x->output_len++; for (i=1; i<=argc; i++) { jcom_core_atom_copy(&x->output[i+1], argv++); x->output_len++; } outlet_anything(x->outlets[k_outlet_thru], msg, x->output_len-2, &x->output[2]); return_send_feedback(x); }
// SYMBOL INPUT void hub_symbol(t_hub *x, t_symbol *msg, long argc, t_atom *argv) { bool found = false; subscriberList *subscriber = x->subscriber; char input[MAX_STRING_LEN]; // our input string char *input2 = input; // pointer to our input string char *split; t_symbol *osc = NULL; t_symbol *name = msg; // default to the name being the message strcpy(input, msg->s_name); if(*input2 == '/') // leading slash means it's OSC... input2++; // remove the leading slash split = strchr(input2, ':'); // remove (and store) the param name if(split != NULL){ *split = NULL; // now input2 = param name; split = a message for the parameter object split += 2; // this will jump the pointer past the :/ to the actual name osc = gensym(split); } name = gensym(input2); subscriberIterator i; t_subscriber* t; critical_enter(0); if(name == jps_star){ // wildcard t_symbol* type; for(i = subscriber->begin(); i != subscriber->end(); ++i) { t = *i; type = t->type; if(type == jps_subscribe_parameter || type == jps_subscribe_message || type == jps_subscribe_return){ if(osc == NULL){ object_method_typed(t->object, jps_dispatched, argc, argv, NULL); } else{ object_method_typed(t->object, osc, argc, argv, NULL); } } } } else{ // search the linked list of params to find the right one for(i = subscriber->begin(); (i != subscriber->end()) && (found == false); ++i) { t = *i; if(t->name == name) { found = true; break; } } // dispatch to the correct jcom.param object if(found == true){ if(osc == NULL){ object_method_typed(t->object, jps_dispatched, argc, argv, NULL); } else object_method_typed(t->object, osc, argc, argv, NULL); } else{ // Check to see if it's a message we need to forward to jcom.out if(name == jps_slash_audio_meters_freeze || name == jps_audio_meters_freeze) { t_atom msg[2]; atom_setsym(msg, name); jcom_core_atom_copy(msg+1, argv); if(x->out_object != NULL) object_method_typed(x->out_object, jps_algorithm_message, 2, msg, NULL); } else if(!x->using_wildcard) { // if we got here through the use a remote message to modules named by a wildcard // then we need don't post annoying errors to the Max window if (x->editing) object_error((t_object*)x, "No message or parameter named %s (in %s module).", name->s_name, x->attr_name->s_name); else object_error((t_object*)x, "No message or parameter named %s (in %s module).", name->s_name, x->osc_name->s_name); } } } critical_exit(0); }