/* objects interpret lists by feeding them to the individual inlets. Before you call this check that the object doesn't have a more specific way to handle lists. */ void obj_list(t_object *x, t_symbol *s, int argc, t_atom *argv) { t_atom *ap; int count; t_inlet *ip = ((t_object *)x)->ob_inlet; if (!argc) return; for (count = argc-1, ap = argv+1; ip && count--; ap++, ip = ip->i_next) { if (ap->a_type == A_POINTER) pd_pointer(&ip->i_pd, ap->a_w.w_gpointer); else if (ap->a_type == A_FLOAT) pd_float(&ip->i_pd, ap->a_w.w_float); else pd_symbol(&ip->i_pd, ap->a_w.w_symbol); } if (argv->a_type == A_POINTER) pd_pointer(&x->ob_pd, argv->a_w.w_gpointer); else if (argv->a_type == A_FLOAT) pd_float(&x->ob_pd, argv->a_w.w_float); else pd_symbol(&x->ob_pd, argv->a_w.w_symbol); }
static void inlet_pointer(t_inlet *x, t_gpointer *gp) { if (x->i_symfrom == &s_pointer) pd_vmess(x->i_dest, x->i_symto, "p", gp); else if (!x->i_symfrom) pd_pointer(x->i_dest, gp); else inlet_wrong(x, &s_pointer); }
static void dist_pointer(t_dist *x, t_gpointer *gp) { int i; for(i = 0; i <= x->x_rec; i++) { if (x->x_sym[i]->s_thing) pd_pointer(x->x_sym[i]->s_thing, gp); } }
static void bindlist_pointer(t_bindlist *x, t_gpointer *gp) { t_bindelem *e; change_bindlist_via_graph = 1; for (e = x->b_list; e; e = e->e_next) if (e->e_who != NULL) pd_pointer(e->e_who, gp); if (change_bindlist_via_graph > 1) bindlist_cleanup(x); change_bindlist_via_graph = 0; }
static void grab_pointer(t_grab *x, t_gpointer *gp) { t_pd *grabbed; grab_start(x); while (grabbed = grab_next(x)) { pd_pointer(grabbed, gp); grab_restore(x); } }
void outlet_pointer(t_outlet *x, t_gpointer *gp) { t_outconnect *oc; t_gpointer gpointer; char c; if (&c < stacklimit) outlet_stackerror(x); else { #if 0 gpointer_copy(gp, &gpointer); for (oc = x->o_connections; oc; oc = oc->oc_next) pd_pointer(oc->oc_to, &gpointer); gpointer_unset(&gpointer); #else gpointer = *gp; for (oc = x->o_connections; oc; oc = oc->oc_next) pd_pointer(oc->oc_to, &gpointer); #endif } }
static void inlet_pointer(t_inlet *x, t_gpointer *gp) { if (x->i_symfrom == &s_pointer) pd_vmess(x->i_dest, x->i_symto, "p", gp); else if (!x->i_symfrom) pd_pointer(x->i_dest, gp); else if (x->i_symfrom == &s_list) { t_atom a; SETPOINTER(&a, gp); inlet_list(x, &s_pointer, 1, &a); } else inlet_wrong(x, &s_pointer); }
void outlet_pointer(t_outlet *x, t_gpointer *gp) { t_outconnect *oc; t_gpointer gpointer; if(++stackcount >= STACKITER) outlet_stackerror(x); else { gpointer = *gp; for (oc = x->o_connections; oc; oc = oc->oc_next) pd_pointer(oc->oc_to, &gpointer); } --stackcount; }
/* send a pointer to the scalar that owns this array to whomever is bound to the given symbol */ static void array_define_send(t_glist *x, t_symbol *s) { t_glist *gl = (x->gl_list ? pd_checkglist(&x->gl_list->g_pd) : 0); if (!s->s_thing) pd_error(x, "array_define_send: %s: no such object", s->s_name); else if (gl && gl->gl_list && pd_class(&gl->gl_list->g_pd) == garray_class) { t_gpointer gp; gpointer_init(&gp); gpointer_setglist(&gp, gl, garray_getscalar((t_garray *)gl->gl_list)); pd_pointer(s->s_thing, &gp); gpointer_unset(&gp); } else bug("array_define_send"); }
void pd_forwardmess(t_pd *x, int argc, t_atom *argv) { if (argc) { t_atomtype t = argv->a_type; if (t == A_SYMBOL) pd_typedmess(x, argv->a_w.w_symbol, argc-1, argv+1); else if (t == A_POINTER) { if (argc == 1) pd_pointer(x, argv->a_w.w_gpointer); else pd_list(x, &s_list, argc, argv); } else if (t == A_FLOAT) { if (argc == 1) pd_float(x, argv->a_w.w_float); else pd_list(x, &s_list, argc, argv); } else bug("pd_forwardmess"); } }
static void new_inlet_pointer(t_inlet *x, t_gpointer *gp) { if (x->i_symfrom == &s_pointer) pd_vmess(x->i_dest, x->i_un.iu_symto, "p", gp); else if (!x->i_symfrom) pd_pointer(x->i_dest, gp); else if (x->i_symfrom == &s_list) { t_atom a; SETPOINTER(&a, gp); new_inlet_list(x, &s_pointer, 1, &a); } else if (*x->i_dest == eproxy_class) { t_atom a; t_eproxy* proxy = (t_eproxy *)x->i_dest; t_eobj *z = (t_eobj *)proxy->p_owner; z->o_current_proxy = proxy->p_index; SETPOINTER(&a, gp); pd_typedmess((t_pd *)x->i_dest, &s_pointer, 1, &a); z->o_current_proxy = 0; } else inlet_wrong(x, &s_pointer); }
static void send_pointer(t_send *x, t_gpointer *gp) { if (x->x_sym->s_thing) pd_pointer(x->x_sym->s_thing, gp); }
static void iem_send_pointer(t_iem_send *x, t_gpointer *gp) { if(x->x_send_label_sym) if(x->x_send_label_sym->s_thing) pd_pointer(x->x_send_label_sym->s_thing, gp); }
static void bindlist_pointer(t_bindlist *x, t_gpointer *gp) { t_bindelem *e; for (e = x->b_list; e; e = e->e_next) pd_pointer(e->e_who, gp); }
static void iem_send_kernel_pointer(t_iem_send_kernel *x, t_gpointer *gp) { if(x->x_sym->s_thing) pd_pointer(x->x_sym->s_thing, gp); }