[PD-cvs] pd/src configure.in, 1.10, 1.11 d_ctl.c, 1.3, 1.4 d_soundfile.c, 1.5, 1.6 g_array.c, 1.6, 1.7 g_canvas.h, 1.6, 1.7 g_numbox.c, 1.4, 1.5 g_template.c, 1.7, 1.8 makefile.in, 1.6, 1.7 notes.txt, 1.11, 1.12 u_main.tk, 1.9, 1.10

Miller Puckette millerpuckette at users.sourceforge.net
Sat Jun 25 04:49:17 CEST 2005


Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7337/pd/src

Modified Files:
	configure.in d_ctl.c d_soundfile.c g_array.c g_canvas.h 
	g_numbox.c g_template.c makefile.in notes.txt u_main.tk 
Log Message:
major extensions to drawing commands in templates, to allow scaling and
invisibilizing.

New "coreaudio" search (from patch).

couple of bug fixes.




Index: notes.txt
===================================================================
RCS file: /cvsroot/pure-data/pd/src/notes.txt,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** notes.txt	30 May 2005 03:04:18 -0000	1.11
--- notes.txt	25 Jun 2005 02:49:15 -0000	1.12
***************
*** 5,11 ****
--- 5,15 ----
  fixed array onset bug
  rfft bug fix
+ bug fix in d_soundfile.c
+ bugfix in number2
+ plot drawing instructions turn on and off
  
  check:
  MIDI I/O for windows
+ blechman patch for s_inter.c
  
  At the source level, "regular" arrays and arrays withing data structures
***************
*** 28,31 ****
--- 32,36 ----
  
  problems:
+ patcher inlets don't deal with scalars (zbug.pd)
  Macintosh .pd extension not added to filenames
  need to optimize canvas_motion (get rid of box hit test??)

Index: g_array.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_array.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** g_array.c	30 May 2005 03:04:17 -0000	1.6
--- g_array.c	25 Jun 2005 02:49:15 -0000	1.7
***************
*** 81,85 ****
          char *cp = x->a_vec + elemsize * oldn;
          int i = n - oldn;
-         post("%d->%d", oldn, i);
          for (; i--; cp += elemsize)
          {
--- 81,84 ----
***************
*** 731,735 ****
  int array_doclick(t_array *array, t_glist *glist, t_scalar *sc, t_array *ap,
      t_symbol *elemtemplatesym,
!     float linewidth, float xloc, float xinc, float yloc,
      t_fielddesc *xfield, t_fielddesc *yfield, t_fielddesc *wfield,
      int xpix, int ypix, int shift, int alt, int dbl, int doit)
--- 730,734 ----
  int array_doclick(t_array *array, t_glist *glist, t_scalar *sc, t_array *ap,
      t_symbol *elemtemplatesym,
!     float linewidth, float xloc, float xinc, float yloc, float scalarvis,
      t_fielddesc *xfield, t_fielddesc *yfield, t_fielddesc *wfield,
      int xpix, int ypix, int shift, int alt, int dbl, int doit)
***************
*** 778,785 ****
          }
          if (best > 8)
!             return (array_doclick_element(array, glist, sc, ap,
!                 elemtemplatesym, linewidth, xloc, xinc, yloc,
!                     xfield, yfield, wfield,
!                     xpix, ypix, shift, alt, dbl, doit));
          best += 0.001;  /* add truncation error margin */
          for (i = 0; i < array->a_n; i += incr)
--- 777,788 ----
          }
          if (best > 8)
!         {
!             if (scalarvis != 0)
!                 return (array_doclick_element(array, glist, sc, ap,
!                     elemtemplatesym, linewidth, xloc, xinc, yloc,
!                         xfield, yfield, wfield,
!                         xpix, ypix, shift, alt, dbl, doit));
!             else return (0);
!         }
          best += 0.001;  /* add truncation error margin */
          for (i = 0; i < array->a_n; i += incr)

Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** u_main.tk	18 May 2005 04:28:51 -0000	1.9
--- u_main.tk	25 Jun 2005 02:49:15 -0000	1.10
***************
*** 49,53 ****
      set pd_gui2 [string range $argv0 0 [expr [string last / $argv0 ] - 1]]
      set pd_guidir $pd_gui2/..
