Update of /cvsroot/pure-data/externals/hcs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25446
Modified Files: sys_gui.c sys_gui-help.pd Log Message: working version with storage and a bang to output stored value; should add right inlet for storing
Index: sys_gui.c =================================================================== RCS file: /cvsroot/pure-data/externals/hcs/sys_gui.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sys_gui.c 3 Nov 2007 23:49:23 -0000 1.1 --- sys_gui.c 5 Nov 2007 06:30:48 -0000 1.2 *************** *** 9,56 **** { t_object x_obj; } t_sys_gui;
! static void *sys_gui_anything(t_sys_gui *x, t_symbol *s, int argc, t_atom *argv) { int i = 0; ! int firsttime = 1; ! t_symbol *tmp_symbol = s; ! char tmp_string[MAXPDSTRING]; ! char send_buffer[MAXPDSTRING] = "\0"; ! ! do { ! tmp_symbol = atom_getsymbolarg(i, argc, argv); ! if(tmp_symbol == &s_) ! { ! snprintf(tmp_string, MAXPDSTRING, "%g", atom_getfloatarg(i, argc , argv)); ! strncat(send_buffer, tmp_string, MAXPDSTRING); ! } ! else ! { ! strncat(send_buffer, tmp_symbol->s_name, MAXPDSTRING); ! } ! i++; ! if(firsttime) firsttime = 0; ! } while(i<argc); ! strncat(send_buffer, " ;\n", MAXPDSTRING); ! post(send_buffer); ! sys_gui(send_buffer); }
! static void *sys_gui_new(t_symbol *s, int argc, t_atom *argv) { t_sys_gui *x = (t_sys_gui *)pd_new(sys_gui_class);
outlet_new(&x->x_obj, &s_anything);
return(x); }
- static void sys_gui_free(t_sys_gui *x) - { - } - void sys_gui_setup(void) { --- 9,68 ---- { t_object x_obj; + char *send_buffer; } t_sys_gui;
+ static void sys_gui_bang(t_sys_gui *x) + { + sys_gui(x->send_buffer); + }
! static void sys_gui_anything(t_sys_gui *x, t_symbol *s, int argc, t_atom *argv) { + post("sys_gui_anything"); int i = 0; ! char buf[MAXPDSTRING]; ! ! snprintf(x->send_buffer, MAXPDSTRING, "%s ", s->s_name); ! for(i=0;i<argc;++i) ! { ! atom_string(argv + i, buf, MAXPDSTRING); ! strncat(x->send_buffer, buf, MAXPDSTRING - strlen(x->send_buffer)); ! strncat(x->send_buffer, " ", MAXPDSTRING - strlen(x->send_buffer)); ! } ! strncat(x->send_buffer, " ;\n", 3); ! sys_gui(x->send_buffer); }
+ static void sys_gui_list(t_sys_gui *x, t_symbol *s, int argc, t_atom *argv) + { + post("sys_gui_list"); + int i = 0; + char buf[MAXPDSTRING];
! for(i=0;i<argc;++i) ! { ! atom_string(argv + i, buf, MAXPDSTRING); ! strncat(x->send_buffer, buf, MAXPDSTRING - strlen(x->send_buffer)); ! strncat(x->send_buffer, " ", MAXPDSTRING - strlen(x->send_buffer)); ! } ! strncat(x->send_buffer, " ;\n", 3); ! sys_gui(x->send_buffer); ! } ! ! static void sys_gui_free(t_sys_gui *x) ! { ! freebytes(x->send_buffer,MAXPDSTRING); ! } ! ! static void *sys_gui_new(t_symbol *s) { t_sys_gui *x = (t_sys_gui *)pd_new(sys_gui_class);
outlet_new(&x->x_obj, &s_anything); + x->send_buffer = (char *)getbytes(MAXPDSTRING);
return(x); }
void sys_gui_setup(void) { *************** *** 60,62 **** --- 72,76 ----
class_addanything(sys_gui_class, (t_method)sys_gui_anything); + class_addbang(sys_gui_class, (t_method)sys_gui_bang); + class_addlist(sys_gui_class, (t_method)sys_gui_list); }
Index: sys_gui-help.pd =================================================================== RCS file: /cvsroot/pure-data/externals/hcs/sys_gui-help.pd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sys_gui-help.pd 3 Nov 2007 23:49:23 -0000 1.1 --- sys_gui-help.pd 5 Nov 2007 06:30:48 -0000 1.2 *************** *** 1,4 **** ! #N canvas 0 22 454 304 10; ! #X msg 84 83 blah blah blah; ! #X obj 89 152 sys_gui; ! #X connect 0 0 1 0; --- 1,18 ---- ! #N canvas 653 47 435 295 10; ! #X obj 78 232 sys_gui; ! #X msg 78 58 menu_doc_browser; ! #X text 187 56 open the help browser; ! #X msg 102 100 set text_color #f0f; ! #X text 231 100 set variables; ! #X msg 132 147 bang; ! #X obj 255 172 colorpanel; ! #X obj 254 147 bng 17 250 50 0 empty empty empty 17 7 0 10 -262144 ! -1 -1; ! #X msg 255 196 set box_fill $2; ! #X text 284 146 choose a color; ! #X connect 1 0 0 0; ! #X connect 3 0 0 0; ! #X connect 5 0 0 0; ! #X connect 6 0 8 0; ! #X connect 7 0 6 0; ! #X connect 8 0 0 0;