[PD-cvs] pd/src x_time.c,1.2,1.2.8.1

Tim Blechmann timblech at users.sourceforge.net
Sat Aug 6 22:56:13 CEST 2005


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

Modified Files:
      Tag: devel_0_39
	x_time.c 
Log Message:
settable granularity for line

Index: x_time.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/x_time.c,v
retrieving revision 1.2
retrieving revision 1.2.8.1
diff -C2 -d -r1.2 -r1.2.8.1
*** x_time.c	6 Sep 2004 20:20:36 -0000	1.2
--- x_time.c	6 Aug 2005 20:56:11 -0000	1.2.8.1
***************
*** 220,223 ****
--- 220,230 ----
  }
  
+ static void line_set_granularity(t_line *x, t_floatarg grain)
+ {
+ 	if (grain <= 0) grain = 20;
+     x->x_grain = grain;
+ }
+ 
+ 
  static void line_free(t_line *x)
  {
***************
*** 233,238 ****
      x->x_clock = clock_new(x, (t_method)line_tick);
      x->x_targettime = x->x_prevtime = clock_getsystime();
!     if (grain <= 0) grain = 20;
!     x->x_grain = grain;
      outlet_new(&x->x_obj, gensym("float"));
      inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("ft1"));
--- 240,244 ----
      x->x_clock = clock_new(x, (t_method)line_tick);
      x->x_targettime = x->x_prevtime = clock_getsystime();
! 	line_set_granularity(x, grain);
      outlet_new(&x->x_obj, gensym("float"));
      inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("ft1"));
***************
*** 250,253 ****
--- 256,261 ----
      class_addmethod(line_class, (t_method)line_set,
          gensym("set"), A_FLOAT, 0);
+     class_addmethod(line_class, (t_method)line_set_granularity,
+         gensym("granularity"), A_FLOAT, 0);
      class_addfloat(line_class, (t_method)line_float);
  }





More information about the Pd-cvs mailing list