[PD-cvs] externals/mrpeach/osc pipelist.c,1.1,1.2

Martin Peach mrpeach at users.sourceforge.net
Thu Jul 12 17:20:29 CEST 2007


Update of /cvsroot/pure-data/externals/mrpeach/osc
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6866

Modified Files:
	pipelist.c 
Log Message:
Negative and zero delays now cause lists to pass straight through without clock_delay and memory allocation/copying.


Index: pipelist.c
===================================================================
RCS file: /cvsroot/pure-data/externals/mrpeach/osc/pipelist.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** pipelist.c	11 Jul 2007 19:44:32 -0000	1.1
--- pipelist.c	12 Jul 2007 15:20:27 -0000	1.2
***************
*** 85,101 ****
  static void pipelist_list(t_pipelist *x, t_symbol *s, int ac, t_atom *av)
  {
!     t_hang *h = (t_hang *)getbytes(sizeof(t_hang));
!     int i;
  
!     h->h_n = ac;
!     h->h_atoms = (t_atom *)getbytes(h->h_n*sizeof(t_atom));
  
!     for (i = 0; i < h->h_n; ++i)
!         h->h_atoms[i] = av[i];
!     h->h_next = x->x_hang;
!     x->x_hang = h;
!     h->h_owner = x;
!     h->h_clock = clock_new(h, (t_method)pipelist_hang_tick);
!     clock_delay(h->h_clock, (x->x_deltime >= 0 ? x->x_deltime : 0));
  }
  
--- 85,107 ----
  static void pipelist_list(t_pipelist *x, t_symbol *s, int ac, t_atom *av)
  {
!     if (x->x_deltime > 0)
!     { /* if delay is real, save the list for output in delay milliseconds */
!         t_hang *h;
!         int i;
  
!         h = (t_hang *)getbytes(sizeof(t_hang));
!         h->h_n = ac;
!         h->h_atoms = (t_atom *)getbytes(h->h_n*sizeof(t_atom));
  
!         for (i = 0; i < h->h_n; ++i)
!             h->h_atoms[i] = av[i];
!         h->h_next = x->x_hang;
!         x->x_hang = h;
!         h->h_owner = x;
!         h->h_clock = clock_new(h, (t_method)pipelist_hang_tick);
!         clock_delay(h->h_clock, (x->x_deltime >= 0 ? x->x_deltime : 0));
!     }
!     /* otherwise just pass the list straight through  */
!     else outlet_list(x->x_pipelistout, &s_list, ac, av);
  }
  





More information about the Pd-cvs mailing list