Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6218
Modified Files: Tag: desiredata m_obj.c Log Message: fixed inlet/outlet numbers for wire_save
Index: m_obj.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_obj.c,v retrieving revision 1.2.4.3.2.10.2.8 retrieving revision 1.2.4.3.2.10.2.9 diff -C2 -d -r1.2.4.3.2.10.2.8 -r1.2.4.3.2.10.2.9 *** m_obj.c 13 Dec 2006 05:57:40 -0000 1.2.4.3.2.10.2.8 --- m_obj.c 13 Dec 2006 16:45:19 -0000 1.2.4.3.2.10.2.9 *************** *** 343,362 **** }
! t_outconnect *obj_connect(t_object *source, int outno, t_object *sink, int inno) { ! t_inlet *i; t_outlet *o; t_pd *to; t_outconnect *oc, *oc2; ! for (o = source->ob_outlet; o && outno; o = o->o_next, outno--) ; ! if (!o) return 0; ! if (sink->ob_pd->c_firstin) {if (!inno) {to = &sink->ob_pd; goto doit;} else inno--;} ! for (i = sink->ob_inlet; i && inno; i = i->i_next, inno--) ; ! if (!i) return 0; ! to = &i->i_pd; ! doit: oc = wire_new(0,0,0); oc->oc_next = 0; ! oc->oc_to = to; ! oc->from = source; ! oc->to = sink; ! oc->outlet = outno; ! oc->inlet = inno; /* append it to the end of the list */ /* LATER we might cache the last "oc" to make this faster. */ --- 343,372 ---- }
! static t_pd *find_inlet(t_object *to, int inlet) { ! t_inlet *i; ! if (to->ob_pd->c_firstin) { ! if (inlet==0) return (t_pd *)to; ! inlet--; ! } ! for (i = to->ob_inlet; i && inlet; i = i->i_next, inlet--) {} ! return (t_pd *)i; ! } ! ! static t_outlet *find_outlet(t_object *from, int outlet) { ! t_outlet *o; ! for (o = from->ob_outlet; o && outlet; o = o->o_next, outlet--) {} ! return o; ! } ! ! t_outconnect *obj_connect(t_object *from, int outlet, t_object *to, int inlet) { ! t_outconnect *oc, *oc2; ! t_outlet *o = find_outlet(from,outlet); ! t_pd *i = find_inlet(to,inlet); ! if (!o||!i) return 0; oc = wire_new(0,0,0); oc->oc_next = 0; ! oc->oc_to = i; ! oc->from = from; oc->outlet = outlet; ! oc->to = to; oc->inlet = inlet; /* append it to the end of the list */ /* LATER we might cache the last "oc" to make this faster. */