Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4800
Modified Files: Tag: devel_0_39 d_misc.c d_soundfile.c d_ugen.c g_all_guis.c g_all_guis.h g_array.c g_canvas.c g_canvas.h g_editor.c g_hdial.c g_hslider.c g_numbox.c g_scalar.c g_template.c g_text.c g_traversal.c g_vdial.c g_vslider.c g_vumeter.c m_glob.c m_imp.h m_pd.h s_inter.c s_main.c s_midi_alsa.c t_tkcmd.c u_main.tk x_list.c Log Message: updating to miller's 0.39-test5
Index: u_main.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v retrieving revision 1.4.4.10.2.8 retrieving revision 1.4.4.10.2.9 diff -C2 -d -r1.4.4.10.2.8 -r1.4.4.10.2.9 *** u_main.tk 2 Aug 2005 21:25:05 -0000 1.4.4.10.2.8 --- u_main.tk 21 Aug 2005 11:28:24 -0000 1.4.4.10.2.9 *************** *** 44,48 **** if {$pd_nt == 2} { # turn on James Tittle II's fast drawing (wait until I can test this...): ! # set tk::mac::useCGDrawing 1 global pd_guidir global pd_tearoff --- 44,48 ---- if {$pd_nt == 2} { # turn on James Tittle II's fast drawing (wait until I can test this...): ! set tk::mac::useCGDrawing 1 global pd_guidir global pd_tearoff *************** *** 51,66 **** load $pd_guidir/bin/libPdTcl.dylib set pd_tearoff 0 ! ! # tk::mac::OpenDocument is called with the filenames put into the ! # var args whenever docs are either dropped on the Pd.app icon or ! # opened from the Finder. ! # It uses menu_doc_open so it can handles numerous file types. ! proc tk::mac::OpenDocument {args} { ! foreach file $args { ! pd [concat pd open [pdtk_enquote [file tail $file]] \ ! [pdtk_enquote [file dirname $file]] ;] ! menu_doc_open [file dirname $file] [file tail $file] ! } ! } }
--- 51,74 ---- load $pd_guidir/bin/libPdTcl.dylib set pd_tearoff 0 ! global pd_macready ! set pd_macready 0 ! global pd_macdropped ! set pd_macdropped "" ! # tk::mac::OpenDocument is called with the filenames put into the ! # var args whenever docs are either dropped on the Pd.app icon or ! # opened from the Finder. ! # It uses menu_doc_open so it can handles numerous file types. ! proc tk::mac::OpenDocument {args} { ! global pd_macready pd_macdropped ! foreach file $args { ! if {$pd_macready != 0} { ! pd [concat pd open [pdtk_enquote [file tail $file]] \ ! [pdtk_enquote [file dirname $file]] ;] ! menu_doc_open [file dirname $file] [file tail $file] ! } else { ! set pd_macdropped $args ! } ! } ! } }
*************** *** 228,236 **** }
! proc pdtk_check {x message} { ! set answer [tk_messageBox -message $x -type yesno -icon question] ! switch $answer { ! yes {pd $message} } ! # no {tk_messageBox -message "cancelled" -type ok} }
--- 236,244 ---- }
! ##### routine to ask user if OK and, if so, send a message on to Pd ###### ! proc pdtk_check {x message default} { ! set answer [tk_messageBox -message $x -type yesno -default $default \ ! -icon question] ! if {$answer == yes} {pd $message} }
*************** *** 322,326 **** proc menu_really_quit {} {pd {pd quit;}}
! proc menu_quit {} {pdtk_check {Really quit?} {pd quit;}}
######### the "Pd" menu command, which puts the Pd window on top ######## --- 330,334 ---- proc menu_really_quit {} {pd {pd quit;}}
! proc menu_quit {} {pd {pd verifyquit;}}
######### the "Pd" menu command, which puts the Pd window on top ######## *************** *** 564,568 **** proc menu_close {name} { pdtk_canvas_checkgeometry $name ! pd [concat $name menuclose ;] }
--- 572,581 ---- proc menu_close {name} { pdtk_canvas_checkgeometry $name ! pd [concat $name menuclose 0 ;] ! } ! ! proc menu_really_close {name} { ! pdtk_canvas_checkgeometry $name ! pd [concat $name menuclose 1 ;] }
*************** *** 1548,1551 **** --- 1561,1565 ---- if {$shift == 1} { if {$key == "q" || $key == "Q"} {menu_really_quit} + if {$key == "w" || $key == "W"} {menu_really_close $topname} if {$key == "s" || $key == "S"} {menu_saveas $topname} if {$key == "z" || $key == "Z"} {menu_redo $topname} *************** *** 3262,3265 **** --- 3276,3289 ---- menu_addstd .mbar
+ global pd_nt + if {$pd_nt == 2} { + global pd_macdropped pd_macready + set pd_macready 1 + foreach file $pd_macdropped { + pd [concat pd open [pdtk_enquote [file tail $file]] \ + [pdtk_enquote [file dirname $file]] ;] + menu_doc_open [file dirname $file] [file tail $file] + } + } }
*************** *** 4200,4201 **** --- 4224,4226 ---- focus $id.f0 } +
Index: g_canvas.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_canvas.h,v retrieving revision 1.3.4.3.2.3 retrieving revision 1.3.4.3.2.4 diff -C2 -d -r1.3.4.3.2.3 -r1.3.4.3.2.4 *** g_canvas.h 12 Aug 2005 10:03:41 -0000 1.3.4.3.2.3 --- g_canvas.h 21 Aug 2005 11:28:24 -0000 1.3.4.3.2.4 *************** *** 372,376 **** EXTERN void gobj_properties(t_gobj *x, struct _glist *glist); EXTERN void gobj_save(t_gobj *x, t_binbuf *b); - EXTERN void gobj_redraw(t_gobj *gobj, t_glist *glist);
/* -------------------- functions on glists --------------------- */ --- 372,375 ---- *************** *** 407,411 **** EXTERN float glist_dpixtody(t_glist *x, float dypix);
- EXTERN void glist_redrawitem(t_glist *owner, t_gobj *gobj); EXTERN void glist_getnextxy(t_glist *gl, int *xval, int *yval); EXTERN void glist_glist(t_glist *g, t_symbol *s, int argc, t_atom *argv); --- 406,409 ---- *************** *** 542,553 **** EXTERN void linetraverser_skipobject(t_linetraverser *t);
- /* --------------------- functions on tscalars --------------------- */ - - EXTERN void tscalar_getrect(t_tscalar *x, t_glist *owner, - int *xp1, int *yp1, int *xp2, int *yp2); - EXTERN void tscalar_vis(t_tscalar *x, t_glist *owner, int flag); - EXTERN int tscalar_click(t_tscalar *x, int xpix, int ypix, int shift, - int alt, int dbl, int doit); - /* --------- functions on garrays (graphical arrays) -------------------- */
--- 540,543 ---- *************** *** 574,577 **** --- 564,568 ---- EXTERN void word_free(t_word *wp, t_template *tmpl); EXTERN void scalar_getbasexy(t_scalar *x, float *basex, float *basey); + EXTERN void scalar_redraw(t_scalar *x, t_glist *glist);
/* ------helper routines for "garrays" and "plots" -------------- */ *************** *** 612,616 **** EXTERN t_template *template_findbyname(t_symbol *s); EXTERN t_canvas *template_findcanvas(t_template *tmpl); ! EXTERN void template_notify(t_template *, t_symbol *s, int argc, t_atom *argv);
--- 603,607 ---- EXTERN t_template *template_findbyname(t_symbol *s); EXTERN t_canvas *template_findcanvas(t_template *tmpl); ! EXTERN void template_notify(t_template *template, t_symbol *s, int argc, t_atom *argv);
*************** *** 623,629 **** EXTERN void template_setsymbol(t_template *x, t_symbol *fieldname, t_word *wp, t_symbol *s, int loud); ! EXTERN t_float fielddesc_getcoord(t_fielddesc *f, t_template *, t_word *wp, int loud); ! EXTERN void fielddesc_setcoord(t_fielddesc *f, t_template *, t_word *wp, float pix, int loud); EXTERN t_float fielddesc_cvttocoord(t_fielddesc *f, float val); --- 614,620 ---- EXTERN void template_setsymbol(t_template *x, t_symbol *fieldname, t_word *wp, t_symbol *s, int loud); ! EXTERN t_float fielddesc_getcoord(t_fielddesc *f, t_template *template, t_word *wp, int loud); ! EXTERN void fielddesc_setcoord(t_fielddesc *f, t_template *template, t_word *wp, float pix, int loud); EXTERN t_float fielddesc_cvttocoord(t_fielddesc *f, float val);
Index: g_canvas.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_canvas.c,v retrieving revision 1.4.4.1.2.5 retrieving revision 1.4.4.1.2.6 diff -C2 -d -r1.4.4.1.2.5 -r1.4.4.1.2.6 *** g_canvas.c 25 Jul 2005 18:21:28 -0000 1.4.4.1.2.5 --- g_canvas.c 21 Aug 2005 11:28:24 -0000 1.4.4.1.2.6 *************** *** 417,420 **** --- 417,432 ---- x->gl_loading = 1; x->gl_goprect = 0; /* no GOP rectangle unless it's turned on later */ + /* cancel "vis" flag if we're a subpatch of an + abstraction inside another patch. A separate mechanism prevents + the toplevel abstraction from showing up. */ + if (vis && gensym("#X")->s_thing && + ((*gensym("#X")->s_thing) == canvas_class)) + { + t_canvas *zzz = (t_canvas *)(gensym("#X")->s_thing); + while (zzz && !zzz->gl_env) + zzz = zzz->gl_owner; + if (zzz && canvas_isabstraction(zzz) && zzz->gl_owner) + vis = 0; + } x->gl_willvis = vis; x->gl_edit = !strncmp(x->gl_name->s_name, "Untitled", 8); *************** *** 1358,1370 **** }
- /* LATER replace this with a queueing scheme */ - void glist_redrawitem(t_glist *owner, t_gobj *gobj) - { - if (glist_isvisible(owner)) - { - gobj_vis(gobj, owner, 0); - gobj_vis(gobj, owner, 1); - } - }
/* redraw all "scalars" (do this if a drawing command is changed.) --- 1370,1373 ---- *************** *** 1390,1394 **** gobj_vis(g, gl, 0); } ! else glist_redrawitem(gl, g); } else if (g->g_pd == canvas_class) --- 1393,1397 ---- gobj_vis(g, gl, 0); } ! else scalar_redraw((t_scalar *)g, gl); } else if (g->g_pd == canvas_class)
Index: m_imp.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_imp.h,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.1.2.1 diff -C2 -d -r1.3.4.1 -r1.3.4.1.2.1 *** m_imp.h 5 Nov 2004 13:57:56 -0000 1.3.4.1 --- m_imp.h 21 Aug 2005 11:28:24 -0000 1.3.4.1.2.1 *************** *** 79,83 **** EXTERN void glob_evalfile(t_pd *ignore, t_symbol *name, t_symbol *dir); EXTERN void glob_initfromgui(void *dummy, t_symbol *s, int argc, t_atom *argv); ! #define __m_imp_h_ #endif /* __m_imp_h_ */ --- 79,83 ---- EXTERN void glob_evalfile(t_pd *ignore, t_symbol *name, t_symbol *dir); EXTERN void glob_initfromgui(void *dummy, t_symbol *s, int argc, t_atom *argv); ! EXTERN void glob_quit(void *dummy); #define __m_imp_h_ #endif /* __m_imp_h_ */
Index: g_vslider.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_vslider.c,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** g_vslider.c 6 Sep 2004 20:20:34 -0000 1.4 --- g_vslider.c 21 Aug 2005 11:28:24 -0000 1.4.8.1 *************** *** 31,36 **** /* widget helper functions */
! static void vslider_draw_update(t_vslider *x, t_glist *glist) { if (glist_isvisible(glist)) { --- 31,37 ---- /* widget helper functions */
! static void vslider_draw_update(t_gobj *client, t_glist *glist) { + t_vslider *x = (t_vslider *)client; if (glist_isvisible(glist)) { *************** *** 175,179 **** { if(mode == IEM_GUI_DRAW_MODE_UPDATE) ! vslider_draw_update(x, glist); else if(mode == IEM_GUI_DRAW_MODE_MOVE) vslider_draw_move(x, glist); --- 176,180 ---- { if(mode == IEM_GUI_DRAW_MODE_UPDATE) ! sys_queuegui(x, glist, vslider_draw_update); else if(mode == IEM_GUI_DRAW_MODE_MOVE) vslider_draw_move(x, glist);
Index: x_list.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/x_list.c,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** x_list.c 4 Aug 2005 09:32:01 -0000 1.2.2.2 --- x_list.c 21 Aug 2005 11:28:24 -0000 1.2.2.3 *************** *** 5,9 **** --- 5,14 ---- #include "m_pd.h" /* #include <string.h> */ + #ifdef MSW + #include <malloc.h> + #else #include <alloca.h> + #endif + extern t_pd *newest;
Index: g_vumeter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_vumeter.c,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** g_vumeter.c 6 Sep 2004 20:20:35 -0000 1.4 --- g_vumeter.c 21 Aug 2005 11:28:24 -0000 1.4.8.1 *************** *** 77,80 **** --- 77,95 ---- }
+ static void vu_draw_update(t_gobj *client, t_glist *glist) + { + t_vu *x = (t_vu *)client; + if (x->x_updaterms) + { + vu_update_rms(x, glist); + x->x_updaterms = 0; + } + if (x->x_updatepeak) + { + vu_update_peak(x, glist); + x->x_updatepeak = 0; + } + } + static void vu_draw_new(t_vu *x, t_glist *glist) { *************** *** 152,155 **** --- 167,172 ---- x, 1); } + x->x_updaterms = x->x_updatepeak = 1; + sys_queuegui(x, x->x_gui.x_glist, vu_draw_update); }
*************** *** 186,191 **** canvas, x, i, end, yyy+k3); } ! vu_update_peak(x, glist); ! vu_update_rms(x, glist); sys_vgui(".x%lx.c coords %lxLABEL %d %d\n", canvas, x, xpos+x->x_gui.x_ldx, --- 203,208 ---- canvas, x, i, end, yyy+k3); } ! x->x_updaterms = x->x_updatepeak = 1; ! sys_queuegui(x, glist, vu_draw_update); sys_vgui(".x%lx.c coords %lxLABEL %d %d\n", canvas, x, xpos+x->x_gui.x_ldx, *************** *** 573,577 **** x->x_fr = rms; outlet_float(x->x_out_rms, rms); ! vu_update_rms(x, x->x_gui.x_glist); }
--- 590,595 ---- x->x_fr = rms; outlet_float(x->x_out_rms, rms); ! x->x_updaterms = 1; ! sys_queuegui(x, x->x_gui.x_glist, vu_draw_update); }
*************** *** 592,597 **** peak = 0.01*(float)(i - 10000); x->x_fp = peak; outlet_float(x->x_out_peak, peak); - vu_update_peak(x, x->x_gui.x_glist); }
--- 610,616 ---- peak = 0.01*(float)(i - 10000); x->x_fp = peak; + x->x_updatepeak = 1; + sys_queuegui(x, x->x_gui.x_glist, vu_draw_update); outlet_float(x->x_out_peak, peak); }
*************** *** 600,605 **** outlet_float(x->x_out_peak, x->x_fp); outlet_float(x->x_out_rms, x->x_fr); ! vu_update_rms(x, x->x_gui.x_glist); ! vu_update_peak(x, x->x_gui.x_glist); }
--- 619,624 ---- outlet_float(x->x_out_peak, x->x_fp); outlet_float(x->x_out_rms, x->x_fr); ! x->x_updaterms = x->x_updatepeak = 1; ! sys_queuegui(x, x->x_gui.x_glist, vu_draw_update); }
Index: g_template.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_template.c,v retrieving revision 1.4.8.3 retrieving revision 1.4.8.4 diff -C2 -d -r1.4.8.3 -r1.4.8.4 *** g_template.c 2 Aug 2005 21:25:04 -0000 1.4.8.3 --- g_template.c 21 Aug 2005 11:28:24 -0000 1.4.8.4 *************** *** 435,439 **** for (j = 0; j < nfrom; j++) if (!conformedfrom[j] && ! dataslot_matches(dataslot, &tfrom->t_vec[j], 1)) { conformaction[i] = j; --- 435,439 ---- for (j = 0; j < nfrom; j++) if (!conformedfrom[j] && ! dataslot_matches(dataslot, &tfrom->t_vec[j], 0)) { conformaction[i] = j; *************** *** 483,486 **** --- 483,501 ---- }
+ #if 0 + /* bash the first of (argv) with a pointer to a scalar, and send on + to template as a notification message */ + static void template_notifyforscalar(t_template *template, t_glist *owner, + t_scalar *sc, t_symbol *s, int argc, t_atom *argv) + { + t_gpointer gp; + gpointer_init(&gp); + gpointer_setglist(&gp, owner, x); + SETPOINTER(argv, &gp); + template_notify(template, s, argc, argv); + gpointer_unset(&gp); + } + #endif + /* call this when reading a patch from a file to declare what templates we'll need. If there's already a template, check if it matches. *************** *** 946,951 **** --- 961,968 ---- t_fielddesc x_outlinecolor; t_fielddesc x_width; + t_fielddesc x_vis; int x_npoints; t_fielddesc *x_vec; + t_canvas *x_canvas; } t_curve;
*************** *** 957,970 **** int nxy, i; t_fielddesc *fd; if (classname[0] == 'f') { classname += 6; flags |= CLOSED; - if (argc) fielddesc_setfloatarg(&x->x_fillcolor, argc--, argv++); - else fielddesc_setfloat_const(&x->x_outlinecolor, 0); } else classname += 4; if (classname[0] == 'c') flags |= BEZ; x->x_flags = flags; if (argc) fielddesc_setfloatarg(&x->x_outlinecolor, argc--, argv++); else fielddesc_setfloat_const(&x->x_outlinecolor, 0); --- 974,1000 ---- int nxy, i; t_fielddesc *fd; + x->x_canvas = canvas_getcurrent(); if (classname[0] == 'f') { classname += 6; flags |= CLOSED; } else classname += 4; if (classname[0] == 'c') flags |= BEZ; x->x_flags = flags; + fielddesc_setfloat_const(&x->x_vis, 1); + while (1) + { + t_symbol *firstarg = atom_getsymbolarg(0, argc, argv); + if (!strcmp(firstarg->s_name, "-v") && argc > 1) + { + fielddesc_setfloatarg(&x->x_vis, 1, argv+1); + argc -= 2; argv += 2; + } + else break; + } + if ((flags & CLOSED) && argc) + fielddesc_setfloatarg(&x->x_fillcolor, argc--, argv++); + else fielddesc_setfloat_const(&x->x_fillcolor, 0); if (argc) fielddesc_setfloatarg(&x->x_outlinecolor, argc--, argv++); else fielddesc_setfloat_const(&x->x_outlinecolor, 0); *************** *** 982,985 **** --- 1012,1032 ---- }
+ void curve_float(t_curve *x, t_floatarg f) + { + int viswas; + if (x->x_vis.fd_type != A_FLOAT || x->x_vis.fd_var) + { + pd_error(x, "global vis/invis for a template with variable visibility"); + return; + } + viswas = (x->x_vis.fd_un.fd_float != 0); + + if ((f != 0 && viswas) || (f == 0 && !viswas)) + return; + canvas_redrawallfortemplatecanvas(x->x_canvas, 2); + fielddesc_setfloat_const(&x->x_vis, (f != 0)); + canvas_redrawallfortemplatecanvas(x->x_canvas, 1); + } + /* -------------------- widget behavior for curve ------------ */
*************** *** 992,995 **** --- 1039,1048 ---- t_fielddesc *f = x->x_vec; int x1 = 0x7fffffff, x2 = -0x7fffffff, y1 = 0x7fffffff, y2 = -0x7fffffff; + if (!fielddesc_getfloat(&x->x_vis, template, data, 0)) + { + *xp1 = *yp1 = 0x7fffffff; + *xp2 = *yp2 = -0x7fffffff; + return; + } for (i = 0, f = x->x_vec; i < n; i++, f += 2) { *************** *** 1057,1060 **** --- 1110,1115 ---- t_fielddesc *f = x->x_vec;
+ if (!fielddesc_getfloat(&x->x_vis, template, data, 0)) + return; if (vis) { *************** *** 1144,1148 **** } if (curve_motion_scalar) ! glist_redrawitem(curve_motion_glist, &curve_motion_scalar->sc_gobj); if (curve_motion_array) array_redraw(curve_motion_array, curve_motion_glist); --- 1199,1203 ---- } if (curve_motion_scalar) ! scalar_redraw(curve_motion_scalar, curve_motion_glist); if (curve_motion_array) array_redraw(curve_motion_array, curve_motion_glist); *************** *** 1159,1162 **** --- 1214,1219 ---- int besterror = 0x7fffffff; t_fielddesc *f; + if (!fielddesc_getfloat(&x->x_vis, template, data, 0)) + return (0); for (i = 0, f = x->x_vec; i < n; i++, f += 2) { *************** *** 1221,1225 **** { curve_class = class_new(gensym("drawpolygon"), (t_newmethod)curve_new, ! (t_method)curve_free, sizeof(t_curve), CLASS_NOINLET, A_GIMME, 0); class_setdrawcommand(curve_class); class_addcreator((t_newmethod)curve_new, gensym("drawcurve"), --- 1278,1282 ---- { curve_class = class_new(gensym("drawpolygon"), (t_newmethod)curve_new, ! (t_method)curve_free, sizeof(t_curve), 0, A_GIMME, 0); class_setdrawcommand(curve_class); class_addcreator((t_newmethod)curve_new, gensym("drawcurve"), *************** *** 1230,1233 **** --- 1287,1291 ---- A_GIMME, 0); class_setparentwidget(curve_class, &curve_widgetbehavior); + class_addfloat(curve_class, curve_float); }
*************** *** 1257,1261 **** { t_plot *x = (t_plot *)pd_new(plot_class); ! int defstyle = PLOTSTYLE_POLY, vis = 1, scalarvis = 1; x->x_canvas = canvas_getcurrent();
--- 1315,1319 ---- { t_plot *x = (t_plot *)pd_new(plot_class); ! int defstyle = PLOTSTYLE_POLY; x->x_canvas = canvas_getcurrent();
*************** *** 1264,1267 **** --- 1322,1327 ---- fielddesc_setfloat_var(&x->x_wpoints, gensym("w"));
+ fielddesc_setfloat_const(&x->x_vis, 1); + fielddesc_setfloat_const(&x->x_scalarvis, 1); while (1) { *************** *** 1273,1285 **** argc--, argv++; } ! else if (!strcmp(firstarg->s_name, "-n")) { ! vis = 0; ! argc--; argv++; } ! else if (!strcmp(firstarg->s_name, "-noscalar")) { ! scalarvis = 0; ! argc--; argv++; } else if (!strcmp(firstarg->s_name, "-x") && argc > 1) --- 1333,1345 ---- argc--, argv++; } ! else if (!strcmp(firstarg->s_name, "-v") && argc > 1) { ! fielddesc_setfloatarg(&x->x_vis, 1, argv+1); ! argc -= 2; argv += 2; } ! else if (!strcmp(firstarg->s_name, "-vs") && argc > 1) { ! fielddesc_setfloatarg(&x->x_scalarvis, 1, argv+1); ! argc -= 2; argv += 2; } else if (!strcmp(firstarg->s_name, "-x") && argc > 1) *************** *** 1314,1321 **** if (argc) fielddesc_setfloatarg(&x->x_style, argc--, argv++); else fielddesc_setfloat_const(&x->x_style, defstyle); - if (argc) fielddesc_setfloatarg(&x->x_vis, argc--, argv++); - else fielddesc_setfloat_const(&x->x_vis, vis); - if (argc) fielddesc_setfloatarg(&x->x_scalarvis, argc--, argv++); - else fielddesc_setfloat_const(&x->x_scalarvis, 1); return (x); } --- 1374,1377 ---- *************** *** 1469,1473 **** &xonset, &yonset, &wonset)) { ! for (i = 0, xsum = 0; i < array->a_n; i++) { float usexloc, useyloc; --- 1525,1531 ---- &xonset, &yonset, &wonset)) { ! /* if it has more than 2000 points, just check 1000 of them. */ ! int incr = (array->a_n <= 2000 ? 1 : array->a_n / 1000); ! for (i = 0, xsum = 0; i < array->a_n; i += incr) { float usexloc, useyloc; *************** *** 1687,1692 **** { sys_vgui("%d %f \\n", ixpix, glist_ytopixels(glist, ! basey + fielddesc_cvttocoord(yfielddesc, ! yloc + yval) + fielddesc_cvttocoord(wfielddesc, wval))); ndrawn++; --- 1745,1750 ---- { sys_vgui("%d %f \\n", ixpix, glist_ytopixels(glist, ! basey + yloc + fielddesc_cvttocoord(yfielddesc, ! yval) + fielddesc_cvttocoord(wfielddesc, wval))); ndrawn++; *************** *** 1700,1709 **** { sys_vgui("%d %f \\n", ixpix + 10, glist_ytopixels(glist, ! basey + fielddesc_cvttocoord(yfielddesc, ! yloc + yval) + fielddesc_cvttocoord(wfielddesc, wval))); sys_vgui("%d %f \\n", ixpix + 10, glist_ytopixels(glist, ! basey + fielddesc_cvttocoord(yfielddesc, ! yloc + yval) - fielddesc_cvttocoord(wfielddesc, wval))); } --- 1758,1767 ---- { sys_vgui("%d %f \\n", ixpix + 10, glist_ytopixels(glist, ! basey + yloc + fielddesc_cvttocoord(yfielddesc, ! yval) + fielddesc_cvttocoord(wfielddesc, wval))); sys_vgui("%d %f \\n", ixpix + 10, glist_ytopixels(glist, ! basey + yloc + fielddesc_cvttocoord(yfielddesc, ! yval) - fielddesc_cvttocoord(wfielddesc, wval))); } *************** *** 1739,1744 **** sys_vgui("%d %f \\n", ixpix, glist_ytopixels(glist, ! basey + fielddesc_cvttocoord(yfielddesc, ! yloc + yval))); ndrawn++; } --- 1797,1802 ---- sys_vgui("%d %f \\n", ixpix, glist_ytopixels(glist, ! basey + yloc + fielddesc_cvttocoord(yfielddesc, ! yval))); ndrawn++; } *************** *** 1749,1754 **** if (ndrawn == 0) sys_vgui("0 0 0 0 \\n"); else if (ndrawn == 1) sys_vgui("%d %f \\n", ixpix + 10, ! glist_ytopixels(glist, basey + ! fielddesc_cvttocoord(yfielddesc, yloc + yval)));
sys_vgui("-width %f\\n", linewidth); --- 1807,1812 ---- if (ndrawn == 0) sys_vgui("0 0 0 0 \\n"); else if (ndrawn == 1) sys_vgui("%d %f \\n", ixpix + 10, ! glist_ytopixels(glist, basey + yloc + ! fielddesc_cvttocoord(yfielddesc, yval)));
sys_vgui("-width %f\\n", linewidth); *************** *** 1775,1779 **** yval = *(float *)((elem + elemsize * i) + yonset); else yval = 0; ! useyloc = basey + fielddesc_cvttocoord(yfielddesc, yloc+yval); for (y = elemtemplatecanvas->gl_list; y; y = y->g_next) { --- 1833,1838 ---- yval = *(float *)((elem + elemsize * i) + yonset); else yval = 0; ! useyloc = basey + yloc + ! fielddesc_cvttocoord(yfielddesc, yval); for (y = elemtemplatecanvas->gl_list; y; y = y->g_next) { *************** *** 1856,1865 **** }
! /* ---------------- drawnumber: draw a number ---------------- */
/* drawnumbers draw numeric fields at controllable locations, with ! controllable color and label . ! invocation: (drawnumber|drawsymbol) variable x y color label */
--- 1915,1924 ---- }
! /* ---------------- drawnumber: draw a number (or symbol) ---------------- */
/* drawnumbers draw numeric fields at controllable locations, with ! controllable color and label. invocation: ! (drawnumber|drawsymbol) [-v <visible>] variable x y color label */
*************** *** 1871,1879 **** { t_object x_obj; - int x_vis; /* LATER incorporate into flags field below? */ t_fielddesc x_value; t_fielddesc x_xloc; t_fielddesc x_yloc; t_fielddesc x_color; t_symbol *x_label; int x_flags; --- 1930,1938 ---- { t_object x_obj; t_fielddesc x_value; t_fielddesc x_xloc; t_fielddesc x_yloc; t_fielddesc x_color; + t_fielddesc x_vis; t_symbol *x_label; int x_flags; *************** *** 1890,1902 **** flags |= DRAW_SYMBOL; x->x_flags = flags; ! x->x_vis = 1; x->x_canvas = canvas_getcurrent(); while (1) { t_symbol *firstarg = atom_getsymbolarg(0, argc, argv); ! if (!strcmp(firstarg->s_name, "-n")) { ! x->x_vis = 0; ! argc--; argv++; } else break; --- 1949,1961 ---- flags |= DRAW_SYMBOL; x->x_flags = flags; ! fielddesc_setfloat_const(&x->x_vis, 1); x->x_canvas = canvas_getcurrent(); while (1) { t_symbol *firstarg = atom_getsymbolarg(0, argc, argv); ! if (!strcmp(firstarg->s_name, "-v") && argc > 1) { ! fielddesc_setfloatarg(&x->x_vis, 1, argv+1); ! argc -= 2; argv += 2; } else break; *************** *** 1906,1910 **** if (argc) fielddesc_setsymbolarg(&x->x_value, argc--, argv++); else fielddesc_setsymbol_const(&x->x_value, &s_); - } else --- 1965,1968 ---- *************** *** 1928,1935 **** void drawnumber_float(t_drawnumber *x, t_floatarg f) { ! if ((f != 0 && x->x_vis) || (f == 0 && !x->x_vis)) return; canvas_redrawallfortemplatecanvas(x->x_canvas, 2); ! x->x_vis = (f!= 0); canvas_redrawallfortemplatecanvas(x->x_canvas, 1); } --- 1986,2001 ---- void drawnumber_float(t_drawnumber *x, t_floatarg f) { ! int viswas; ! if (x->x_vis.fd_type != A_FLOAT || x->x_vis.fd_var) ! { ! pd_error(x, "global vis/invis for a template with variable visibility"); ! return; ! } ! viswas = (x->x_vis.fd_un.fd_float != 0); ! ! if ((f != 0 && viswas) || (f == 0 && !viswas)) return; canvas_redrawallfortemplatecanvas(x->x_canvas, 2); ! fielddesc_setfloat_const(&x->x_vis, (f != 0)); canvas_redrawallfortemplatecanvas(x->x_canvas, 1); } *************** *** 1953,1957 **** t_drawnumber *x = (t_drawnumber *)z; t_atom at; ! if (!x->x_vis) { *xp1 = *yp1 = 0x7fffffff; --- 2019,2026 ---- t_drawnumber *x = (t_drawnumber *)z; t_atom at; ! int xloc, yloc, font, fontwidth, fontheight; ! char buf[DRAWNUMBER_BUFSIZE]; ! ! if (!fielddesc_getfloat(&x->x_vis, template, data, 0)) { *xp1 = *yp1 = 0x7fffffff; *************** *** 1959,1969 **** return; } ! int xloc = glist_xtopixels(glist, basex + fielddesc_getfloat(&x->x_xloc, template, data, 0)); ! int yloc = glist_ytopixels(glist, basey + fielddesc_getfloat(&x->x_yloc, template, data, 0)); ! int font = glist_getfont(glist); ! int fontwidth = sys_fontwidth(font), fontheight = sys_fontheight(font); ! char buf[DRAWNUMBER_BUFSIZE]; if (x->x_flags & DRAW_SYMBOL) SETSYMBOL(&at, fielddesc_getsymbol(&x->x_value, template, data, 0)); --- 2028,2038 ---- return; } ! xloc = glist_xtopixels(glist, basex + fielddesc_getfloat(&x->x_xloc, template, data, 0)); ! yloc = glist_ytopixels(glist, basey + fielddesc_getfloat(&x->x_yloc, template, data, 0)); ! font = glist_getfont(glist); ! fontwidth = sys_fontwidth(font); ! fontheight = sys_fontheight(font); if (x->x_flags & DRAW_SYMBOL) SETSYMBOL(&at, fielddesc_getsymbol(&x->x_value, template, data, 0)); *************** *** 2004,2008 **** t_drawnumber *x = (t_drawnumber *)z;
! if (!x->x_vis) return; if (vis) --- 2073,2077 ---- t_drawnumber *x = (t_drawnumber *)z;
! if (!fielddesc_getfloat(&x->x_vis, template, data, 0)) return; if (vis) *************** *** 2050,2055 **** 1); if (drawnumber_motion_scalar) ! glist_redrawitem(drawnumber_motion_glist, ! &drawnumber_motion_scalar->sc_gobj); if (drawnumber_motion_array) array_redraw(drawnumber_motion_array, drawnumber_motion_glist); --- 2119,2123 ---- 1); if (drawnumber_motion_scalar) ! scalar_redraw(drawnumber_motion_scalar, drawnumber_motion_glist); if (drawnumber_motion_array) array_redraw(drawnumber_motion_array, drawnumber_motion_glist); *************** *** 2067,2071 **** &x1, &y1, &x2, &y2); if (xpix >= x1 && xpix <= x2 && ypix >= y1 && ypix <= y2 ! && x->x_value.fd_var && x->x_vis) { if (doit) --- 2135,2140 ---- &x1, &y1, &x2, &y2); if (xpix >= x1 && xpix <= x2 && ypix >= y1 && ypix <= y2 ! && x->x_value.fd_var && ! fielddesc_getfloat(&x->x_vis, template, data, 0)) { if (doit)
Index: g_traversal.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_traversal.c,v retrieving revision 1.2.8.3 retrieving revision 1.2.8.4 diff -C2 -d -r1.2.8.3 -r1.2.8.4 *** g_traversal.c 2 Aug 2005 21:25:05 -0000 1.2.8.3 --- g_traversal.c 21 Aug 2005 11:28:24 -0000 1.2.8.4 *************** *** 274,278 **** ptrobj_vnext(x, 0); } - static void ptrobj_sendwindow(t_ptrobj *x, t_symbol *s, int argc, t_atom *argv) { --- 274,277 ---- *************** *** 335,338 **** --- 334,363 ---- }
+ + static void ptrobj_rewind(t_ptrobj *x) + { + t_scalar *sc; + t_symbol *templatesym; + int n; + t_typedout *to; + t_glist *glist; + t_pd *canvas; + t_gstub *gs; + if (!gpointer_check(&x->x_gp, 1)) + { + pd_error(x, "pointer_rewind: empty pointer"); + return; + } + gs = x->x_gp.gp_stub; + if (gs->gs_which != GP_GLIST) + { + pd_error(x, "pointer_rewind: sorry, unavailable for arrays"); + return; + } + glist = gs->gs_un.gs_glist; + gpointer_setglist(&x->x_gp, glist, 0); + ptrobj_bang(x); + } + static void ptrobj_free(t_ptrobj *x) { *************** *** 352,355 **** --- 377,382 ---- class_addmethod(ptrobj_class, (t_method)ptrobj_sendwindow, gensym("send-window"), A_GIMME, 0); + class_addmethod(ptrobj_class, (t_method)ptrobj_rewind, + gensym("rewind"), 0); class_addpointer(ptrobj_class, ptrobj_pointer); class_addbang(ptrobj_class, ptrobj_bang); *************** *** 542,546 **** template_setfloat(template, vp->gv_sym, vec, vp->gv_w.w_float, 1); if (gs->gs_which == GP_GLIST) ! glist_redrawitem(gs->gs_un.gs_glist, (t_gobj *)(gp->gp_un.gp_scalar)); else { --- 569,573 ---- template_setfloat(template, vp->gv_sym, vec, vp->gv_w.w_float, 1); if (gs->gs_which == GP_GLIST) ! scalar_redraw(gp->gp_un.gp_scalar, gs->gs_un.gs_glist); else { *************** *** 548,553 **** while (owner_array->a_gp.gp_stub->gs_which == GP_ARRAY) owner_array = owner_array->a_gp.gp_stub->gs_un.gs_array; ! glist_redrawitem(owner_array->a_gp.gp_stub->gs_un.gs_glist, ! (t_gobj *)(owner_array->a_gp.gp_un.gp_scalar)); } } --- 575,580 ---- while (owner_array->a_gp.gp_stub->gs_which == GP_ARRAY) owner_array = owner_array->a_gp.gp_stub->gs_un.gs_array; ! scalar_redraw(owner_array->a_gp.gp_un.gp_scalar, ! owner_array->a_gp.gp_stub->gs_un.gs_glist); } } *************** *** 1021,1025 **** }
! glist_redrawitem(glist, (t_gobj *)sc);
outlet_pointer(x->x_obj.ob_outlet, gp); --- 1048,1052 ---- }
! scalar_redraw(sc, glist);
outlet_pointer(x->x_obj.ob_outlet, gp);
Index: g_hdial.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_hdial.c,v retrieving revision 1.4.4.1 retrieving revision 1.4.4.1.2.1 diff -C2 -d -r1.4.4.1 -r1.4.4.1.2.1 *** g_hdial.c 11 Nov 2004 22:30:41 -0000 1.4.4.1 --- g_hdial.c 21 Aug 2005 11:28:24 -0000 1.4.4.1.2.1 *************** *** 32,37 **** /* widget helper functions */
! void hradio_draw_update(t_hradio *x, t_glist *glist) { if(glist_isvisible(glist)) { --- 32,38 ---- /* widget helper functions */
! void hradio_draw_update(t_gobj *client, t_glist *glist) { + t_hradio *x = (t_hradio *)client; if(glist_isvisible(glist)) { *************** *** 39,47 ****
sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -outline #%6.6x\n", ! canvas, x, x->x_on_old, x->x_gui.x_bcol, x->x_gui.x_bcol); sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -outline #%6.6x\n", canvas, x, x->x_on, x->x_gui.x_fcol, x->x_gui.x_fcol); } } --- 40,49 ----
sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -outline #%6.6x\n", ! canvas, x, x->x_drawn, x->x_gui.x_bcol, x->x_gui.x_bcol); sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -outline #%6.6x\n", canvas, x, x->x_on, x->x_gui.x_fcol, x->x_gui.x_fcol); + x->x_drawn = x->x_on; } } *************** *** 69,72 **** --- 71,75 ---- xx21 += dx; xx22 += dx; + x->x_drawn = x->x_on; } sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ *************** *** 205,209 **** { if(mode == IEM_GUI_DRAW_MODE_UPDATE) ! hradio_draw_update(x, glist); else if(mode == IEM_GUI_DRAW_MODE_MOVE) hradio_draw_move(x, glist); --- 208,212 ---- { if(mode == IEM_GUI_DRAW_MODE_UPDATE) ! sys_queuegui(x, glist, hradio_draw_update); else if(mode == IEM_GUI_DRAW_MODE_MOVE) hradio_draw_move(x, glist);
Index: g_all_guis.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_all_guis.c,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.1.2.1 diff -C2 -d -r1.5.4.1 -r1.5.4.1.2.1 *** g_all_guis.c 2 Jan 2005 14:49:24 -0000 1.5.4.1 --- g_all_guis.c 21 Aug 2005 11:28:24 -0000 1.5.4.1.2.1 *************** *** 525,529 **** --- 525,532 ---- (*x->x_gui.x_draw)((void *)z, glist, IEM_GUI_DRAW_MODE_NEW); else + { (*x->x_gui.x_draw)((void *)z, glist, IEM_GUI_DRAW_MODE_ERASE); + sys_unqueuegui(z); + } }
Index: g_all_guis.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_all_guis.h,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** g_all_guis.h 6 Sep 2004 20:20:33 -0000 1.4 --- g_all_guis.h 21 Aug 2005 11:28:24 -0000 1.4.8.1 *************** *** 199,205 **** t_iemgui x_gui; int x_on; ! int x_on_old; int x_change; int x_number; t_atom x_at[2]; } t_hdial; --- 199,206 ---- t_iemgui x_gui; int x_on; ! int x_on_old; /* LATER delete this; it's used for old version */ int x_change; int x_number; + int x_drawn; t_atom x_at[2]; } t_hdial; *************** *** 243,246 **** --- 244,249 ---- void *x_out_rms; void *x_out_peak; + unsigned int x_updaterms:1; + unsigned int x_updatepeak:1; } t_vu;
*************** *** 267,270 **** --- 270,274 ---- int x_change; int x_number; + int x_drawn; t_atom x_at[2]; } t_vdial;
Index: d_soundfile.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_soundfile.c,v retrieving revision 1.4.4.11.2.3 retrieving revision 1.4.4.11.2.4 diff -C2 -d -r1.4.4.11.2.3 -r1.4.4.11.2.4 *** d_soundfile.c 2 Aug 2005 21:25:03 -0000 1.4.4.11.2.3 --- d_soundfile.c 21 Aug 2005 11:28:24 -0000 1.4.4.11.2.4 *************** *** 2920,2930 **** x->x_fileerror = 0;
! /* if there's already a file open, close it */ if (x->x_fd >= 0) { pthread_mutex_unlock(&x->x_mutex); ! close (x->x_fd); pthread_mutex_lock(&x->x_mutex); x->x_fd = -1; if (x->x_requestcode != REQUEST_BUSY) continue; --- 2920,2951 ---- x->x_fileerror = 0;
! /* if there's already a file open, close it. This ! should never happen since writesf_open() calls stop if ! needed and then waits until we're idle. */ if (x->x_fd >= 0) { + int bytesperframe = x->x_bytespersample * x->x_sfchannels; + int bigendian = x->x_bigendian; + char *filename = x->x_filename; + int fd = x->x_fd; + int filetype = x->x_filetype; + int itemswritten = x->x_itemswritten; + int swap = x->x_swap; pthread_mutex_unlock(&x->x_mutex); ! ! soundfile_finishwrite(x, filename, fd, ! filetype, 0x7fffffff, itemswritten, ! bytesperframe, swap); ! close (fd); ! pthread_mutex_lock(&x->x_mutex); x->x_fd = -1; + #ifdef DEBUG_SOUNDFILE + { + char s[1000]; + sprintf(s, "bug??? ditched %d\n", itemswritten); + pute(s); + } + #endif if (x->x_requestcode != REQUEST_BUSY) continue; *************** *** 3031,3037 **** x->x_itemswritten += sysrtn / (x->x_bytespersample * x->x_sfchannels); - sprintf(boo, "after: head %d, tail %d\n", - x->x_fifohead, x->x_fifotail); #ifdef DEBUG_SOUNDFILE pute(boo); #endif --- 3052,3058 ---- x->x_itemswritten += sysrtn / (x->x_bytespersample * x->x_sfchannels); #ifdef DEBUG_SOUNDFILE + sprintf(boo, "after: head %d, tail %d written %d\n", + x->x_fifohead, x->x_fifotail, x->x_itemswritten); pute(boo); #endif *************** *** 3213,3216 **** --- 3234,3241 ---- long onset, nframes; float samplerate; + if (x->x_state != STATE_IDLE) + { + writesf_stop(x); + } if (soundfiler_writeargparse(x, &argc, &argv, &filesym, &filetype, &bytespersamp, &swap, &bigendian, *************** *** 3226,3229 **** --- 3251,3259 ---- pd_error(x, "extra argument(s) to writesf~: ignored"); pthread_mutex_lock(&x->x_mutex); + while (x->x_requestcode != REQUEST_NOTHING) + { + sfread_cond_signal(&x->x_requestcondition); + sfread_cond_wait(&x->x_answercondition, &x->x_mutex); + } x->x_bytespersample = bytespersamp; x->x_swap = swap;
Index: d_misc.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_misc.c,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -C2 -d -r1.2 -r1.2.8.1 *** d_misc.c 6 Sep 2004 20:20:33 -0000 1.2 --- d_misc.c 21 Aug 2005 11:28:24 -0000 1.2.8.1 *************** *** 225,233 **** { t_object x_obj; } t_samplerate;
static void samplerate_tilde_bang(t_samplerate *x) { ! outlet_float(x->x_obj.ob_outlet, sys_getsr()); }
--- 225,246 ---- { t_object x_obj; + float x_sr; } t_samplerate;
static void samplerate_tilde_bang(t_samplerate *x) { ! if (!canvas_dspstate) ! { ! post( ! "NB: samplerate~ momentarily started DSP to learn sample rate"); ! canvas_resume_dsp(1); ! canvas_suspend_dsp(); ! } ! outlet_float(x->x_obj.ob_outlet, x->x_sr); ! } ! ! static void samplerate_tilde_dsp(t_samplerate *x, t_signal **sp) ! { ! x->x_sr = sp[0]->s_sr; }
*************** *** 244,247 **** --- 257,262 ---- (t_newmethod)samplerate_tilde_new, 0, sizeof(t_samplerate), 0, 0); class_addbang(samplerate_tilde_class, samplerate_tilde_bang); + class_addmethod(samplerate_tilde_class, (t_method)samplerate_tilde_dsp, + gensym("dsp"), A_CANT, 0); }
Index: g_hslider.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_hslider.c,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** g_hslider.c 6 Sep 2004 20:20:33 -0000 1.4 --- g_hslider.c 21 Aug 2005 11:28:24 -0000 1.4.8.1 *************** *** 31,36 **** /* widget helper functions */
! static void hslider_draw_update(t_hslider *x, t_glist *glist) { t_canvas *canvas=glist_getcanvas(glist); int ypos=text_ypix(&x->x_gui.x_obj, glist); --- 31,37 ---- /* widget helper functions */
! static void hslider_draw_update(t_gobj *client, t_glist *glist) { + t_hslider *x = (t_hslider *)client; t_canvas *canvas=glist_getcanvas(glist); int ypos=text_ypix(&x->x_gui.x_obj, glist); *************** *** 183,187 **** { if(mode == IEM_GUI_DRAW_MODE_UPDATE) ! hslider_draw_update(x, glist); else if(mode == IEM_GUI_DRAW_MODE_MOVE) hslider_draw_move(x, glist); --- 184,188 ---- { if(mode == IEM_GUI_DRAW_MODE_UPDATE) ! sys_queuegui(x, glist, hslider_draw_update); else if(mode == IEM_GUI_DRAW_MODE_MOVE) hslider_draw_move(x, glist);
Index: g_text.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_text.c,v retrieving revision 1.5.4.2.2.4 retrieving revision 1.5.4.2.2.5 diff -C2 -d -r1.5.4.2.2.4 -r1.5.4.2.2.5 *** g_text.c 2 Aug 2005 21:25:05 -0000 1.5.4.2.2.4 --- g_text.c 21 Aug 2005 11:28:24 -0000 1.5.4.2.2.5 *************** *** 348,355 **** static void message_adddollar(t_message *x, t_floatarg f) { int n = f; if (n < 0) n = 0; - t_atom a; SETDOLLAR(&a, n); binbuf_add(x->m_text.te_binbuf, 1, &a); --- 348,355 ---- static void message_adddollar(t_message *x, t_floatarg f) { + t_atom a; int n = f; if (n < 0) n = 0; SETDOLLAR(&a, n); binbuf_add(x->m_text.te_binbuf, 1, &a);
Index: s_main.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.7.4.17.2.5 retrieving revision 1.7.4.17.2.6 diff -C2 -d -r1.7.4.17.2.5 -r1.7.4.17.2.6 *** s_main.c 2 Aug 2005 21:25:05 -0000 1.7.4.17.2.5 --- s_main.c 21 Aug 2005 11:28:24 -0000 1.7.4.17.2.6 *************** *** 8,12 **** */
! char pd_version[] = "Pd version 0.39 TEST 4b devel\n"; char pd_compiletime[] = __TIME__; char pd_compiledate[] = __DATE__; --- 8,12 ---- */
! char pd_version[] = "Pd version 0.39 TEST 5 devel\n"; char pd_compiletime[] = __TIME__; char pd_compiledate[] = __DATE__;
Index: g_array.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_array.c,v retrieving revision 1.3.4.4.2.3 retrieving revision 1.3.4.4.2.4 diff -C2 -d -r1.3.4.4.2.3 -r1.3.4.4.2.4 *** g_array.c 12 Aug 2005 10:03:41 -0000 1.3.4.4.2.3 --- g_array.c 21 Aug 2005 11:28:24 -0000 1.3.4.4.2.4 *************** *** 428,431 **** --- 428,439 ---- x->x_realname = canvas_realizedollar(x->x_glist, argname); pd_bind(&x->x_gobj.g_pd, x->x_realname); + /* redraw the whole glist, just so the name change shows up */ + if (x->x_glist->gl_havewindow) + canvas_redraw(x->x_glist); + else if (glist_isvisible(x->x_glist->gl_owner)) + { + gobj_vis(&x->x_glist->gl_gobj, x->x_glist->gl_owner, 0); + gobj_vis(&x->x_glist->gl_gobj, x->x_glist->gl_owner, 1); + } } size = fsize; *************** *** 447,451 **** void garray_arrayviewlist_new(t_garray *x) { ! int i, xonset, yonset, type, elemsize; float yval; char cmdbuf[200]; --- 455,459 ---- void garray_arrayviewlist_new(t_garray *x) { ! int i, xonset=0, yonset=0, type=0, elemsize=0; float yval; char cmdbuf[200]; *************** *** 479,483 **** t_float page) { ! int i, xonset, yonset, type, elemsize; float yval; char cmdbuf[200]; --- 487,491 ---- t_float page) { ! int i, xonset=0, yonset=0, type=0, elemsize=0; float yval; char cmdbuf[200]; *************** *** 551,555 **** while (a->a_gp.gp_stub->gs_which == GP_ARRAY) a = a->a_gp.gp_stub->gs_un.gs_array; ! gobj_redraw(&a->a_gp.gp_un.gp_scalar->sc_gobj, glist); }
--- 559,563 ---- while (a->a_gp.gp_stub->gs_which == GP_ARRAY) a = a->a_gp.gp_stub->gs_un.gs_array; ! scalar_redraw(a->a_gp.gp_un.gp_scalar, glist); }
*************** *** 614,618 **** if (array_motion_xfield) { ! /* it's an x, y plot; can drag many points at once */ int i; for (i = 0; i < array_motion_npoints; i++) --- 622,626 ---- if (array_motion_xfield) { ! /* it's an x, y plot */ int i; for (i = 0; i < array_motion_npoints; i++) *************** *** 652,656 **** { /* a y-only plot. */ ! int thisx = array_motion_initx + array_motion_xcumulative, x2; int increment, i, nchange; float newy = array_motion_ycumulative, --- 660,664 ---- { /* a y-only plot. */ ! int thisx = array_motion_initx + array_motion_xcumulative + 0.5, x2; int increment, i, nchange; float newy = array_motion_ycumulative, *************** *** 679,684 **** } if (array_motion_scalar) ! sys_queuegui(&array_motion_scalar->sc_gobj, ! array_motion_glist, gobj_redraw); if (array_motion_array) array_redraw(array_motion_array, array_motion_glist); --- 687,691 ---- } if (array_motion_scalar) ! scalar_redraw(array_motion_scalar, array_motion_glist); if (array_motion_array) array_redraw(array_motion_array, array_motion_glist); *************** *** 702,705 **** --- 709,713 ---- t_template *elemtemplate; int elemsize, yonset, wonset, xonset, i, incr, hit; + float xsum;
if (elemtemplatesym == &s_float) *************** *** 713,722 **** incr = 1; else incr = array->a_n / 300; ! for (i = 0; i < array->a_n; i += incr) { if (hit = scalar_doclick( (t_word *)((char *)(array->a_vec) + i * elemsize), elemtemplate, 0, array, ! glist, xloc, yloc, xpix, ypix, shift, alt, dbl, doit)) return (hit); } --- 721,739 ---- incr = 1; else incr = array->a_n / 300; ! for (i = 0, xsum = 0; i < array->a_n; i += incr) { + float usexloc, useyloc; + if (xonset >= 0) + usexloc = xloc + fielddesc_cvttocoord(xfield, + *(float *)(((char *)(array->a_vec) + elemsize * i) + xonset)); + else usexloc = xloc + xsum, xsum += xinc; + useyloc = yloc + (yonset >= 0 ? fielddesc_cvttocoord(yfield, + *(float *)(((char *)(array->a_vec) + elemsize * i) + yonset)) : 0); + if (hit = scalar_doclick( (t_word *)((char *)(array->a_vec) + i * elemsize), elemtemplate, 0, array, ! glist, usexloc, useyloc, ! xpix, ypix, shift, alt, dbl, doit)) return (hit); } *************** *** 741,749 **** { float best = 100; ! int incr; ! /* if it has more than 2000 points, just check 300 of them. */ ! if (array->a_n < 2000) ! incr = 1; ! else incr = array->a_n / 300; for (i = 0; i < array->a_n; i += incr) { --- 758,763 ---- { float best = 100; ! /* if it has more than 2000 points, just check 1000 of them. */ ! int incr = (array->a_n <= 2000 ? 1 : array->a_n / 1000); for (i = 0; i < array->a_n; i += incr) { *************** *** 849,854 **** fielddesc_getcoord(xfield, array_motion_template, (t_word *)(elem + i * elemsize), 1); ! array_motion_wp = (t_word *)(elem + i * elemsize); ! array_motion_npoints = array->a_n - i; } else --- 863,870 ---- fielddesc_getcoord(xfield, array_motion_template, (t_word *)(elem + i * elemsize), 1); ! array_motion_wp = (t_word *)(elem + i * elemsize); ! if (shift) ! array_motion_npoints = array->a_n - i; ! else array_motion_npoints = 1; } else
Index: s_midi_alsa.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_midi_alsa.c,v retrieving revision 1.1.2.2.2.2 retrieving revision 1.1.2.2.2.3 diff -C2 -d -r1.1.2.2.2.2 -r1.1.2.2.2.3 *** s_midi_alsa.c 25 Jul 2005 18:21:29 -0000 1.1.2.2.2.2 --- s_midi_alsa.c 21 Aug 2005 11:28:24 -0000 1.1.2.2.2.3 *************** *** 47,50 **** --- 47,51 ---- int client; int i; + snd_seq_client_info_t *alsainfo; alsa_nmidiin = 0; alsa_nmidiout = 0; *************** *** 92,96 ****
if (nmidiout == 0 && nmidiin == 0) return; - snd_seq_client_info_t *alsainfo; snd_seq_client_info_malloc(&alsainfo); snd_seq_get_client_info(midi_handle,alsainfo); --- 93,96 ---- *************** *** 185,189 **** void sys_alsa_poll_midi(void) { ! char buf[20]; int count, alsa_source; int i; --- 185,189 ---- void sys_alsa_poll_midi(void) { ! unsigned char buf[20]; int count, alsa_source; int i;
Index: m_glob.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_glob.c,v retrieving revision 1.4.4.2.2.1 retrieving revision 1.4.4.2.2.2 diff -C2 -d -r1.4.4.2.2.1 -r1.4.4.2.2.2 *** m_glob.c 12 Jul 2005 15:11:10 -0000 1.4.4.2.2.1 --- m_glob.c 21 Aug 2005 11:28:24 -0000 1.4.4.2.2.2 *************** *** 13,17 ****
void glob_setfilename(void *dummy, t_symbol *name, t_symbol *dir); ! void glob_quit(void *dummy); void glob_dsp(void *dummy, t_symbol *s, int argc, t_atom *argv); void glob_meters(void *dummy, t_floatarg f); --- 13,17 ----
void glob_setfilename(void *dummy, t_symbol *name, t_symbol *dir); ! void glob_verifyquit(void *dummy, t_floatarg f); void glob_dsp(void *dummy, t_symbol *s, int argc, t_atom *argv); void glob_meters(void *dummy, t_floatarg f); *************** *** 90,93 **** --- 90,95 ---- A_SYMBOL, A_SYMBOL, 0); class_addmethod(glob_pdobject, (t_method)glob_quit, gensym("quit"), 0); + class_addmethod(glob_pdobject, (t_method)glob_verifyquit, + gensym("verifyquit"), A_DEFFLOAT, 0); class_addmethod(glob_pdobject, (t_method)glob_foo, gensym("foo"), A_GIMME, 0); class_addmethod(glob_pdobject, (t_method)glob_dsp, gensym("dsp"), A_GIMME, 0);
Index: g_scalar.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_scalar.c,v retrieving revision 1.4.8.1 retrieving revision 1.4.8.2 diff -C2 -d -r1.4.8.1 -r1.4.8.2 *** g_scalar.c 22 May 2005 12:48:10 -0000 1.4.8.1 --- g_scalar.c 21 Aug 2005 11:28:24 -0000 1.4.8.2 *************** *** 207,222 **** { t_scalar *x = (t_scalar *)z; ! /* post("scalar_select %d", state); */ ! /* later */ if (state) { int x1, y1, x2, y2; - t_symbol *templatesym = x->sc_template; - t_template *tmpl; - t_atom at; - t_gpointer gp; - gpointer_init(&gp); - gpointer_setglist(&gp, owner, x); - SETPOINTER(&at, &gp); if (tmpl = template_findbyname(templatesym)) template_notify(tmpl, gensym("select"), 1, &at); --- 207,220 ---- { t_scalar *x = (t_scalar *)z; ! t_symbol *templatesym = x->sc_template; ! t_template *tmpl; ! t_atom at; ! t_gpointer gp; ! gpointer_init(&gp); ! gpointer_setglist(&gp, owner, x); ! SETPOINTER(&at, &gp); if (state) { int x1, y1, x2, y2; if (tmpl = template_findbyname(templatesym)) template_notify(tmpl, gensym("select"), 1, &at); *************** *** 230,234 **** x); } ! else sys_vgui(".x%lx.c delete select%lx\n", glist_getcanvas(owner), x); }
--- 228,238 ---- x); } ! else ! { ! sys_vgui(".x%lx.c delete select%lx\n", glist_getcanvas(owner), x); ! if (tmpl = template_findbyname(templatesym)) ! template_notify(tmpl, gensym("deselect"), 1, &at); ! ! } }
*************** *** 257,261 **** *(t_float *)(((char *)(x->sc_vec)) + yonset) += dy * (glist_pixelstoy(glist, 1) - glist_pixelstoy(glist, 0)); ! glist_redrawitem(glist, z); if (glist_isselected(glist, z)) { --- 261,265 ---- *(t_float *)(((char *)(x->sc_vec)) + yonset) += dy * (glist_pixelstoy(glist, 1) - glist_pixelstoy(glist, 0)); ! scalar_redraw(x, glist); if (glist_isselected(glist, z)) { *************** *** 304,309 **** (*wb->w_parentvisfn)(y, owner, x->sc_vec, template, basex, basey, vis); } ! if (!vis) ! sys_unqueuegui(x); }
--- 308,323 ---- (*wb->w_parentvisfn)(y, owner, x->sc_vec, template, basex, basey, vis); } ! sys_unqueuegui(x); ! } ! ! static void scalar_doredraw(t_gobj *client, t_glist *glist) ! { ! scalar_vis(client, glist, 0); ! scalar_vis(client, glist, 1); ! } ! ! void scalar_redraw(t_scalar *x, t_glist *glist) ! { ! sys_queuegui(x, glist, scalar_doredraw); }
Index: t_tkcmd.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/t_tkcmd.c,v retrieving revision 1.2.4.1.2.3 retrieving revision 1.2.4.1.2.4 diff -C2 -d -r1.2.4.1.2.3 -r1.2.4.1.2.4 *** t_tkcmd.c 2 Aug 2005 21:25:05 -0000 1.2.4.1.2.3 --- t_tkcmd.c 21 Aug 2005 11:28:24 -0000 1.2.4.1.2.4 *************** *** 433,437 **** fflush(debugfd); #endif ! execl("/bin/sh", "sh", "-c", cmdbuf, 0); perror("pd: exec"); _exit(1); --- 433,437 ---- fflush(debugfd); #endif ! execl("/bin/sh", "sh", "-c", cmdbuf, (char*)0); perror("pd: exec"); _exit(1);
Index: g_vdial.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_vdial.c,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** g_vdial.c 6 Sep 2004 20:20:34 -0000 1.4 --- g_vdial.c 21 Aug 2005 11:28:24 -0000 1.4.8.1 *************** *** 33,38 **** /* widget helper functions */
! void vradio_draw_update(t_vradio *x, t_glist *glist) { if(glist_isvisible(glist)) { --- 33,39 ---- /* widget helper functions */
! void vradio_draw_update(t_gobj *client, t_glist *glist) { + t_hradio *x = (t_hradio *)client; if(glist_isvisible(glist)) { *************** *** 40,48 ****
sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -outline #%6.6x\n", ! canvas, x, x->x_on_old, x->x_gui.x_bcol, x->x_gui.x_bcol); sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -outline #%6.6x\n", canvas, x, x->x_on, x->x_gui.x_fcol, x->x_gui.x_fcol); } } --- 41,50 ----
sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -outline #%6.6x\n", ! canvas, x, x->x_drawn, x->x_gui.x_bcol, x->x_gui.x_bcol); sys_vgui(".x%lx.c itemconfigure %lxBUT%d -fill #%6.6x -outline #%6.6x\n", canvas, x, x->x_on, x->x_gui.x_fcol, x->x_gui.x_fcol); + x->x_drawn = x->x_on; } } *************** *** 71,74 **** --- 73,77 ---- yy21 += dy; yy22 += dy; + x->x_drawn = x->x_on; } sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ *************** *** 205,209 **** { if(mode == IEM_GUI_DRAW_MODE_UPDATE) ! vradio_draw_update(x, glist); else if(mode == IEM_GUI_DRAW_MODE_MOVE) vradio_draw_move(x, glist); --- 208,212 ---- { if(mode == IEM_GUI_DRAW_MODE_UPDATE) ! sys_queuegui(x, glist, vradio_draw_update); else if(mode == IEM_GUI_DRAW_MODE_MOVE) vradio_draw_move(x, glist);
Index: s_inter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v retrieving revision 1.5.4.10.2.6 retrieving revision 1.5.4.10.2.7 diff -C2 -d -r1.5.4.10.2.6 -r1.5.4.10.2.7 *** s_inter.c 2 Aug 2005 21:25:05 -0000 1.5.4.10.2.6 --- s_inter.c 21 Aug 2005 11:28:24 -0000 1.5.4.10.2.7 *************** *** 1141,1145 **** } if (sys_verbose) fprintf(stderr, "%s", sys_guicmd); ! execl("/bin/sh", "sh", "-c", sys_guicmd, 0); perror("pd: exec"); _exit(1); --- 1141,1145 ---- } if (sys_verbose) fprintf(stderr, "%s", sys_guicmd); ! execl("/bin/sh", "sh", "-c", sys_guicmd, (char*)0); perror("pd: exec"); _exit(1); *************** *** 1226,1230 **** sprintf(cmdbuf, "%s/pd-watchdog\n", guidir); if (sys_verbose) fprintf(stderr, "%s", cmdbuf); ! execl("/bin/sh", "sh", "-c", cmdbuf, 0); perror("pd: exec"); _exit(1); --- 1226,1230 ---- sprintf(cmdbuf, "%s/pd-watchdog\n", guidir); if (sys_verbose) fprintf(stderr, "%s", cmdbuf); ! execl("/bin/sh", "sh", "-c", cmdbuf, (char*)0); perror("pd: exec"); _exit(1);
Index: m_pd.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v retrieving revision 1.4.4.11.2.3 retrieving revision 1.4.4.11.2.4 diff -C2 -d -r1.4.4.11.2.3 -r1.4.4.11.2.4 *** m_pd.h 13 Jul 2005 22:49:39 -0000 1.4.4.11.2.3 --- m_pd.h 21 Aug 2005 11:28:24 -0000 1.4.4.11.2.4 *************** *** 609,612 **** --- 609,613 ---- EXTERN void canvas_resume_dsp(int oldstate); EXTERN void canvas_update_dsp(void); + EXTERN int canvas_dspstate;
/* IOhannes { (up/downsampling) */
Index: g_editor.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_editor.c,v retrieving revision 1.4.4.2.2.3 retrieving revision 1.4.4.2.2.4 diff -C2 -d -r1.4.4.2.2.3 -r1.4.4.2.2.4 *** g_editor.c 12 Jul 2005 15:11:07 -0000 1.4.4.2.2.3 --- g_editor.c 21 Aug 2005 11:28:24 -0000 1.4.4.2.2.4 *************** *** 96,104 **** }
- void gobj_redraw(t_gobj *gobj, t_glist *glist) - { - glist_redrawitem(glist, gobj); - } - /* ------------------------ managing the selection ----------------- */
--- 96,99 ---- *************** *** 698,705 **** /* we're going to remake the object, so "g" will go stale. Get its index here, and afterward restore g. Also, the ! replacement will be at teh end of the list, so we don't do g = g->g_next in this case. */ int j = glist_getindex(gl, g); ! if (!gl->gl_havewindow) canvas_vis(glist_getcanvas(gl), 1); glist_noselect(gl); --- 693,701 ---- /* we're going to remake the object, so "g" will go stale. Get its index here, and afterward restore g. Also, the ! replacement will be at the end of the list, so we don't do g = g->g_next in this case. */ int j = glist_getindex(gl, g); ! int hadwindow = gl->gl_havewindow; ! if (!hadwindow) canvas_vis(glist_getcanvas(gl), 1); glist_noselect(gl); *************** *** 711,714 **** --- 707,712 ---- glist_noselect(gl); g = glist_nth(gl, j); + if (!hadwindow) + canvas_vis(glist_getcanvas(gl), 0); } else *************** *** 978,982 **** if (x->gl_havewindow) canvas_redraw(x); ! else gobj_redraw(&x->gl_gobj, x->gl_owner); }
--- 976,984 ---- if (x->gl_havewindow) canvas_redraw(x); ! else if (glist_isvisible(x->gl_owner)) ! { ! gobj_vis(&x->gl_gobj, x->gl_owner, 0); ! gobj_vis(&x->gl_gobj, x->gl_owner, 1); ! } }
*************** *** 1064,1068 **** t_gobj *y; int shiftmod, runmode, altmod, doublemod = 0, rightclick; ! int x1, y1, x2, y2, clickreturned = 0;
if (!x->gl_editor) --- 1066,1070 ---- t_gobj *y; int shiftmod, runmode, altmod, doublemod = 0, rightclick; ! int x1=0, y1=0, x2=0, y2=0, clickreturned = 0;
if (!x->gl_editor) *************** *** 1304,1310 **** void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit) { ! int x11, y11, x12, y12; t_gobj *y1; ! int x21, y21, x22, y22; t_gobj *y2; int xwas = x->gl_editor->e_xwas, --- 1306,1312 ---- void canvas_doconnect(t_canvas *x, int xpos, int ypos, int which, int doit) { ! int x11=0, y11=0, x12=0, y12=0; t_gobj *y1; ! int x21=0, y21=0, x22=0, y22=0; t_gobj *y2; int xwas = x->gl_editor->e_xwas, *************** *** 1672,1683 **** }
! void canvas_menuclose(t_canvas *x, t_floatarg force) { ! if (x->gl_owner) ! canvas_vis(x, 0); ! else if ((force != 0) || (!x->gl_dirty)) pd_free(&x->gl_pd); ! else sys_vgui("pdtk_check {This window has been modified. Close anyway?}\ ! {.x%lx menuclose 1;\n}\n", x); }
--- 1674,1751 ---- }
! /* find a dirty sub-glist, if any, of this one (including itself) */ ! static t_glist *glist_finddirty(t_glist *x) { ! t_gobj *g; ! t_glist *g2; ! if (x->gl_env && x->gl_dirty) ! return (x); ! for (g = x->gl_list; g; g = g->g_next) ! if (pd_class(&g->g_pd) == canvas_class && ! (g2 = glist_finddirty((t_glist *)g))) ! return (g2); ! return (0); ! } ! ! /* quit, after calling glist_finddirty() on all toplevels and verifying ! the user really wants to discard changes */ ! void glob_verifyquit(void *dummy, t_floatarg f) ! { ! t_glist *g, *g2; ! /* find all root canvases */ ! for (g = canvas_list; g; g = g->gl_next) ! if (g2 = glist_finddirty(g)) ! { ! canvas_vis(g2, 1); ! sys_vgui( ! "pdtk_check {Discard changes to this window??} {.x%lx menuclose 3;\n} no\n", ! g2); ! return; ! } ! if (f == 0) ! sys_vgui("pdtk_check {really quit?} {pd quit;\n} yes\n"); ! else glob_quit(0); ! } ! ! /* close a window (or possibly quit Pd), checking for dirty flags. ! The "force" parameter is interpreted as follows: ! 0 - request from GUI to close, verifying whether clean or dirty ! 1 - request from GUI to close, no verification ! 2 - verified - mark this one clean, then continue as in 1 ! 3 - verified - mark this one clean, then verify-and-quit ! */ ! void canvas_menuclose(t_canvas *x, t_floatarg fforce) ! { ! int force = fforce; ! t_glist *g; ! if (x->gl_owner && (force == 0 || force == 1)) ! canvas_vis(x, 0); /* if subpatch, just invis it */ ! else if (force == 0) ! { ! g = glist_finddirty(x); ! if (g) ! { ! canvas_vis(g, 1); ! sys_vgui( ! "pdtk_check {Discard changes to this window??} {.x%lx menuclose 2;\n} no\n", ! g); ! return; ! } ! else pd_free(&x->gl_pd); ! } ! else if (force == 1) pd_free(&x->gl_pd); ! else if (force == 2) ! { ! canvas_dirty(x, 0); ! while (x->gl_owner) ! x = x->gl_owner; ! canvas_menuclose(x, 0); ! } ! else if (force == 3) ! { ! canvas_dirty(x, 0); ! glob_verifyquit(0, 1); ! } }
*************** *** 1718,1722 **** canvas_find_index2 = myindex2; glist_noselect(x); ! canvas_vis(x, 1); canvas_editmode(x, 1.); glist_select(x, y); --- 1786,1790 ---- canvas_find_index2 = myindex2; glist_noselect(x); ! vmess(&x->gl_pd, gensym("menu-open"), ""); canvas_editmode(x, 1.); glist_select(x, y);
Index: d_ugen.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_ugen.c,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.1.2.1 diff -C2 -d -r1.3.4.1 -r1.3.4.1.2.1 *** d_ugen.c 5 Nov 2004 13:55:58 -0000 1.3.4.1 --- d_ugen.c 21 Aug 2005 11:28:24 -0000 1.3.4.1.2.1 *************** *** 693,697 **** t_sigoutconnect *oc, *oc2; t_class *class = pd_class(&u->u_obj->ob_pd); ! int i, n; /* suppress creating new signals for the outputs of signal inlets and subpatchs; except in the case we're an inlet and "blocking" --- 693,697 ---- t_sigoutconnect *oc, *oc2; t_class *class = pd_class(&u->u_obj->ob_pd); ! int i, n, totnsig; /* suppress creating new signals for the outputs of signal inlets and subpatchs; except in the case we're an inlet and "blocking" *************** *** 728,732 **** } } ! insig = (t_signal **)getbytes((u->u_nin + u->u_nout) * sizeof(t_signal *)); outsig = insig + u->u_nin; for (sig = insig, uin = u->u_in, i = u->u_nin; i--; sig++, uin++) --- 728,733 ---- } } ! totnsig = u->u_nin + u->u_nout; ! insig = (t_signal **)getbytes((totnsig ? totnsig : 1) * sizeof(t_signal *)); outsig = insig + u->u_nin; for (sig = insig, uin = u->u_in, i = u->u_nin; i--; sig++, uin++) *************** *** 763,766 **** --- 764,772 ---- (*sig)->s_refcount = uout->o_nconnect; } + /* if thre are no input or output signals, supply one fake signal so + the object can learn the sample rate and block size. Used by the + samplerate~ object. */ + if (!totnsig) + insig[0] = signal_new(dc->dc_vecsize, dc->dc_srate); /* now call the DSP scheduling routine for the ugen. This routine must fill in "borrowed" signal outputs in case it's either *************** *** 777,780 **** --- 783,789 ---- signal_makereusable(*sig); } + /* special case: no inputs or outputs: free the fake signal we made */ + if (!totnsig) + signal_makereusable(insig[0]); if (ugen_loud) {
Index: g_numbox.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_numbox.c,v retrieving revision 1.4.8.2 retrieving revision 1.4.8.3 diff -C2 -d -r1.4.8.2 -r1.4.8.3 *** g_numbox.c 16 Jul 2005 11:02:36 -0000 1.4.8.2 --- g_numbox.c 21 Aug 2005 11:28:24 -0000 1.4.8.3 *************** *** 27,30 **** --- 27,31 ----
static void my_numbox_key(void *z, t_floatarg fkey); + static void my_numbox_draw_update(t_gobj *client, t_glist *glist);
/* ------------ nmx gui-my number box ----------------------- */ *************** *** 40,44 **** { x->x_gui.x_fsf.x_change = 0; ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); } } --- 41,45 ---- { x->x_gui.x_fsf.x_change = 0; ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } } *************** *** 46,50 **** static void my_numbox_tick_wait(t_my_numbox *x) { ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); }
--- 47,51 ---- static void my_numbox_tick_wait(t_my_numbox *x) { ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); }
*************** *** 128,133 **** }
! static void my_numbox_draw_update(t_my_numbox *x, t_glist *glist) { if (glist_isvisible(glist)) { --- 129,135 ---- }
! static void my_numbox_draw_update(t_gobj *client, t_glist *glist) { + t_my_numbox *x = (t_my_numbox *)client; if (glist_isvisible(glist)) { *************** *** 316,320 **** clock_unset(x->x_clock_reset); x->x_buf[0] = 0; ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); } sys_vgui(".x%lx.c itemconfigure %lxBASE1 -outline #%6.6x\n", --- 318,322 ---- clock_unset(x->x_clock_reset); x->x_buf[0] = 0; ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } sys_vgui(".x%lx.c itemconfigure %lxBASE1 -outline #%6.6x\n", *************** *** 343,347 **** { if(mode == IEM_GUI_DRAW_MODE_UPDATE) ! my_numbox_draw_update(x, glist); else if(mode == IEM_GUI_DRAW_MODE_MOVE) my_numbox_draw_move(x, glist); --- 345,349 ---- { if(mode == IEM_GUI_DRAW_MODE_UPDATE) ! sys_queuegui(x, glist, my_numbox_draw_update); else if(mode == IEM_GUI_DRAW_MODE_MOVE) my_numbox_draw_move(x, glist); *************** *** 383,387 **** x->x_gui.x_fsf.x_change = 0; clock_unset(x->x_clock_reset); ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); } binbuf_addv(b, "ssiisiiffiisssiiiiiiifi", gensym("#X"),gensym("obj"), --- 385,389 ---- x->x_gui.x_fsf.x_change = 0; clock_unset(x->x_clock_reset); ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } binbuf_addv(b, "ssiisiiffiisssiiiiiiifi", gensym("#X"),gensym("obj"), *************** *** 447,451 **** x->x_gui.x_fsf.x_change = 0; clock_unset(x->x_clock_reset); ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
} --- 449,453 ---- x->x_gui.x_fsf.x_change = 0; clock_unset(x->x_clock_reset); ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update);
} *************** *** 523,527 **** x->x_val -= k2*dy; my_numbox_clip(x); ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); my_numbox_bang(x); clock_unset(x->x_clock_reset); --- 525,529 ---- x->x_val -= k2*dy; my_numbox_clip(x); ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); my_numbox_bang(x); clock_unset(x->x_clock_reset); *************** *** 561,565 **** clock_unset(x->x_clock_reset); x->x_buf[0] = 0; ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); } } --- 563,567 ---- clock_unset(x->x_clock_reset); x->x_buf[0] = 0; ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } } *************** *** 571,575 **** x->x_val = f; my_numbox_clip(x); ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); }
--- 573,577 ---- x->x_val = f; my_numbox_clip(x); ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); }
*************** *** 623,627 **** (double)atom_getfloatarg(1, ac, av))) { ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); /*my_numbox_bang(x);*/ } --- 625,629 ---- (double)atom_getfloatarg(1, ac, av))) { ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); /*my_numbox_bang(x);*/ } *************** *** 664,668 **** if(my_numbox_check_minmax(x, x->x_min, x->x_max)) { ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); /*my_numbox_bang(x);*/ } --- 666,670 ---- if(my_numbox_check_minmax(x, x->x_min, x->x_max)) { ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); /*my_numbox_bang(x);*/ } *************** *** 683,687 **** if(!sys_noloadbang && x->x_gui.x_isa.x_loadinit) { ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); my_numbox_bang(x); } --- 685,689 ---- if(!sys_noloadbang && x->x_gui.x_isa.x_loadinit) { ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); my_numbox_bang(x); } *************** *** 699,703 **** x->x_gui.x_fsf.x_change = 0; clock_unset(x->x_clock_reset); ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); return; } --- 701,705 ---- x->x_gui.x_fsf.x_change = 0; clock_unset(x->x_clock_reset); ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); return; } *************** *** 709,713 **** buf[0] = c; strcat(x->x_buf, buf); ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); } } --- 711,715 ---- buf[0] = c; strcat(x->x_buf, buf); ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } } *************** *** 719,723 **** sl = 0; x->x_buf[sl] = 0; ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); } else if((c=='\n')||(c==13)) --- 721,725 ---- sl = 0; x->x_buf[sl] = 0; ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } else if((c=='\n')||(c==13)) *************** *** 729,733 **** my_numbox_clip(x); my_numbox_bang(x); ! (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE); } clock_delay(x->x_clock_reset, 3000); --- 731,735 ---- my_numbox_clip(x); my_numbox_bang(x); ! sys_queuegui(x, x->x_gui.x_glist, my_numbox_draw_update); } clock_delay(x->x_clock_reset, 3000);