Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10639
Modified Files: Tag: desiredata desire.c Log Message: connect/disconnect uses new indices
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.217.2.197 retrieving revision 1.1.2.217.2.198 diff -C2 -d -r1.1.2.217.2.197 -r1.1.2.217.2.198 *** desire.c 9 Aug 2007 07:00:53 -0000 1.1.2.217.2.197 --- desire.c 9 Aug 2007 07:59:07 -0000 1.1.2.217.2.198 *************** *** 1076,1088 ****
void canvas_disconnect(t_canvas *x, float from_, float outlet, float to_, float inlet) { ! canvas_wires_each(oc,t,x) { ! int from = canvas_getindex(x, t.from); ! int to = canvas_getindex(x, t.to); ! if (from == from_ && t.outlet == outlet && ! to == to_ && t.inlet == inlet) { ! obj_disconnect(t.from, t.outlet, t.to, t.inlet); ! break; ! } ! } }
--- 1076,1088 ----
void canvas_disconnect(t_canvas *x, float from_, float outlet, float to_, float inlet) { ! int ifrom=(int)from_, ito=int(to_); ! t_gobj *from=0, *to=0; ! canvas_each(gfrom,x) if (gfrom->dix->index == ifrom) {from=gfrom; break;} ! canvas_each( gto,x) if ( gto->dix->index == ito) { to= gto; break;} ! if (!from || !to) goto bad; ! obj_disconnect((t_object *)from, int(outlet), (t_object *)to, int(inlet)); ! return; ! bad: ! post("dumb."); }
*************** *** 1242,1246 ****
void canvas_connect(t_canvas *x, t_floatarg ffrom, t_floatarg foutlet, t_floatarg fto,t_floatarg finlet) { ! int i, ifrom=(int)ffrom, outlet=(int)foutlet, ito=(int)fto, inlet=(int)finlet; t_gobj *gfrom=0, *gto=0; t_object *from=0, *to=0; --- 1242,1246 ----
void canvas_connect(t_canvas *x, t_floatarg ffrom, t_floatarg foutlet, t_floatarg fto,t_floatarg finlet) { ! int ifrom=(int)ffrom, outlet=(int)foutlet, ito=(int)fto, inlet=(int)finlet; t_gobj *gfrom=0, *gto=0; t_object *from=0, *to=0; *************** *** 1248,1253 **** if (ifrom<0) goto bad; if (ito <0) goto bad; ! for (i=ifrom, gfrom=x->list; i>0; gfrom=gfrom->g_next, i--) if (!gfrom->g_next) goto bad; ! for (i=ito, gto =x->list; i>0; gto =gto ->g_next, i--) if (!gto ->g_next) goto bad; from = pd_checkobject(gfrom); to = pd_checkobject( gto); --- 1248,1255 ---- if (ifrom<0) goto bad; if (ito <0) goto bad; ! canvas_each(zfrom,x) if (zfrom->dix->index == ifrom) {gfrom=zfrom; break;} ! if (!gfrom) goto bad; ! canvas_each( zto,x) if ( zto->dix->index == ito) { gto= zto; break;} ! if (!gto) goto bad; from = pd_checkobject(gfrom); to = pd_checkobject( gto);