Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv655
Modified Files: Tag: devel_0_39 desire.c Log Message: #V support, read/write (with symbol arguments only)
Index: desire.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v retrieving revision 1.1.2.85 retrieving revision 1.1.2.86 diff -C2 -d -r1.1.2.85 -r1.1.2.86 *** desire.c 1 Jul 2006 06:30:48 -0000 1.1.2.85 --- desire.c 2 Jul 2006 00:59:47 -0000 1.1.2.86 *************** *** 76,79 **** --- 76,80 ---- binbuf_addv(b, "s", gensym("#V")); hash_foreach(k,v,h) { + binbuf_addv(b, "ss", k, v); // :-( if (i+1==hash_size(h)) binbuf_addv(b, ";"); else binbuf_addv(b, "s", gensym(",")); } *************** *** 12754,12758 **** --- 12755,12774 ---- }
+ t_class *visualloader_class; + + static t_pd *visualloader_new(t_symbol *s, int argc, t_atom *argv) { + return pd_new(visualloader_class); + }
+ static void visualloader_free(t_pd *self) {free(self);} + + static void visualloader_anything(t_gobj *self, t_symbol *s, int argc, t_atom *argv) { + t_symbol *v; + if (argc!=1) {post("#V's messages take exactly one arg"); return;} + if (argv[0].a_type != A_SYMBOL) {post("#V's messages must take a symbol arg"); return;} + v = atom_getsymbolarg(0, argc, argv); + post("#V got message '%s' with $1='%s' and g_adix=%p",s->s_name,v->s_name,self->g_adix); + hash_set(self->g_adix->visual,s,v); + }
void desire_setup(void) { *************** *** 12767,12772 **** S(g_slider) S(g_numbox) S(g_mycanvas) S(g_vumeter) S(g_dropper) #undef S - }
/* ---------------------------------------------------------------- */ --- 12783,12792 ---- S(g_slider) S(g_numbox) S(g_mycanvas) S(g_vumeter) S(g_dropper) #undef S
+ visualloader_class = class_new(gensym("#V"), (t_newmethod)visualloader_new, + (t_method)visualloader_free, sizeof(t_object), CLASS_GOBJ, A_GIMME, 0); + class_addanything(visualloader_class,visualloader_anything); + pd_bind(pd_new(visualloader_class),gensym("#V")); + }
/* ---------------------------------------------------------------- */