[PD-cvs] pd/src desire.c,1.1.2.217.2.94,1.1.2.217.2.95

Mathieu Bouchard matju at users.sourceforge.net
Thu Dec 28 01:11:27 CET 2006


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

Modified Files:
      Tag: desiredata
	desire.c 
Log Message:
fix previous commit


Index: desire.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.c,v
retrieving revision 1.1.2.217.2.94
retrieving revision 1.1.2.217.2.95
diff -C2 -d -r1.1.2.217.2.94 -r1.1.2.217.2.95
*** desire.c	27 Dec 2006 23:30:31 -0000	1.1.2.217.2.94
--- desire.c	28 Dec 2006 00:11:22 -0000	1.1.2.217.2.95
***************
*** 27,30 ****
--- 27,31 ----
  #include "m_simd.h"
  #include <errno.h>
+ #include <sys/time.h>
  
  // oops, c99 only (is it standard C++ ?)
***************
*** 959,983 ****
  extern "C" void ugen_done_graph(t_dspcontext *dc);
  
!     /* schedule one canvas for DSP.  This is called below for all "root"
!     canvases, but is also called from the "dsp" method for sub-
!     canvases, which are treated almost like any other tilde object.  */
! 
  static void canvas_dodsp(t_canvas *x, int toplevel, t_signal **sp) {
      t_object *ob;
      t_symbol *dspsym = gensym("dsp");
-     t_dspcontext *dc;
- 
      /* create a new "DSP graph" object to use in sorting this canvas.
         If we aren't toplevel, there are already other dspcontexts around. */
!     dc = ugen_start_graph(toplevel, sp, obj_nsiginlets(x), obj_nsigoutlets(x));
! 
      /* find all the "dsp" boxes and add them to the graph */
      canvas_each(y,x) if ((ob = pd_checkobject(y)) && zgetfn(y,dspsym)) ugen_add(dc, ob);
- 
      /* ... and all dsp interconnections */
      canvas_wires_each(oc,t,x)
          if (obj_issignaloutlet(t.from, t.outlet))
              ugen_connect(dc, t.from, t.outlet, t.to, t.inlet);
- 
      /* finally, sort them and add them to the DSP chain */
      ugen_done_graph(dc);
--- 960,978 ----
  extern "C" void ugen_done_graph(t_dspcontext *dc);
  
! /* schedule one canvas for DSP.  This is called below for all "root"
!    canvases, but is also called from the "dsp" method for sub-
!    canvases, which are treated almost like any other tilde object.  */
  static void canvas_dodsp(t_canvas *x, int toplevel, t_signal **sp) {
      t_object *ob;
      t_symbol *dspsym = gensym("dsp");
      /* create a new "DSP graph" object to use in sorting this canvas.
         If we aren't toplevel, there are already other dspcontexts around. */
!     t_dspcontext *dc = ugen_start_graph(toplevel, sp, obj_nsiginlets(x), obj_nsigoutlets(x));
      /* find all the "dsp" boxes and add them to the graph */
      canvas_each(y,x) if ((ob = pd_checkobject(y)) && zgetfn(y,dspsym)) ugen_add(dc, ob);
      /* ... and all dsp interconnections */
      canvas_wires_each(oc,t,x)
          if (obj_issignaloutlet(t.from, t.outlet))
              ugen_connect(dc, t.from, t.outlet, t.to, t.inlet);
      /* finally, sort them and add them to the DSP chain */
      ugen_done_graph(dc);
***************
*** 986,995 ****
  static void canvas_dsp(t_canvas *x, t_signal **sp) {canvas_dodsp(x, 0, sp);}
  
!     /* this routine starts DSP for all root canvases. */
  static void canvas_start_dsp(void) {
      if (canvas_dspstate) ugen_stop();
      else sys_gui("pdtk_pd_dsp 1\n");
      ugen_start();
      canvases_each(x) canvas_dodsp(x,1,0);
      canvas_dspstate = 1;
  }
--- 981,994 ----
  static void canvas_dsp(t_canvas *x, t_signal **sp) {canvas_dodsp(x, 0, sp);}
  
! /* this routine starts DSP for all root canvases. */
  static void canvas_start_dsp(void) {
      if (canvas_dspstate) ugen_stop();
      else sys_gui("pdtk_pd_dsp 1\n");
      ugen_start();
+     //timeval v0,v1;
+     //gettimeofday(&v0,0);
      canvases_each(x) canvas_dodsp(x,1,0);
+     //gettimeofday(&v1,0);
+     //printf("canvas_start_dsp took %ld us\n",(v1.tv_sec-v0.tv_sec)*1000000+(v1.tv_usec-v0.tv_usec));
      canvas_dspstate = 1;
  }
***************
*** 1023,1029 ****
  
  extern "C" void glob_dsp(void *dummy, t_symbol *s, int argc, t_atom *argv) {
-     int newstate;
      if (argc) {
!         newstate = atom_getintarg(0, argc, argv);
          if (newstate && !canvas_dspstate) {
              canvas_start_dsp();
--- 1022,1027 ----
  
  extern "C" void glob_dsp(void *dummy, t_symbol *s, int argc, t_atom *argv) {
      if (argc) {
!         int newstate = atom_getintarg(0, argc, argv);
          if (newstate && !canvas_dspstate) {
              canvas_start_dsp();
***************
*** 5837,5841 ****
  void canvas_text(t_canvas *gl, t_symbol *s, int argc, t_atom *argv) {
      t_text *x = (t_text *)pd_new(text_class);
-     t_atom at;
      x->binbuf = binbuf_new();
      x->x = atom_getintarg(0, argc, argv);
--- 5835,5838 ----
***************
*** 6198,6202 ****
  	if (o->_class->firstin) strcpy(foo,o->_class->firsttip->s_name); else strcpy(foo,"");
  	int n = obj_ninlets(x);
! 	char *foop = foo;
  	for (int i=!!o->_class->firstin; i<n; i++) {
  		strcat(foo," ");
--- 6195,6199 ----
  	if (o->_class->firstin) strcpy(foo,o->_class->firsttip->s_name); else strcpy(foo,"");
  	int n = obj_ninlets(x);
! 	//char *foop = foo;
  	for (int i=!!o->_class->firstin; i<n; i++) {
  		strcat(foo," ");
***************
*** 6494,6498 ****
  		binbuf_addv(b, ";");
  	} else { /* this was outside of the "else" for a while. why? I don't remember */
! 		c->c_savefn(self,b);
  	}
  	appendix_save(self,b);
--- 6491,6495 ----
  		binbuf_addv(b, ";");
  	} else { /* this was outside of the "else" for a while. why? I don't remember */
! 		c->savefn(self,b);
  	}
  	appendix_save(self,b);





More information about the Pd-cvs mailing list