!     load $pd_guidir/bin/pdtcl
      set pd_tearoff 0
  
--- 49,53 ----
      set pd_gui2 [string range $argv0 0 [expr [string last / $argv0 ] - 1]]
      set pd_guidir $pd_gui2/..
!     load $pd_guidir/bin/libPdTcl.dylib
      set pd_tearoff 0
  

Index: g_canvas.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_canvas.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** g_canvas.h	18 May 2005 04:28:50 -0000	1.6
--- g_canvas.h	25 Jun 2005 02:49:15 -0000	1.7
***************
*** 557,561 ****
  EXTERN int array_doclick(t_array *array, t_glist *glist, t_scalar *sc, t_array *ap,
      t_symbol *elemtemplatesym,
!     float linewidth, float xloc, float xinc, float yloc,
      t_fielddesc *xfield, t_fielddesc *yfield, t_fielddesc *wfield,
      int xpix, int ypix, int shift, int alt, int dbl, int doit);
--- 557,561 ----
  EXTERN int array_doclick(t_array *array, t_glist *glist, t_scalar *sc, t_array *ap,
      t_symbol *elemtemplatesym,
!     float linewidth, float xloc, float xinc, float yloc, float scalarvis,
      t_fielddesc *xfield, t_fielddesc *yfield, t_fielddesc *wfield,
      int xpix, int ypix, int shift, int alt, int dbl, int doit);

Index: configure.in
===================================================================
RCS file: /cvsroot/pure-data/pd/src/configure.in,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** configure.in	30 May 2005 04:37:25 -0000	1.10
--- configure.in	25 Jun 2005 02:49:08 -0000	1.11
***************
*** 13,16 ****
--- 13,17 ----
  AC_SUBST(USE_DEBUG_CFLAGS, no)
  AC_SUBST(SYSSRC)
+ AC_SUBST(TCLTK_FRAMEWORKS_PATH)
  AC_SUBST(STRIPFLAG)
  AC_SUBST(GUINAME)
***************
*** 174,177 ****
--- 175,180 ----
      fi
      if test x$portaudio == "xyes";
+ 
+ 
      then
      	MORECFLAGS="-DUSEAPI_PORTAUDIO -DPA19 "$MORECFLAGS
***************
*** 211,214 ****
--- 214,235 ----
      echo OPT_CFLAGS --------------- $OPT_CFLAGS
      OSNUMBER=0
+ 
+     if test x$jack == "xyes";
+     then
+         LDFLAGS=$LDFLAGS" -lrt -ljack"
+     fi
+     if test x$jack == "xrun";
+     then
+         LDFLAGS=$LDFLAGS" -lrt -ljack"
+     fi
+     fi
+ 
+     if test x$jack == "xyes";
+     then
+         LDFLAGS=$LDFLAGS" -lrt -ljack"
+     fi
+     if test x$jack == "xrun";
+     then
+         LDFLAGS=$LDFLAGS" -lrt -ljack"
  fi
  
***************
*** 246,254 ****
          ../portmidi/porttime/ptmacosx_cf.c "
      STRIPFLAG=""
!     GUINAME="pdtcl"
!     GUIFLAGS="-F../../Frameworks -framework Tcl -framework Tk \
!         -I../../Frameworks/Tk.framework/Versions/Current/Headers \
!         -I../../Frameworks/Tcl.framework/Versions/Current/Headers \
!         -I../../Frameworks/Tcl.framework/Versions/8.4/PrivateHeaders"
      if test x$USE_DEBUG_CFLAGS == "xyes";
      then
--- 267,289 ----
          ../portmidi/porttime/ptmacosx_cf.c "
      STRIPFLAG=""
