Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1654
Modified Files:
Tag: desiredata
kernel.c
Log Message:
more binbuf_addv "t"
Index: kernel.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/kernel.c,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -C2 -d -r1.1.2.17 -r1.1.2.18
*** kernel.c 31 Dec 2006 08:05:57 -0000 1.1.2.17
--- kernel.c 31 Dec 2006 09:14:28 -0000 1.1.2.18
***************
*** 733,738 ****
void wire_save (t_wire *self, t_binbuf *b) {
t_canvas *c = self->oc_gobj.dix->canvas;
! binbuf_addv(b, "ssiiii;", gensym("#X"), gensym("connect"),
! canvas_getindex(c,(t_gobj *)self->from), self->outlet, canvas_getindex(c,(t_gobj *)self->to), self->inlet);
appendix_save((t_gobj *)self,b);
}
--- 733,739 ----
void wire_save (t_wire *self, t_binbuf *b) {
t_canvas *c = self->oc_gobj.dix->canvas;
! binbuf_addv(b,"ttiiii;","#X","connect",
! canvas_getindex(c,(t_gobj *)self->from), self->outlet,
! canvas_getindex(c,(t_gobj *)self->to), self->inlet);
appendix_save((t_gobj *)self,b);
}
***************
*** 1772,1776 ****
}
*bufp=0;
! binbuf_addv(x,"s",gensym(buf));
return t; /* ignore syntax error (should it?) */
}
--- 1773,1777 ----
}
*bufp=0;
! binbuf_addv(x,"t",buf);
return t; /* ignore syntax error (should it?) */
}
***************
*** 1804,1808 ****
if (doll) binbuf_addv(x,"$",atoi(buf+1));
else binbuf_addv(x,"&",gensym(buf));
! } else binbuf_addv(x,"s",gensym(buf));
return t;
}
--- 1805,1809 ----
if (doll) binbuf_addv(x,"$",atoi(buf+1));
else binbuf_addv(x,"&",gensym(buf));
! } else binbuf_addv(x,"t",buf);
return t;
}
***************
*** 1846,1850 ****
if (dollar) binbuf_addv(x,"$",atoi(buf+1));
else binbuf_addv(x,"&",gensym(buf));
! } else binbuf_addv(x,"s",gensym(buf));
return t;
}
--- 1847,1851 ----
if (dollar) binbuf_addv(x,"$",atoi(buf+1));
else binbuf_addv(x,"&",gensym(buf));
! } else binbuf_addv(x,"t",buf);
return t;
}
***************
*** 1953,1957 ****
break;
default:
! bug("binbuf_addbinbuf: stray atom of type %d",ap->a_type);
}
}
--- 1954,1960 ----
break;
default:
! //bug("binbuf_addbinbuf: stray atom of type %d",ap->a_type);
! //abort();
! ;
}
}
***************
*** 2390,2394 ****
t_int n = oldb->n, nextindex, stackdepth = 0, stack[MAXSTACK], nobj = 0, i;
t_atom outmess[MAXSTACK], *nextmess;
! if (!maxtopd) binbuf_addv(newb, "ss;", gensym("max"), gensym("v2"));
for (nextindex = 0; nextindex < n; ) {
int endmess, natom;
--- 2393,2397 ----
t_int n = oldb->n, nextindex, stackdepth = 0, stack[MAXSTACK], nobj = 0, i;
t_atom outmess[MAXSTACK], *nextmess;
! if (!maxtopd) binbuf_addv(newb,"tt;","max","v2");
for (nextindex = 0; nextindex < n; ) {
int endmess, natom;
***************
*** 2428,2432 ****
stackdepth++;
nobj = 0;
! binbuf_addv(newb, "ssfffff;", gensym("#N"), gensym("canvas"), GETF(2), GETF(3),
GETF(4)-GETF(2), GETF(5)-GETF(3), 10.);
}
--- 2431,2435 ----
stackdepth++;
nobj = 0;
! binbuf_addv(newb,"ttfffff;","#N","canvas", GETF(2), GETF(3),
GETF(4)-GETF(2), GETF(5)-GETF(3), 10.);
}
***************
*** 2441,2446 ****
if (natom >= 7 && !strcmp(second, "newobj")
&& (ISSYMBOL(&nextmess[6], "patcher") || ISSYMBOL(&nextmess[6], "p"))) {
! binbuf_addv(newb, "ssffss;", gensym("#X"), gensym("restore"), GETF(2), GETF(3),
! gensym("pd"), atom_getsymbolarg(7, natom, nextmess));
if (stackdepth) stackdepth--;
nobj = stack[stackdepth];
--- 2444,2449 ----
if (natom >= 7 && !strcmp(second, "newobj")
&& (ISSYMBOL(&nextmess[6], "patcher") || ISSYMBOL(&nextmess[6], "p"))) {
! binbuf_addv(newb,"ttffts;","#X","restore", GETF(2), GETF(3),
! "pd", atom_getsymbolarg(7, natom, nextmess));
if (stackdepth) stackdepth--;
nobj = stack[stackdepth];
***************
*** 2474,2508 ****
nobj++;
} else if (!strcmp(second, "button")) {
! binbuf_addv(newb, "ssffs;", gensym("#X"), gensym("obj"), GETF(2), GETF(3), gensym("bng"));
nobj++;
} else if (!strcmp(second, "number") || !strcmp(second, "flonum")) {
! binbuf_addv(newb, "ssff;", gensym("#X"), gensym("floatatom"), GETF(2), GETF(3));
nobj++;
} else if (!strcmp(second, "slider")) {
float inc = GETF(7);
if (inc <= 0) inc = 1;
! binbuf_addv(newb, "ssffsffffffsssfffffffff;", gensym("#X"), gensym("obj"),
! GETF(2), GETF(3), gensym("vsl"), GETF(4), GETF(5), GETF(6), GETF(6)+(GETF(5)-1)*inc,
! 0., 0., gensym("empty"), gensym("empty"), gensym("empty"),
! 0., -8., 0., 8., -262144., -1., -1., 0., 1.);
nobj++;
} else if (!strcmp(second, "toggle")) {
! binbuf_addv(newb, "ssffs;", gensym("#X"), gensym("obj"), GETF(2), GETF(3), gensym("tgl"));
nobj++;
} else if (!strcmp(second, "inlet")) {
! binbuf_addv(newb, "ssffs;", gensym("#X"), gensym("obj"), GETF(2), GETF(3),
! gensym((char *)(natom > 5 ? "inlet~" : "inlet")));
nobj++;
} else if (!strcmp(second, "outlet")) {
! binbuf_addv(newb, "ssffs;", gensym("#X"), gensym("obj"), GETF(2), GETF(3),
! gensym((char *)(natom > 5 ? "outlet~" : "outlet")));
nobj++;
} else if (!strcmp(second, "user")) {
! binbuf_addv(newb, "ssffs;", gensym("#X"), gensym("obj"), GETF(3), GETF(4),
! atom_getsymbolarg(2, natom, nextmess));
nobj++;
} else if (!strcmp(second, "connect") || !strcmp(second, "fasten")) {
! binbuf_addv(newb, "ssffff;", gensym("#X"), gensym("connect"),
! nobj-GETF(2)-1, GETF(3), nobj-GETF(4)-1, GETF(5));
}
}
--- 2477,2509 ----
nobj++;
} else if (!strcmp(second, "button")) {
! binbuf_addv(newb,"ttfft;","#X","obj",GETF(2),GETF(3),"bng");
nobj++;
} else if (!strcmp(second, "number") || !strcmp(second, "flonum")) {
! binbuf_addv(newb,"ttff;","#X","floatatom",GETF(2),GETF(3));
nobj++;
} else if (!strcmp(second, "slider")) {
float inc = GETF(7);
if (inc <= 0) inc = 1;
! binbuf_addv(newb, "ttfftfffffftttfffffffff;","#X","obj",
! GETF(2), GETF(3), "vsl", GETF(4), GETF(5), GETF(6), GETF(6)+(GETF(5)-1)*inc,
! 0., 0., "empty", "empty", "empty", 0., -8., 0., 8., -262144., -1., -1., 0., 1.);
nobj++;
} else if (!strcmp(second, "toggle")) {
! binbuf_addv(newb,"ttfft;","#X","obj",GETF(2),GETF(3),"tgl");
nobj++;
} else if (!strcmp(second, "inlet")) {
! binbuf_addv(newb,"ttfft;","#X","obj",GETF(2),GETF(3),
! (char *)(natom > 5 ? "inlet~" : "inlet"));
nobj++;
} else if (!strcmp(second, "outlet")) {
! binbuf_addv(newb,"ttfft;","#X","obj", GETF(2), GETF(3),
! (char *)(natom > 5 ? "outlet~" : "outlet"));
nobj++;
} else if (!strcmp(second, "user")) {
! binbuf_addv(newb,"ttffs;","#X","obj", GETF(3), GETF(4), atom_getsymbolarg(2, natom, nextmess));
nobj++;
} else if (!strcmp(second, "connect") || !strcmp(second, "fasten")) {
! binbuf_addv(newb,"ttffff;","#X","connect",
! nobj-GETF(2)-1, GETF(3), nobj-GETF(4)-1, GETF(5));
}
}
***************
*** 2517,2529 ****
stackdepth++;
nobj = 0;
! binbuf_addv(newb, "ssffff;", gensym("#N"), gensym("vpatcher"),
! GETF(2), GETF(3), GETF(4), GETF(5));
}
}
if (!strcmp(first, "#X")) {
if (natom >= 5 && !strcmp(second, "restore") && (ISSYMBOL (&nextmess[4], "pd"))) {
! binbuf_addv(newb, "ss;", gensym("#P"), gensym("pop"));
! binbuf_addv(newb, "ssffffss;", gensym("#P"), gensym("newobj"), GETF(2), GETF(3), 50., 1.,
! gensym("patcher"), atom_getsymbolarg(5, natom, nextmess));
if (stackdepth) stackdepth--;
nobj = stack[stackdepth];
--- 2518,2529 ----
stackdepth++;
nobj = 0;
! binbuf_addv(newb,"ttffff;","#N","vpatcher", GETF(2), GETF(3), GETF(4), GETF(5));
}
}
if (!strcmp(first, "#X")) {
if (natom >= 5 && !strcmp(second, "restore") && (ISSYMBOL (&nextmess[4], "pd"))) {
! binbuf_addv(newb,"tt;","#P","pop");
! binbuf_addv(newb,"ttffffts;","#P","newobj", GETF(2), GETF(3), 50., 1.,
! "patcher", atom_getsymbolarg(5, natom, nextmess));
if (stackdepth) stackdepth--;
nobj = stack[stackdepth];
***************
*** 2532,2551 ****
t_symbol *classname = atom_getsymbolarg(4, natom, nextmess);
if (classname == gensym("inlet"))
! binbuf_addv(newb, "ssfff;", gensym("#P"), gensym("inlet"), GETF(2), GETF(3), 15.);
else if (classname == gensym("inlet~"))
! binbuf_addv(newb, "ssffff;", gensym("#P"), gensym("inlet"), GETF(2), GETF(3), 15., 1.);
else if (classname == gensym("outlet"))
! binbuf_addv(newb, "ssfff;", gensym("#P"), gensym("outlet"), GETF(2), GETF(3), 15.);
else if (classname == gensym("outlet~"))
! binbuf_addv(newb, "ssffff;", gensym("#P"), gensym("outlet"), GETF(2), GETF(3), 15., 1.);
else if (classname == gensym("bng"))
! binbuf_addv(newb, "ssffff;", gensym("#P"), gensym("button"), GETF(2), GETF(3), GETF(5), 0.);
else if (classname == gensym("tgl"))
! binbuf_addv(newb, "ssffff;", gensym("#P"), gensym("toggle"), GETF(2), GETF(3), GETF(5), 0.);
else if (classname == gensym("vsl"))
! binbuf_addv(newb, "ssffffff;", gensym("#P"), gensym("slider"),
! GETF(2), GETF(3), GETF(5), GETF(6),
! (GETF(8)-GETF(7)) / (GETF(6)==1?1:GETF(6)-1),
! GETF(7));
else {
SETSYMBOL(outmess, gensym("#P"));
--- 2532,2549 ----
t_symbol *classname = atom_getsymbolarg(4, natom, nextmess);
if (classname == gensym("inlet"))
! binbuf_addv(newb,"ttfff;","#P","inlet", GETF(2), GETF(3), 15.);
else if (classname == gensym("inlet~"))
! binbuf_addv(newb,"ttffff;","#P","inlet", GETF(2), GETF(3), 15., 1.);
else if (classname == gensym("outlet"))
! binbuf_addv(newb,"ttfff;","#P","outlet", GETF(2), GETF(3), 15.);
else if (classname == gensym("outlet~"))
! binbuf_addv(newb,"ttffff;","#P","outlet", GETF(2), GETF(3), 15., 1.);
else if (classname == gensym("bng"))
! binbuf_addv(newb,"ttffff;","#P","button", GETF(2), GETF(3), GETF(5), 0.);
else if (classname == gensym("tgl"))
! binbuf_addv(newb,"ttffff;","#P","toggle", GETF(2), GETF(3), GETF(5), 0.);
else if (classname == gensym("vsl"))
! binbuf_addv(newb,"ttffffff;","#P","slider", GETF(2), GETF(3), GETF(5), GETF(6),
! (GETF(8)-GETF(7)) / (GETF(6)==1?1:GETF(6)-1), GETF(7));
else {
SETSYMBOL(outmess, gensym("#P"));
***************
*** 2573,2580 ****
nobj++;
} else if (!strcmp(second, "floatatom")) {
! binbuf_addv(newb, "ssfff;", gensym("#P"), gensym("flonum"), GETF(2), GETF(3), 35);
nobj++;
} else if (!strcmp(second, "connect")) {
! binbuf_addv(newb, "ssffff;", gensym("#P"), gensym("connect"),
nobj-GETF(2)-1, GETF(3), nobj-GETF(4)-1, GETF(5));
}
--- 2571,2578 ----
nobj++;
} else if (!strcmp(second, "floatatom")) {
! binbuf_addv(newb, "ttfff;", "#P", "flonum", GETF(2), GETF(3), 35);
nobj++;
} else if (!strcmp(second, "connect")) {
! binbuf_addv(newb, "ttffff;", "#P", "connect",
nobj-GETF(2)-1, GETF(3), nobj-GETF(4)-1, GETF(5));
}
***************
*** 2583,2588 ****
nextindex = endmess + 1;
}
! if (!maxtopd)
! binbuf_addv(newb, "ss;", gensym("#P"), gensym("pop"));
#if 0
binbuf_write(newb, "import-result.pd", "/tmp", 0);
--- 2581,2585 ----
nextindex = endmess + 1;
}
! if (!maxtopd) binbuf_addv(newb, "tt;", "#P", "pop");
#if 0
binbuf_write(newb, "import-result.pd", "/tmp", 0);