Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1756
Modified Files: Tag: devel_0_39 desire.c Log Message: .
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.166 retrieving revision 1.1.2.167 diff -C2 -d -r1.1.2.166 -r1.1.2.167 *** desire.c 7 Sep 2006 09:22:52 -0000 1.1.2.166 --- desire.c 7 Sep 2006 10:18:51 -0000 1.1.2.167 *************** *** 62,65 **** --- 62,67 ---- for (linetraverser_start(&TRAV,GLIST); (WIRE=linetraverser_next(&TRAV)); )
+ static void postatom2(const char *s, int argc, t_atom *argv); + //-------------------------------------------------------------------------- // t_appendix: an extension to t_gobj made by matju so that *************** *** 6726,6754 ****
/* message back from dialog window */ ! static void gatom_param(t_gatom *x, t_symbol *sel, int argc, t_atom *argv) { ! t_float width,min,max,wherelabel; ! t_symbol *label,*rcv,*snd; ! t_text *t = (t_text *)x; ! pd_scanargs(argc,argv,"fffsfss",&width,&min,&max,&label,&wherelabel,&rcv,&snd); ! label = gatom_unescapit(label); ! rcv = gatom_unescapit(rcv); ! snd = gatom_unescapit(snd); ! if (!*rcv->s_name && *x->rcv->s_name) inlet_new(t, (t_pd *)t, 0, 0); ! else if (*rcv->s_name && !*x->rcv->s_name && t->te_inlet) { ! canvas_deletelinesforio(x->glist, t, t->te_inlet, 0); ! inlet_free(t->te_inlet); ! } ! if (!*snd->s_name && *x->snd->s_name) outlet_new(&x->a_text, 0); ! else if (*snd->s_name && !*x->snd->s_name && t->te_outlet) { ! canvas_deletelinesforio(x->glist, t, 0, t->te_outlet); ! outlet_free(t->te_outlet); ! } ! if (min>=max) min=max=0; ! x->min=min; ! x->max=max; ! if (width < 0) width = 4; else if (width > 80) width = 80; x->a_text.te_width = width; x->wherelabel = (int)wherelabel&3; - x->label = label; if (*x->rcv->s_name) pd_unbind((t_pd *)x, canvas_realizedollar(x->glist, x->rcv)); x->rcv = rcv; --- 6728,6743 ----
/* message back from dialog window */ ! static void gatom_reload(t_gatom *x, t_symbol *sel, int argc, t_atom *argv) { ! int width; t_float wherelabel; ! t_symbol *rcv,*snd; ! postatom2("meuh: ",argc,argv); ! if (!pd_scanargs(argc,argv,"ifffaaa",&width,&x->min,&x->max,&wherelabel,&x->label,&rcv,&snd)) return; ! x->label = gatom_unescapit(x->label); ! rcv = gatom_unescapit(rcv); ! snd = gatom_unescapit(snd); ! if (x->min>=x->max) x->min=x->max=0; ! CLAMP(width,1,80); x->a_text.te_width = width; x->wherelabel = (int)wherelabel&3; if (*x->rcv->s_name) pd_unbind((t_pd *)x, canvas_realizedollar(x->glist, x->rcv)); x->rcv = rcv; *************** *** 6757,6798 **** x->expanded_to = canvas_realizedollar(x->glist, x->snd); gobj_changed(x,0); }
void canvas_atom(t_glist *gl, t_atomtype type, t_symbol *s, int argc, t_atom *argv) { t_gatom *x = (t_gatom *)pd_new(gatom_class); ! x->a_text.te_width = 0; /* don't know it yet. */ ! x->a_text.te_type = T_ATOM; ! x->a_text.te_binbuf = binbuf_new(); x->glist = gl; - x->atom.a_type = type; x->min = x->max = 0; x->wherelabel = 0; x->label = x->rcv = x->snd = x->expanded_to = &s_; ! if (type == A_FLOAT) { ! x->a_text.te_width = 5; ! SETFLOAT(&x->atom, 0); ! } else { ! x->a_text.te_width = 10; ! SETSYMBOL(&x->atom, &s_symbol); ! } ! binbuf_add(x->a_text.te_binbuf, 1, &x->atom); ! x->a_text.te_xpix = atom_getfloatarg(0, argc, argv); ! x->a_text.te_ypix = atom_getfloatarg(1, argc, argv); ! if (argc >= 2) { ! float width; ! char wherelabel; ! if(pd_scanargs(argc-2,argv+2,"fffafaa",&width,&x->min,&x->max,&x->label,&wherelabel,&x->rcv,&x->snd)) { ! x->a_text.te_width = (width<0||width>500) ? 4 : width; ! x->wherelabel = wherelabel&3; ! } ! x->label = gatom_unescapit(x->label); ! x->rcv = gatom_unescapit(x->rcv); ! x->snd = gatom_unescapit(x->snd); ! if (*x->rcv->s_name) pd_bind(&x->a_text.te_pd, canvas_realizedollar(x->glist, x->rcv)); ! x->expanded_to = canvas_realizedollar(x->glist, x->snd); ! } ! if (x->rcv == &s_) inlet_new(&x->a_text, &x->a_text.te_pd, 0, 0); ! if (x->snd == &s_) outlet_new(&x->a_text, x->atom.a_type == A_FLOAT ? &s_float: &s_symbol); ! glist_add(gl, &x->a_text.te_g); }
--- 6746,6770 ---- x->expanded_to = canvas_realizedollar(x->glist, x->snd); gobj_changed(x,0); + printf("gatom_reload: %p %p %p\n",x->label,x->rcv,x->snd); }
void canvas_atom(t_glist *gl, t_atomtype type, t_symbol *s, int argc, t_atom *argv) { t_gatom *x = (t_gatom *)pd_new(gatom_class); ! t_text *t = (t_text *)x; ! if (type == A_FLOAT) {x->a_text.te_width = 5; SETFLOAT(&x->atom, 0);} ! else {x->a_text.te_width = 10; SETSYMBOL(&x->atom, &s_symbol);} ! t->te_type = T_ATOM; x->glist = gl; x->min = x->max = 0; x->wherelabel = 0; x->label = x->rcv = x->snd = x->expanded_to = &s_; ! t->te_binbuf = binbuf_new(); ! binbuf_add(t->te_binbuf, 1, &x->atom); ! t->te_xpix = atom_getfloatarg(0, argc, argv); ! t->te_ypix = atom_getfloatarg(1, argc, argv); ! inlet_new(t, (t_pd *)x, 0, 0); ! outlet_new(t, type == A_FLOAT ? &s_float: &s_symbol); ! if (argc >= 2) gatom_reload(x,&s_,argc-2,argv+2); ! glist_add(gl, (t_gobj *)x); }
*************** *** 6831,6836 **** t_symbol *sel = t==A_SYMBOL? gensym("symbolatom") : gensym("floatatom"); binbuf_addv(b, "ssii", gensym("#X"), sel, (t_int)x->te_xpix, (t_int)x->te_ypix); ! binbuf_addv(b, "ifffsss", (t_int)x->te_width, g->min, g->max, g->wherelabel, ! gatom_escapit(g->label), gatom_escapit(g->rcv), gatom_escapit(g->snd)); } else { /* comment */ binbuf_addv(b, "ssii", gensym("#X"), gensym("text"), (t_int)x->te_xpix, (t_int)x->te_ypix); --- 6803,6809 ---- t_symbol *sel = t==A_SYMBOL? gensym("symbolatom") : gensym("floatatom"); binbuf_addv(b, "ssii", gensym("#X"), sel, (t_int)x->te_xpix, (t_int)x->te_ypix); ! /* incredibly weird stuff happens if doing binbuf_addv "ifffsss". know why? */ ! binbuf_addv(b, "ifff", (t_int)x->te_width, g->min, g->max, g->wherelabel); ! binbuf_addv(b, "sss", gatom_escapit(g->label), gatom_escapit(g->rcv), gatom_escapit(g->snd)); } else { /* comment */ binbuf_addv(b, "ssii", gensym("#X"), gensym("text"), (t_int)x->te_xpix, (t_int)x->te_ypix); *************** *** 6965,6969 **** class_addsymbol(c, gatom_symbol); class_addmethod3(c, gatom_set, "set","*"); ! class_addmethod3(c, gatom_param, "param","*"); }
--- 6938,6942 ---- class_addsymbol(c, gatom_symbol); class_addmethod3(c, gatom_set, "set","*"); ! class_addmethod3(c, gatom_reload, "reload","*"); }
*************** *** 8276,8279 **** --- 8249,8261 ---- }
+ static void postatom2(const char *s, int argc, t_atom *argv) { + char buf[MAXPDSTRING]; int i; + //FILE *f = stderr; + FILE *f = stdout; + fprintf(f,"%s",s); + for (i=0; i<argc; i++) {atom_string(argv+i,buf,MAXPDSTRING); fprintf(f,"%s ",buf);} + fprintf(f,"\n"); + } + /* what's the point? */ void postfloat(float f) {t_atom a; SETFLOAT(&a, f); postatom(1, &a);}