!     GUINAME="libPdTcl.dylib"
! 
! # find the Tcl/Tk Frameworks
!  	 if test -d "../../Frameworks";
!     then
!         # Miller's location
!         TCLTK_FRAMEWORKS_PATH="../../Frameworks"
!  	 elif test -d "/Library/Frameworks";
! 	 then
!         # get it from the default install location
!         TCLTK_FRAMEWORKS_PATH="/Library/Frameworks"
!     else
!         # Panther has Tcl here; Tiger has Tcl and Tk here
!         TCLTK_FRAMEWORKS_PATH="/System/Library/Frameworks"
!     fi		 
!     GUIFLAGS="-F$TCLTK_FRAMEWORKS_PATH -framework Tcl -framework Tk \
!         -I$TCLTK_FRAMEWORKS_PATH/Tk.framework/Versions/Current/Headers \
!         -I$TCLTK_FRAMEWORKS_PATH/Tcl.framework/Versions/Current/Headers \
!         -I$TCLTK_FRAMEWORKS_PATH/Tcl.framework/Versions/8.4/PrivateHeaders"
      if test x$USE_DEBUG_CFLAGS == "xyes";
      then
***************
*** 262,267 ****
      then
      	LDFLAGS=$LDFLAGS" -framework Jack"
! 	MORECFLAGS=$MORECFLAGS" -DUSEAPI_JACK"
! 	SYSSRC=$SYSSRC" s_audio_jack.c"
      fi
  fi
--- 297,304 ----
      then
      	LDFLAGS=$LDFLAGS" -framework Jack"
!     fi
!     if test x$jack == "xrun";
!     then
!         LDFLAGS=$LDFLAGS" -framework Jack"
      fi
  fi
***************
*** 273,277 ****
      MORECFLAGS=$MORECFLAGS" -DUSEAPI_JACK"
      SYSSRC=$SYSSRC" s_audio_jack.c"
-     LDFLAGS=$LDFLAGS" -lrt -ljack"
  fi
  if test x$jack == "xrun";
--- 310,313 ----
***************
*** 279,283 ****
      MORECFLAGS=$MORECFLAGS" -DUSEAPI_JACK -DJACK_XRUN"
      SYSSRC=$SYSSRC" s_audio_jack.c"
-     LDFLAGS=$LDFLAGS" -lrt -ljack"
  fi
  
--- 315,318 ----

Index: makefile.in
===================================================================
RCS file: /cvsroot/pure-data/pd/src/makefile.in,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** makefile.in	18 May 2005 04:28:51 -0000	1.6
--- makefile.in	25 Jun 2005 02:49:15 -0000	1.7
***************
*** 98,106 ****
  
  #this is for Max OSX only...
! $(BIN_DIR)/pdtcl: $(GOBJ) $(GSRC)
! 	cd ../obj; libtool -dynamic -o $(BIN_DIR)/pdtcl $(GOBJ) \
! 	../../Frameworks/Tk.framework/Versions/Current/Tk \
! 	../../Frameworks/Tcl.framework/Versions/Current/Tcl \
! 	/usr/lib/libSystem.B.dylib
  
  externs: 
--- 98,112 ----
  
  #this is for Max OSX only...
! $(BIN_DIR)/libPdTcl.dylib: $(GOBJ) $(GSRC)
! 	cd ../obj && $(CC) -dynamiclib -read_only_relocs warning  \
! 		-o $(BIN_DIR)/libPdTcl.dylib $(GOBJ)  \
! 		-F at TCLTK_FRAMEWORKS_PATH@ \
! 		-framework Tcl  -framework Tk  -framework System  \
! 		-Wl,-install_name, at executable_path/../Resources/bin/libPdTcl.dylib
! 	install_name_tool -change @TCLTK_FRAMEWORKS_PATH@/Tcl.framework/Versions/8.4/Tcl\
! 		 @executable_path/../Frameworks/Tcl.framework/Versions/8.4/Tcl \
! 		 -change @TCLTK_FRAMEWORKS_PATH@/Tk.framework/Versions/8.4/Tk \
! 		 @executable_path/../Frameworks/Tk.framework/Versions/8.4/Tk \
! 		../bin/libPdTcl.dylib
  
  externs: 

Index: d_soundfile.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_soundfile.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** d_soundfile.c	30 May 2005 03:04:17 -0000	1.5
--- d_soundfile.c	25 Jun 2005 02:49:09 -0000	1.6
***************
*** 1711,1714 ****
--- 1711,1720 ----
              sfread_cond_signal(&x->x_requestcondition);
              sfread_cond_wait(&x->x_answercondition, &x->x_mutex);
+                 /* resync local cariables -- bug fix thanks to Shahrokh */
+             vecsize = x->x_vecsize;
+             bytespersample = x->x_bytespersample;
+             sfchannels = x->x_sfchannels;
+             wantbytes = sfchannels * vecsize * bytespersample;
+             bigendian = x->x_bigendian;
  #ifdef DEBUG_SOUNDFILE
              pute("done\n");

Index: d_ctl.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_ctl.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** d_ctl.c	6 Sep 2004 20:20:33 -0000	1.3
--- d_ctl.c	25 Jun 2005 02:49:08 -0000	1.4
***************
*** 553,558 ****
  /* ---------------- env~ - simple envelope follower. ----------------- */
  
! #define MAXOVERLAP 10
! #define MAXVSTAKEN 64
  
  typedef struct sigenv
--- 553,558 ----
  /* ---------------- env~ - simple envelope follower. ----------------- */
  
! #define MAXOVERLAP 32
! #define INITVSTAKEN 64
  
  typedef struct sigenv
***************
*** 569,572 ****
--- 569,573 ----
      float x_sumbuf[MAXOVERLAP];     /* summing buffer */
      float x_f;
+     int x_allocforvs;               /* extra buffer for DSP vector size */
  } t_sigenv;
  
***************
*** 586,590 ****
      if (period < npoints / MAXOVERLAP + 1)
          period = npoints / MAXOVERLAP + 1;
!     if (!(buf = getbytes(sizeof(float) * (npoints + MAXVSTAKEN))))
      {
          error("env: couldn't allocate buffer");
--- 587,591 ----
      if (period < npoints / MAXOVERLAP + 1)
          period = npoints / MAXOVERLAP + 1;
!     if (!(buf = getbytes(sizeof(float) * (npoints + INITVSTAKEN))))
      {
          error("env: couldn't allocate buffer");
***************
*** 599,606 ****
      for (i = 0; i < npoints; i++)
          buf[i] = (1. - cos((2 * 3.14159 * i) / npoints))/npoints;
!     for (; i < npoints+MAXVSTAKEN; i++) buf[i] = 0;
      x->x_clock = clock_new(x, (t_method)env_tilde_tick);
      x->x_outlet = outlet_new(&x->x_obj, gensym("float"));
      x->x_f = 0;
      return (x);
  }
--- 600,608 ----
      for (i = 0; i < npoints; i++)
          buf[i] = (1. - cos((2 * 3.14159 * i) / npoints))/npoints;
!     for (; i < npoints+INITVSTAKEN; i++) buf[i] = 0;
      x->x_clock = clock_new(x, (t_method)env_tilde_tick);
      x->x_outlet = outlet_new(&x->x_obj, gensym("float"));
      x->x_f = 0;
+     x->x_allocforvs = INITVSTAKEN;
      return (x);
  }
***************
*** 649,654 ****
          x->x_period + sp[0]->s_n - (x->x_period % sp[0]->s_n);
      else x->x_realperiod = x->x_period;
      dsp_add(env_tilde_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
-     if (sp[0]->s_n > MAXVSTAKEN) bug("env_tilde_dsp");
  }
  
--- 651,668 ----
          x->x_period + sp[0]->s_n - (x->x_period % sp[0]->s_n);
      else x->x_realperiod = x->x_period;
+     if (sp[0]->s_n > x->x_allocforvs)
+     {
+         void *xx = resizebytes(x->x_buf,
+             (x->x_npoints + x->x_allocforvs) * sizeof(float),
+             (x->x_npoints + sp[0]->s_n) * sizeof(float));
+         if (!xx)
+         {
+             post("env~: out of memory");
+             return;
+         }
+         x->x_buf = (t_float *)xx;
+         x->x_allocforvs = sp[0]->s_n;
+     }
      dsp_add(env_tilde_perform, 3, x, sp[0]->s_vec, sp[0]->s_n);
  }
  
***************
*** 661,665 ****
  {
      clock_free(x->x_clock);
!     freebytes(x->x_buf, (x->x_npoints + MAXVSTAKEN) * sizeof(float));
  }
  
--- 675,679 ----
  {
      clock_free(x->x_clock);
!     freebytes(x->x_buf, (x->x_npoints + x->x_allocforvs) * sizeof(float));
  }
  

Index: g_numbox.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_numbox.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** g_numbox.c	6 Sep 2004 20:20:34 -0000	1.4
--- g_numbox.c	25 Jun 2005 02:49:15 -0000	1.5
***************
*** 37,44 ****
  static void my_numbox_tick_reset(t_my_numbox *x)
  {
!     if(x->x_gui.x_fsf.x_change)
      {
          x->x_gui.x_fsf.x_change = 0;
-         glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
          (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
      }
--- 37,43 ----
  static void my_numbox_tick_reset(t_my_numbox *x)
  {
!   if(x->x_gui.x_fsf.x_change && x->x_gui.x_glist)
      {
          x->x_gui.x_fsf.x_change = 0;
          (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
      }
***************
*** 384,390 ****
          x->x_gui.x_fsf.x_change = 0;
          clock_unset(x->x_clock_reset);
-         glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
          (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
- 
      }
      binbuf_addv(b, "ssiisiiffiisssiiiiiiifi", gensym("#X"),gensym("obj"),
--- 383,387 ----
***************
*** 450,454 ****
          x->x_gui.x_fsf.x_change = 0;
          clock_unset(x->x_clock_reset);
-         glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
          (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
  
--- 447,450 ----
***************
*** 557,562 ****
              x->x_gui.x_fsf.x_change = 1;
              clock_delay(x->x_clock_reset, 3000);
-             /* glist_grab(x->x_gui.x_glist, &x->x_gui.x_obj.ob_g,
-                 0, my_numbox_key, 0, 0); */
  
              x->x_buf[0] = 0;
--- 553,556 ----
***************
*** 566,570 ****
              x->x_gui.x_fsf.x_change = 0;
              clock_unset(x->x_clock_reset);
-             glist_grab(x->x_gui.x_glist, 0, 0, 0, 0, 0);
              x->x_buf[0] = 0;
              (*x->x_gui.x_draw)(x, x->x_gui.x_glist, IEM_GUI_DRAW_MODE_UPDATE);
--- 560,563 ----

Index: g_template.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_template.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** g_template.c	30 May 2005 03:04:18 -0000	1.7
--- g_template.c	25 Jun 2005 02:49:15 -0000	1.8
***************
*** 1240,1244 ****
  {
      t_object x_obj;
-     int x_vis;
      t_canvas *x_canvas;
      t_fielddesc x_outlinecolor;
--- 1240,1243 ----
***************
*** 1252,1255 ****
--- 1251,1256 ----
      t_fielddesc x_ypoints;
      t_fielddesc x_wpoints;
+     t_fielddesc x_vis;          /* visible */
+     t_fielddesc x_scalarvis;    /* true if drawing the scalar at each point */
  } t_plot;
  
***************
*** 1257,1262 ****
  {
      t_plot *x = (t_plot *)pd_new(plot_class);
!     int defstyle = PLOTSTYLE_POLY;
!     x->x_vis = 1;
      x->x_canvas = canvas_getcurrent();
  
--- 1258,1262 ----
  {
      t_plot *x = (t_plot *)pd_new(plot_class);
!     int defstyle = PLOTSTYLE_POLY, vis = 1, scalarvis = 1;
      x->x_canvas = canvas_getcurrent();
  
***************
*** 1276,1280 ****
          else if (!strcmp(firstarg->s_name, "-n"))
          {
!             x->x_vis = 0;
              argc--; argv++;
          }
--- 1276,1285 ----
          else if (!strcmp(firstarg->s_name, "-n"))
          {
!             vis = 0;
!             argc--; argv++;
!         }
!         else if (!strcmp(firstarg->s_name, "-noscalar"))
!         {
!             scalarvis = 0;
              argc--; argv++;
          }
***************
*** 1310,1313 ****
--- 1315,1322 ----
      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);
  }
***************
*** 1315,1322 ****
  void plot_float(t_plot *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);
  }
--- 1324,1338 ----
  void plot_float(t_plot *x, t_floatarg f)
  {
!     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;
!     }
!     int 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);
  }
***************
*** 1331,1334 ****
--- 1347,1351 ----
      t_symbol **elemtemplatesymp, t_array **arrayp,
      float *linewidthp, float *xlocp, float *xincp, float *ylocp, float *stylep,
+     float *visp, float *scalarvisp,
      t_fielddesc **xfield, t_fielddesc **yfield, t_fielddesc **wfield)
  {
***************
*** 1360,1363 ****
--- 1377,1382 ----
      *ylocp = fielddesc_getfloat(&x->x_yloc, ownertemplate, data, 1);
      *stylep = fielddesc_getfloat(&x->x_style, ownertemplate, data, 1);
+     *visp = fielddesc_getfloat(&x->x_vis, ownertemplate, data, 1);
+     *scalarvisp = fielddesc_getfloat(&x->x_scalarvis, ownertemplate, data, 1);
      *elemtemplatesymp = elemtemplatesym;
      *arrayp = array;
***************
*** 1435,1439 ****
      t_template *elemtemplate;
      t_symbol *elemtemplatesym;
!     float linewidth, xloc, xinc, yloc, style, xsum, yval;
      t_array *array;
      int x1 = 0x7fffffff, y1 = 0x7fffffff, x2 = -0x7fffffff, y2 = -0x7fffffff;
--- 1454,1458 ----
      t_template *elemtemplate;
      t_symbol *elemtemplatesym;
!     float linewidth, xloc, xinc, yloc, style, xsum, yval, vis, scalarvis;
      t_array *array;
      int x1 = 0x7fffffff, y1 = 0x7fffffff, x2 = -0x7fffffff, y2 = -0x7fffffff;
***************
*** 1441,1447 ****
      float xpix, ypix, wpix;
      t_fielddesc *xfielddesc, *yfielddesc, *wfielddesc;
!     if (x->x_vis && !plot_readownertemplate(x, data, template, 
          &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc, &style,
!                 &xfielddesc, &yfielddesc, &wfielddesc) &&
              !array_getfields(elemtemplatesym, &elemtemplatecanvas,
                  &elemtemplate, &elemsize, 
--- 1460,1467 ----
      float xpix, ypix, wpix;
      t_fielddesc *xfielddesc, *yfielddesc, *wfielddesc;
!     if (!plot_readownertemplate(x, data, template, 
          &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc, &style,
!             &vis, &scalarvis, &xfielddesc, &yfielddesc, &wfielddesc) &&
!                 (vis != 0) &&
              !array_getfields(elemtemplatesym, &elemtemplatecanvas,
                  &elemtemplate, &elemsize, 
***************
*** 1466,1497 ****
                  y2 = ypix + wpix;
              
!                 /* check also the drawing instructions for the scalar */ 
!             if (xonset >= 0)
!                 usexloc = basex + xloc + fielddesc_cvttocoord(xfielddesc, 
!                     *(float *)(((char *)(array->a_vec) + elemsize * i)
!                         + xonset));
!             else usexloc = basex + xsum, xsum += xinc;
!             if (yonset >= 0)
!                 yval = *(float *)(((char *)(array->a_vec) + elemsize * i)
!                     + yonset);
!             else yval = 0;
!             useyloc = basey + yloc + fielddesc_cvttocoord(yfielddesc, yval);
!             for (y = elemtemplatecanvas->gl_list; y; y = y->g_next)
              {
!                 int xx1, xx2, yy1, yy2;
!                 t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd);
!                 if (!wb) continue;
!                 (*wb->w_parentgetrectfn)(y, glist,
!                     (t_word *)((char *)(array->a_vec) + elemsize * i),
!                         elemtemplate, usexloc, useyloc, 
!                             &xx1, &yy1, &xx2, &yy2);
!                 if (xx1 < x1)
!                     x1 = xx1;
!                 if (yy1 < y1)
!                     y1 = yy1;
!                  if (xx2 > x2)
!                     x2 = xx2;
!                 if (yy2 > y2)
!                     y2 = yy2;   
              }
          }
--- 1486,1520 ----
                  y2 = ypix + wpix;
              
!             if (scalarvis != 0)
              {
!                     /* check also the drawing instructions for the scalar */ 
!                 if (xonset >= 0)
!                     usexloc = basex + xloc + fielddesc_cvttocoord(xfielddesc, 
!                         *(float *)(((char *)(array->a_vec) + elemsize * i)
!                             + xonset));
!                 else usexloc = basex + xsum, xsum += xinc;
!                 if (yonset >= 0)
!                     yval = *(float *)(((char *)(array->a_vec) + elemsize * i)
!                         + yonset);
!                 else yval = 0;
!                 useyloc = basey + yloc + fielddesc_cvttocoord(yfielddesc, yval);
!                 for (y = elemtemplatecanvas->gl_list; y; y = y->g_next)
!                 {
!                     int xx1, xx2, yy1, yy2;
!                     t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd);
!                     if (!wb) continue;
!                     (*wb->w_parentgetrectfn)(y, glist,
!                         (t_word *)((char *)(array->a_vec) + elemsize * i),
!                             elemtemplate, usexloc, useyloc, 
!                                 &xx1, &yy1, &xx2, &yy2);
!                     if (xx1 < x1)
!                         x1 = xx1;
!                     if (yy1 < y1)
!                         y1 = yy1;
!                      if (xx2 > x2)
!                         x2 = xx2;
!                     if (yy2 > y2)
!                         y2 = yy2;   
!                 }
              }
          }
***************
*** 1527,1531 ****
  static void plot_vis(t_gobj *z, t_glist *glist, 
      t_word *data, t_template *template, float basex, float basey,
!     int vis)
  {
      t_plot *x = (t_plot *)z;
--- 1550,1554 ----
  static void plot_vis(t_gobj *z, t_glist *glist, 
      t_word *data, t_template *template, float basex, float basey,
!     int tovis)
  {
      t_plot *x = (t_plot *)z;
***************
*** 1534,1538 ****
      t_template *elemtemplate;
      t_symbol *elemtemplatesym;
!     float linewidth, xloc, xinc, yloc, style, usexloc, xsum, yval;
      t_array *array;
      int nelem;
--- 1557,1562 ----
      t_template *elemtemplate;
      t_symbol *elemtemplatesym;
!     float linewidth, xloc, xinc, yloc, style, usexloc, xsum, yval, vis,
!         scalarvis;
      t_array *array;
      int nelem;
***************
*** 1540,1548 ****
      t_fielddesc *xfielddesc, *yfielddesc, *wfielddesc;
      
-     if (!x->x_vis)
-         return;
      if (plot_readownertemplate(x, data, template, 
          &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc, &style,
!         &xfielddesc, &yfielddesc, &wfielddesc) ||
              array_getfields(elemtemplatesym, &elemtemplatecanvas,
                  &elemtemplate, &elemsize, xfielddesc, yfielddesc, wfielddesc,
--- 1564,1571 ----
      t_fielddesc *xfielddesc, *yfielddesc, *wfielddesc;
      
      if (plot_readownertemplate(x, data, template, 
          &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc, &style,
!         &vis, &scalarvis, &xfielddesc, &yfielddesc, &wfielddesc) ||
!             (vis == 0) || 
              array_getfields(elemtemplatesym, &elemtemplatecanvas,
                  &elemtemplate, &elemsize, xfielddesc, yfielddesc, wfielddesc,
***************
*** 1552,1556 ****
      elem = (char *)array->a_vec;
  
!     if (vis)
      {
          if (style == PLOTSTYLE_POINTS)
--- 1575,1579 ----
      elem = (char *)array->a_vec;
  
!     if (tovis)
      {
          if (style == PLOTSTYLE_POINTS)
***************
*** 1739,1762 ****
              This code is inefficient since the template has to be
              searched for drawing instructions for every last point. */
!         
!         for (xsum = xloc, i = 0; i < nelem; i++)
          {
!             float usexloc, useyloc;
!             t_gobj *y;
!             if (xonset >= 0)
!                 usexloc = basex + xloc +
!                     *(float *)((elem + elemsize * i) + xonset);
!             else usexloc = basex + xsum, xsum += xinc;
!             if (yonset >= 0)
!                 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)
              {
!                 t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd);
!                 if (!wb) continue;
!                 (*wb->w_parentvisfn)(y, glist,
!                     (t_word *)(elem + elemsize * i),
!                         elemtemplate, usexloc, useyloc, vis);
              }
          }
--- 1762,1787 ----
              This code is inefficient since the template has to be
              searched for drawing instructions for every last point. */
!         if (scalarvis != 0)
          {
!             for (xsum = xloc, i = 0; i < nelem; i++)
              {
!                 float usexloc, useyloc;
!                 t_gobj *y;
!                 if (xonset >= 0)
!                     usexloc = basex + xloc +
!                         *(float *)((elem + elemsize * i) + xonset);
!                 else usexloc = basex + xsum, xsum += xinc;
!                 if (yonset >= 0)
!                     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)
!                 {
!                     t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd);
!                     if (!wb) continue;
!                     (*wb->w_parentvisfn)(y, glist,
!                         (t_word *)(elem + elemsize * i),
!                             elemtemplate, usexloc, useyloc, tovis);
!                 }
              }
          }
***************
*** 1765,1779 ****
      {
              /* un-draw the individual points */
!         int i;
!         for (i = 0; i < nelem; i++)
          {
!             t_gobj *y;
!             for (y = elemtemplatecanvas->gl_list; y; y = y->g_next)
              {
!                 t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd);
!                 if (!wb) continue;
!                 (*wb->w_parentvisfn)(y, glist,
!                     (t_word *)(elem + elemsize * i), elemtemplate,
!                         0, 0, 0);
              }
          }
--- 1790,1807 ----
      {
              /* un-draw the individual points */
!         if (scalarvis != 0)
          {
!             int i;
!             for (i = 0; i < nelem; i++)
              {
!                 t_gobj *y;
!                 for (y = elemtemplatecanvas->gl_list; y; y = y->g_next)
!                 {
!                     t_parentwidgetbehavior *wb = pd_getparentwidget(&y->g_pd);
!                     if (!wb) continue;
!                     (*wb->w_parentvisfn)(y, glist,
!                         (t_word *)(elem + elemsize * i), elemtemplate,
!                             0, 0, 0);
!                 }
              }
          }
***************
*** 1791,1795 ****
      t_plot *x = (t_plot *)z;
      t_symbol *elemtemplatesym;
!     float linewidth, xloc, xinc, yloc, style;
      t_array *array;
      t_fielddesc *xfielddesc, *yfielddesc, *wfielddesc;
--- 1819,1823 ----
      t_plot *x = (t_plot *)z;
      t_symbol *elemtemplatesym;
!     float linewidth, xloc, xinc, yloc, style, vis, scalarvis;
      t_array *array;
      t_fielddesc *xfielddesc, *yfielddesc, *wfielddesc;
***************
*** 1797,1805 ****
      if (!plot_readownertemplate(x, data, template, 
          &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc, &style,
!         &xfielddesc, &yfielddesc, &wfielddesc))
      {
          return (array_doclick(array, glist, sc, ap,
              elemtemplatesym,
!             linewidth, basex + xloc, xinc, basey + yloc,
              xfielddesc, yfielddesc, wfielddesc,
              xpix, ypix, shift, alt, dbl, doit));
--- 1825,1834 ----
      if (!plot_readownertemplate(x, data, template, 
          &elemtemplatesym, &array, &linewidth, &xloc, &xinc, &yloc, &style,
!         &vis, &scalarvis,
!         &xfielddesc, &yfielddesc, &wfielddesc) && (vis != 0))
      {
          return (array_doclick(array, glist, sc, ap,
              elemtemplatesym,
!             linewidth, basex + xloc, xinc, basey + yloc, scalarvis,
              xfielddesc, yfielddesc, wfielddesc,
              xpix, ypix, shift, alt, dbl, doit));
***************
*** 2032,2036 ****
          &x1, &y1, &x2, &y2);
      if (xpix >= x1 && xpix <= x2 && ypix >= y1 && ypix <= y2
!         && x->x_value.fd_var)
      {
          if (doit)
--- 2061,2065 ----
          &x1, &y1, &x2, &y2);
      if (xpix >= x1 && xpix <= x2 && ypix >= y1 && ypix <= y2
!         && x->x_value.fd_var && x->x_vis)
      {
          if (doit)





More information about the Pd-cvs mailing list