[PD-cvs] pd/src configure.in, 1.13, 1.14 d_filter.c, 1.4, 1.5 d_osc.c, 1.2, 1.3 d_soundfile.c, 1.6, 1.7 g_template.c, 1.9, 1.10 g_traversal.c, 1.3, 1.4 makefile, 1.15, 1.16 makefile.dependencies, 1.7, 1.8 notes.txt, 1.16, 1.17 s_file.c, 1.6, 1.7 s_inter.c, 1.11, 1.12 s_main.c, 1.14, 1.15 t_tkcmd.c, 1.3, 1.4 u_main.tk, 1.14, 1.15 x_list.c, 1.1, 1.2

Miller Puckette millerpuckette at users.sourceforge.net
Fri Jul 29 21:01:25 CEST 2005


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

Modified Files:
	configure.in d_filter.c d_osc.c d_soundfile.c g_template.c 
	g_traversal.c makefile makefile.dependencies notes.txt 
	s_file.c s_inter.c s_main.c t_tkcmd.c u_main.tk x_list.c 
Log Message:
Mac to work with tcl/tk 8.4.5; pd extension added automatically in saveas 
bug fix writing aiff gfiles
bug fix (tcl error messages when starting open dialogs)




Index: g_traversal.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_traversal.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** g_traversal.c	24 Jul 2005 19:41:14 -0000	1.3
--- g_traversal.c	29 Jul 2005 19:01:20 -0000	1.4
***************
*** 417,423 ****
      for (i = nitems - 1, vp = x->x_variables + i; i >= 0; i--, vp--)
      {
!         float f = template_getfloat(template, vp->gv_sym, vec, 1);
!         outlet_float(vp->gv_outlet, f);
!             /* LATER deal with other types. */
      }
  }
--- 417,435 ----
      for (i = nitems - 1, vp = x->x_variables + i; i >= 0; i--, vp--)
      {
!         int onset, type;
!         t_symbol *arraytype;
!         if (template_find_field(template, vp->gv_sym, &onset, &type, &arraytype))
!         {
!             if (type == DT_FLOAT)
!                 outlet_float(vp->gv_outlet,
!                     *(t_float *)(((char *)vec) + onset));
!             else if (type == DT_SYMBOL)
!                 outlet_symbol(vp->gv_outlet,
!                     *(t_symbol **)(((char *)vec) + onset));
!             else pd_error(x, "get: %s.%s is not a number or symbol",
!                     template->t_sym->s_name, vp->gv_sym->s_name);
!         }
!         else pd_error(x, "get: %s.%s: no such field",
!             template->t_sym->s_name, vp->gv_sym->s_name);
      }
  }
***************
*** 442,446 ****
  {
      t_symbol *gv_sym;
!     t_float gv_f;       /* LATER take other types */
  } t_setvariable;
  
--- 454,458 ----
  {
      t_symbol *gv_sym;
!     union word gv_w;
  } t_setvariable;
  
***************
*** 451,454 ****
--- 463,467 ----
      t_symbol *x_templatesym;
      int x_nin;
+     int x_issymbol;
      t_setvariable *x_variables;
  } t_set;
***************
*** 459,462 ****
--- 472,483 ----
      int i;
      t_setvariable *sp;
+     if (argc && (argv[0].a_type == A_SYMBOL) &&
+         !strcmp(argv[0].a_w.w_symbol->s_name, "-symbol"))
+     {
+         x->x_issymbol = 1;
+         argc--;
+         argv++;
+     }
+     else x->x_issymbol = 0;
      x->x_templatesym = canvas_makebindsym(atom_getsymbolarg(0, argc, argv));
      if (argc) argc--, argv++;
***************
*** 469,475 ****
          {
              sp->gv_sym = atom_getsymbolarg(i, argc, argv);
!             sp->gv_f = 0;
!             if (i) floatinlet_new(&x->x_obj, &sp->gv_f);
!                 /* LATER figure out type as in "get" object. */
          }
      }
--- 490,502 ----
          {
              sp->gv_sym = atom_getsymbolarg(i, argc, argv);
!             if (x->x_issymbol)
!                 sp->gv_w.w_symbol = &s_;
!             else sp->gv_w.w_float = 0;
!             if (i)
!             {
!                 if (x->x_issymbol)
!                     symbolinlet_new(&x->x_obj, &sp->gv_w.w_symbol);
!                 else floatinlet_new(&x->x_obj, &sp->gv_w.w_float);
!             }
          }
      }
***************
*** 479,483 ****
  }
  
! static void set_float(t_set *x, t_float f)
  {
      int nitems = x->x_nin, i;
--- 506,510 ----
  }
  
! static void set_bang(t_set *x)
  {
      int nitems = x->x_nin, i;
***************
*** 504,516 ****
          return;
      }
!     if (!nitems) return;
!     x->x_variables[0].gv_f = f;
!     if (gs->gs_which == GP_ARRAY) vec = gp->gp_un.gp_w;
      else vec = gp->gp_un.gp_scalar->sc_vec;
!     for (i = 0, vp = x->x_variables; i < nitems; i++, vp++)
!     {
!         template_setfloat(template, vp->gv_sym, vec, vp->gv_f, 1);
!             /* LATER deal with other types ala get_pointer. */
!     }
      if (gs->gs_which == GP_GLIST)
          glist_redrawitem(gs->gs_un.gs_glist, (t_gobj *)(gp->gp_un.gp_scalar));  
--- 531,544 ----
          return;
      }
!     if (!nitems)
!         return;
!     if (gs->gs_which == GP_ARRAY)
!         vec = gp->gp_un.gp_w;
      else vec = gp->gp_un.gp_scalar->sc_vec;
!     if (x->x_issymbol)
!         for (i = 0, vp = x->x_variables; i < nitems; i++, vp++)
!             template_setsymbol(template, vp->gv_sym, vec, vp->gv_w.w_symbol, 1);
!     else for (i = 0, vp = x->x_variables; i < nitems; i++, vp++)
!         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));  
***************
*** 525,528 ****
--- 553,576 ----
  }
  
+ static void set_float(t_set *x, t_float f)
+ {
+     if (x->x_nin && !x->x_issymbol)
+     {
+         x->x_variables[0].gv_w.w_float = f;
+         set_bang(x);
+     }
+     else pd_error(x, "type mismatch or no field specified");
+ }
+ 
+ static void set_symbol(t_set *x, t_symbol *s)
+ {
+     if (x->x_nin && x->x_issymbol)
+     {
+         x->x_variables[0].gv_w.w_symbol = s;
+         set_bang(x);
+     }
+     else pd_error(x, "type mismatch or no field specified");
+ }
+ 
  static void set_free(t_set *x)
  {
***************
*** 536,539 ****
--- 584,589 ----
          (t_method)set_free, sizeof(t_set), 0, A_GIMME, 0);
      class_addfloat(set_class, set_float); 
+     class_addsymbol(set_class, set_symbol); 
+     class_addbang(set_class, set_bang); 
  }
  

Index: s_main.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_main.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** s_main.c	16 Jul 2005 01:43:18 -0000	1.14
--- s_main.c	29 Jul 2005 19:01:21 -0000	1.15
***************
*** 3,7 ****
  * WARRANTIES, see the file, "LICENSE.txt," in this distribution.  */
  
! char pd_version[] = "Pd version 0.39 TEST 4\n";
  char pd_compiletime[] = __TIME__;
  char pd_compiledate[] = __DATE__;
--- 3,7 ----
  * WARRANTIES, see the file, "LICENSE.txt," in this distribution.  */
  
! char pd_version[] = "Pd version 0.39 TEST 4b\n";
  char pd_compiletime[] = __TIME__;
  char pd_compiledate[] = __DATE__;

Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** u_main.tk	24 Jul 2005 19:41:14 -0000	1.14
--- u_main.tk	29 Jul 2005 19:01:21 -0000	1.15
***************
*** 1427,1431 ****
  
  proc pdtk_canvas_click {name x y b f} {
! #    puts stderr [concat got $f]
      pd [canvastosym $name] mouse [$name canvasx $x] [$name canvasy $y] $b $f \;
  }
--- 1427,1432 ----
  
  proc pdtk_canvas_click {name x y b f} {
!     global pd_nt
!     if {$pd_nt == 0} {focus $name}
      pd [canvastosym $name] mouse [$name canvasx $x] [$name canvasy $y] $b $f \;
  }
***************
*** 1622,1625 ****
--- 1623,1627 ----
  
  proc pdtk_canvas_saveas {name initfile initdir} {
+     global pd_nt
      set filename [tk_getSaveFile -initialfile $initfile \
         -initialdir $initdir  -defaultextension .pd \
***************
*** 1627,1630 ****
--- 1629,1648 ----
  
      if {$filename != ""} {
+ # yes, we need the extent even if we're on a mac.
+ 	if {$pd_nt == 2} {
+ 	  if {[string last .pd $filename] < 0 && \
+             [string last .PD $filename] < 0 && \
+             [string last .pat $filename] < 0 && \
+ 	    [string last .PAT $filename] < 0} {
+ 		set filename $filename.pd
+ 		if {[file exists $filename]} {
+     			set answer [tk_messageBox \
+ 			\-message [concat overwrite $filename "?"] \
+ 			 \-type yesno \-icon question]
+     			if {$answer == no} {return}
+ 		}
+ 	  }
+ 	}
+ 
      	set directory [string range $filename 0 \
      	    [expr [string last / $filename ] - 1]]

Index: configure.in
===================================================================
RCS file: /cvsroot/pure-data/pd/src/configure.in,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** configure.in	24 Jul 2005 19:41:14 -0000	1.13
--- configure.in	29 Jul 2005 19:01:19 -0000	1.14
***************
*** 34,38 ****
      portmidi=$enableval)
  AC_ARG_ENABLE(debug,    [  --enable-debug          debugging support],
!     USE_DEBUG_CFLAGS="no")
  AC_ARG_ENABLE(static,   [  --enable-static         link statically],
      static=$enableval)
--- 34,38 ----
      portmidi=$enableval)
  AC_ARG_ENABLE(debug,    [  --enable-debug          debugging support],
!     USE_DEBUG_CFLAGS=$enableval)
  AC_ARG_ENABLE(static,   [  --enable-static         link statically],
      static=$enableval)

Index: s_inter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** s_inter.c	24 Jul 2005 19:41:14 -0000	1.11
--- s_inter.c	29 Jul 2005 19:01:21 -0000	1.12
***************
*** 469,472 ****
--- 469,474 ----
  }
  
+ void sys_exit(void);
+ 
  void socketreceiver_read(t_socketreceiver *x, int fd)
  {
***************
*** 507,511 ****
                  {
                      fprintf(stderr, "pd: exiting\n");
!                     sys_bail(0);
                  }
                  else
--- 509,514 ----
                  {
                      fprintf(stderr, "pd: exiting\n");
!                     sys_exit();
!                     return;
                  }
                  else
***************
*** 1029,1032 ****
--- 1032,1036 ----
                  char *homedir = getenv("HOME"), filename[250];
                  struct stat statbuf;
+                     /* first look for Wish bundled with and renamed "Pd" */
                  sprintf(filename, "%s/../../MacOS/Pd", guidir);
                  if (stat(filename, &statbuf) >= 0)
***************
*** 1034,1037 ****
--- 1038,1044 ----
                  if (!homedir || strlen(homedir) > 150)
                      goto nohomedir;
+                     /* Look for Wish in user's Applications.  Might or might
+                     not be names "Wish Shell", and might or might not be
+                     in "Utilities" subdir. */
                  sprintf(filename,
                      "%s/Applications/Utilities/Wish shell.app/Contents/MacOS/Wish Shell",
***************
*** 1040,1048 ****
--- 1047,1066 ----
                      goto foundit;
                  sprintf(filename,
+                     "%s/Applications/Utilities/Wish.app/Contents/MacOS/Wish",
+                         homedir);
+                 if (stat(filename, &statbuf) >= 0)
+                     goto foundit;
+                 sprintf(filename,
                      "%s/Applications/Wish shell.app/Contents/MacOS/Wish Shell",
                          homedir);
                  if (stat(filename, &statbuf) >= 0)
                      goto foundit;
+                 sprintf(filename,
+                     "%s/Applications/Wish.app/Contents/MacOS/Wish",
+                         homedir);
+                 if (stat(filename, &statbuf) >= 0)
+                     goto foundit;
              nohomedir:
+                     /* Perform the same search among system applications. */
                  strcpy(filename, 
                      "/Applications/Utilities/Wish Shell.app/Contents/MacOS/Wish Shell");
***************
*** 1050,1054 ****
--- 1068,1080 ----
                      goto foundit;
                  strcpy(filename, 
+                     "/Applications/Utilities/Wish.app/Contents/MacOS/Wish");
+                 if (stat(filename, &statbuf) >= 0)
+                     goto foundit;
+                 strcpy(filename, 
                      "/Applications/Wish Shell.app/Contents/MacOS/Wish Shell");
+                 if (stat(filename, &statbuf) >= 0)
+                     goto foundit;
+                 strcpy(filename, 
+                     "/Applications/Wish.app/Contents/MacOS/Wish");
              foundit:
                  sprintf(cmdbuf, "\"%s\" %s/pd.tk %d\n", filename, guidir, portno);
***************
*** 1236,1242 ****
          fprintf(stderr, "... done.\n");
  #endif
!         exit(1);
      }
!     else _exit(n);
  }
  
--- 1262,1268 ----
          fprintf(stderr, "... done.\n");
  #endif
!         exit(n);
      }
!     else _exit(1);
  }
  

Index: makefile
===================================================================
RCS file: /cvsroot/pure-data/pd/src/makefile,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** makefile	24 Jul 2005 19:41:14 -0000	1.15
--- makefile	29 Jul 2005 19:01:20 -0000	1.16
***************
*** 20,24 ****
  LIB =   -ldl -lpthread -lasound
  
! OPT_CFLAGS = -O6 -funroll-loops -fomit-frame-pointer
  WARN_CFLAGS = -Wall -W -Wstrict-prototypes \
      -Wno-unused -Wno-parentheses -Wno-switch
--- 20,24 ----
  LIB =   -ldl -lpthread -lasound
  
! OPT_CFLAGS = -g
  WARN_CFLAGS = -Wall -W -Wstrict-prototypes \
      -Wno-unused -Wno-parentheses -Wno-switch

Index: s_file.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_file.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** s_file.c	8 Jul 2005 00:02:45 -0000	1.6
--- s_file.c	29 Jul 2005 19:01:21 -0000	1.7
***************
*** 264,268 ****
      int nmidiindev, midiindev[MAXMIDIINDEV];
      int nmidioutdev, midioutdev[MAXMIDIOUTDEV];
!     int i, rate = 0, advance = 0, api, nolib;
      char prefbuf[MAXPDSTRING], keybuf[80];
      sys_initloadpreferences();
--- 264,268 ----
      int nmidiindev, midiindev[MAXMIDIINDEV];
      int nmidioutdev, midioutdev[MAXMIDIOUTDEV];
!     int i, rate = 0, advance = 0, api, nolib, maxi;
      char prefbuf[MAXPDSTRING], keybuf[80];
      sys_initloadpreferences();
***************
*** 339,344 ****
      }
      sys_open_midi(nmidiindev, midiindev, nmidioutdev, midioutdev, 0);
          /* search path */
!     for (i = 0; 1; i++)
      {
          sprintf(keybuf, "path%d", i+1);
--- 339,348 ----
      }
      sys_open_midi(nmidiindev, midiindev, nmidioutdev, midioutdev, 0);
+ 
          /* search path */
!     if (sys_getpreference("npath", prefbuf, MAXPDSTRING))
!         sscanf(prefbuf, "%d", &maxi);
!     else maxi = 0x7fffffff;
!     for (i = 0; i<maxi; i++)
      {
          sprintf(keybuf, "path%d", i+1);
***************
*** 353,357 ****
  
          /* startup settings */
!     for (i = 0; 1; i++)
      {
          sprintf(keybuf, "loadlib%d", i+1);
--- 357,364 ----
  
          /* startup settings */
!     if (sys_getpreference("nloadlib", prefbuf, MAXPDSTRING))
!         sscanf(prefbuf, "%d", &maxi);
!     else maxi = 0x7fffffff;
!     for (i = 0; i<maxi; i++)
      {
          sprintf(keybuf, "loadlib%d", i+1);
***************
*** 449,452 ****
--- 456,461 ----
          sys_putpreference(buf1, pathelem);
      }
+     sprintf(buf1, "%d", i);
+     sys_putpreference("npath", buf1);
      sprintf(buf1, "%d", sys_usestdpath);
      sys_putpreference("standardpath", buf1);
***************
*** 463,466 ****
--- 472,477 ----
          sys_putpreference(buf1, pathelem);
      }
+     sprintf(buf1, "%d", i);
+     sys_putpreference("nloadlib", buf1);
      sprintf(buf1, "%d", sys_defeatrt);
      sys_putpreference("defeatrt", buf1);

Index: notes.txt
===================================================================
RCS file: /cvsroot/pure-data/pd/src/notes.txt,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** notes.txt	24 Jul 2005 19:41:14 -0000	1.16
--- notes.txt	29 Jul 2005 19:01:21 -0000	1.17
***************
*** 13,17 ****
  unify graph properties dialogs
  GOP font depends on abstraction, not parent
! 
  
  ------------ 0.39 ---------
--- 13,22 ----
  unify graph properties dialogs
  GOP font depends on abstraction, not parent
! bug fixes, stale pointers
! message "addcomma" etc
! "list" object
! Mac to tcl/tk 8.4.5; pd extension added automatically
! bug fix writing aiff gfiles
! bug fix (tcl error messages when starting open dialogs)
  
  ------------ 0.39 ---------
***************
*** 19,39 ****
  windows:
    modal dialogs confuse watchdog
  mac:
!   .pd extension not added when saving?
! TK commands to nonexistent windows? (maybe fixed)
! array name changes don't show up on parent
! arrays that don't fit in bounds don't update (same as red rectangle problem?)
! what about upsampling inlet~s?  ask Pd list...
! 
! 
! flag for array to suppress printing name
  
  check:
  MIDI I/O for windows
  blechman patch for s_inter.c
  
  garray change:
  make a gobj_redraw that schedules the redraw
- put two radio button banks side by side
  array_resize etc., should redraw the array directly?  Or should "setsize"
      and "garray_resize" do it instead?  check it's queued correctly.
--- 24,38 ----
  windows:
    modal dialogs confuse watchdog
+   check the right-click-on-empty-canvas
  mac:
!   load libraries first before opening patches on drag-and-drop
  
  check:
  MIDI I/O for windows
  blechman patch for s_inter.c
+ check what happens when going back and forth between graph-on-parent
  
  garray change:
  make a gobj_redraw that schedules the redraw
  array_resize etc., should redraw the array directly?  Or should "setsize"
      and "garray_resize" do it instead?  check it's queued correctly.
***************
*** 46,51 ****
  
  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??)
  check if there's a problem loading libs on startup if superuser
--- 45,55 ----
  
  problems:
+ TK commands to nonexistent windows? (occasionally still happens)
+ array name changes don't show up on parent
+ arrays that don't fit in bounds don't update (same as red rectangle problem?)
+ look in d_resample.pd to inderstand inlet~ upsampling...
+ flag for array to suppress printing name
+ fix samplerate~ to figure out blocking
  patcher inlets don't deal with scalars (zbug.pd)
  need to optimize canvas_motion (get rid of box hit test??)
  check if there's a problem loading libs on startup if superuser
***************
*** 61,67 ****
  don't draw in/outlets on gui objects in graph-on-parent
  reasonable font size default for GUIs
- font size should depend on subpatch/abstraction
  moving a bang toward top of window creates problem (invisible label)
- check what happens when going back and forth between graph-on-parent
  get rid of messages causing renaming; try to prevent patches closing themselves.
  dac~/ adc~/ block~ incompatibility
--- 65,69 ----
***************
*** 73,81 ****
  features:
  flag to suppress printing array name above graph
- rename windowname-pd instead of pd-windowname
  fix copyright notices
  IEM guis to use queued updates
  pixel font sizes
  pd to find running ones (pd -new to defeat)
  "enter" into object box to create new one (also, changing borders? forking?)
  tab to jump to a connected object (first one?) (shift-tab to back up?)
--- 75,83 ----
  features:
  flag to suppress printing array name above graph
  fix copyright notices
  IEM guis to use queued updates
  pixel font sizes
  pd to find running ones (pd -new to defeat)
+ rename windowname-pd instead of pd-windowname
  "enter" into object box to create new one (also, changing borders? forking?)
  tab to jump to a connected object (first one?) (shift-tab to back up?)
***************
*** 89,96 ****
  think of a way to embed abstractions in a patch
  make watchdog work for MACOSX
- IEMGUIs better default font size
  search path to include both calling patch and abstraction, if different
  abstraction reload shouldn't have to vis everyone
- addcomma message to message
  pasting should look at current mouse location
  delete-in-rectangle message to Pds
--- 91,96 ----

Index: d_filter.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_filter.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** d_filter.c	18 May 2005 04:28:50 -0000	1.4
--- d_filter.c	29 Jul 2005 19:01:19 -0000	1.5
***************
*** 513,519 ****
  }
  
! static void sigsamphold_reset(t_sigsamphold *x)
  {
!     x->x_lastin = 1e20;
  }
  
--- 513,521 ----
  }
  
! static void sigsamphold_reset(t_sigsamphold *x, t_symbol *s, int argc,
!     t_atom *argv)
  {
!     x->x_lastin = ((argc > 0 && (argv[0].a_type == A_FLOAT)) ?
!         argv[0].a_w.w_float : 1e20);
  }
  
***************
*** 531,535 ****
          gensym("set"), A_DEFFLOAT, 0);
      class_addmethod(sigsamphold_class, (t_method)sigsamphold_reset,
!         gensym("reset"), 0);
      class_addmethod(sigsamphold_class, (t_method)sigsamphold_dsp,
          gensym("dsp"), 0);
--- 533,537 ----
          gensym("set"), A_DEFFLOAT, 0);
      class_addmethod(sigsamphold_class, (t_method)sigsamphold_reset,
!         gensym("reset"), A_GIMME, 0);
      class_addmethod(sigsamphold_class, (t_method)sigsamphold_dsp,
          gensym("dsp"), 0);

Index: x_list.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/x_list.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** x_list.c	24 Jul 2005 19:41:15 -0000	1.1
--- x_list.c	29 Jul 2005 19:01:22 -0000	1.2
***************
*** 16,20 ****
      list prepend - prepend a list to another
      list split - first n elements to first outlet, rest to second outlet 
!     list strip - send message with leading symbol as selector
      list length - output number of items in list
      list nth - nth item in list, counting from zero
--- 16,20 ----
      list prepend - prepend a list to another
      list split - first n elements to first outlet, rest to second outlet 
!     list trim - trim off "list" selector
      list length - output number of items in list
      list nth - nth item in list, counting from zero

Index: t_tkcmd.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/t_tkcmd.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** t_tkcmd.c	6 Nov 2004 16:07:34 -0000	1.3
--- t_tkcmd.c	29 Jul 2005 19:01:21 -0000	1.4
***************
*** 100,104 ****
  static int sockfd;
  
! /* The "pd_suck" command, which polls the socket. */
  
  #define CHUNKSIZE 20000 /* chunks to allocate memory for reading socket */
--- 100,104 ----
  static int sockfd;
  
! /* The "pd_readsocket" command, which polls the socket. */
  
  #define CHUNKSIZE 20000 /* chunks to allocate memory for reading socket */
***************
*** 107,115 ****
  static char *pd_tkbuf = 0;      /* buffer for reading */
  static int pd_tkbufsize = 0;    /* current buffer size */
! static int pd_tkgotbytes = 0;   /* number of bytes already in buffer */
  
  static void pd_readsocket(ClientData cd, int mask)
  {
-     int ngot;
      fd_set readset, writeset, exceptset;
      struct timeval timout;
--- 107,116 ----
  static char *pd_tkbuf = 0;      /* buffer for reading */
  static int pd_tkbufsize = 0;    /* current buffer size */
! static int pd_buftail = 0;      /* number of bytes already in buffer */
! static int pd_bufhead = 0;    /* index of first byte to read */
  
+     /* mask argument unused but is here to follow tcl's prototype. */
  static void pd_readsocket(ClientData cd, int mask)
  {
      fd_set readset, writeset, exceptset;
      struct timeval timout;
***************
*** 131,135 ****
          pd_tkbufsize = CHUNKSIZE;
      }
!     if (pd_tkgotbytes + READSIZE + 1 > pd_tkbufsize)
      {   
          int newsize = pd_tkbufsize + CHUNKSIZE;
--- 132,136 ----
          pd_tkbufsize = CHUNKSIZE;
      }
!     if (pd_buftail + READSIZE + 1 > pd_tkbufsize)
      {   
          int newsize = pd_tkbufsize + CHUNKSIZE;
***************
*** 148,157 ****
      {
          int ret;
!         ret = recv(sockfd, pd_tkbuf + pd_tkgotbytes, READSIZE, 0);
          if (ret < 0)
              pdgui_sockerror("socket receive error");
          else if (ret == 0)
          {
!             /* fprintf(stderr, "read %d\n", SOCKSIZE - pd_tkgotbytes); */
              fprintf(stderr, "pd_gui: pd process exited\n");
              tcl_mess("exit\n");
--- 149,158 ----
      {
          int ret;
!         ret = recv(sockfd, pd_tkbuf + pd_buftail, READSIZE, 0);
          if (ret < 0)
              pdgui_sockerror("socket receive error");
          else if (ret == 0)
          {
!             /* fprintf(stderr, "read %d\n", SOCKSIZE - pd_buftail); */
              fprintf(stderr, "pd_gui: pd process exited\n");
              tcl_mess("exit\n");
***************
*** 159,201 ****
          else
          {
!             char *lastcr = 0, *bp = pd_tkbuf, *ep = bp + (pd_tkgotbytes + ret);
!             int brace = 0;
!             char lastc = 0;
!                 /* search for locations that terminate a complete TK
!                 command.  These are carriage returns which are not inside
!                 any braces.  Braces can be escaped with backslashes (but
!                 backslashes themselves can't.) */
!             while (bp < ep)
!             {
!                 char c = *bp;
!                 if (c == '}' && brace)
!                     brace--;
!                 else if (c == '{')
!                     brace++;
!                 else if (!brace && c == '\n' && lastc != '\\')
!                     lastcr = bp;
!                 lastc = c;
!                 bp++;
!             }
!                 /* if lastcr is set there is at least one complete TK
!                 command in the buffer.  Execute it or them, and slide any
!                 extra bytes to beginning of the buffer. */
!             if (lastcr)
              {
!                 int xtra = pd_tkbuf + pd_tkgotbytes + ret - (lastcr+1);
!                 char bashwas = lastcr[1];
!                 lastcr[1] = 0;
!                 tcl_mess(pd_tkbuf);
!                 lastcr[1] = bashwas;
!                 if (xtra)
                  {
!                     /* fprintf(stderr, "x %d\n", xtra); */
!                     memmove(pd_tkbuf, lastcr+1, xtra);
                  }
!                 pd_tkgotbytes = xtra;
              }
!             else
              {
!                 pd_tkgotbytes += ret;
              }
          }
--- 160,226 ----
          else
          {
!             pd_buftail += ret;
!             while (1)
              {
!                 char lastc = 0, *gotcr = 0, *bp = pd_tkbuf + pd_bufhead,
!                     *ep = pd_tkbuf + pd_buftail;
!                 int brace = 0;
!                     /* search for locations that terminate a complete TK
!                     command.  These are carriage returns which are not inside
!                     any braces.  Braces can be escaped with backslashes (but
!                     backslashes themselves can't.) */
!                 while (bp < ep)
                  {
!                     char c = *bp;
!                     if (c == '}' && brace)
!                         brace--;
!                     else if (c == '{')
!                         brace++;
!                     else if (!brace && c == '\n' && lastc != '\\')
!                     {
!                         gotcr = bp;
!                         break;
!                     }
!                     lastc = c;
!                     bp++;
                  }
!                     /* if gotcr is set there is at least one complete TK
!                     command in the buffer, and gotcr terminates the first one.
!                     Because sending the command to tcl may cause this code to
!                     be reentered, we first copy the command and take it out of
!                     the buffer, then execute the command.
!                     Execute it and slide any
!                     extra bytes to beginning of the buffer. */
!                 if (gotcr)
!                 {
!                     int bytesincmd = (gotcr - (pd_tkbuf+pd_bufhead)) + 1;
!                     char smallcmdbuf[1000], *realcmdbuf;
!                     if (gotcr - (pd_tkbuf+pd_bufhead) < 998)
!                         realcmdbuf = smallcmdbuf;
!                     else realcmdbuf = malloc(bytesincmd+1);
!                     if (realcmdbuf)
!                     {
!                         strncpy(realcmdbuf, pd_tkbuf+pd_bufhead, bytesincmd);
!                         realcmdbuf[bytesincmd] = 0;
!                     }
!                     pd_bufhead += bytesincmd;
!                     if (realcmdbuf)
!                     {
!                         tcl_mess(realcmdbuf);
!                         if (realcmdbuf != smallcmdbuf)
!                             free(realcmdbuf);
!                     }
!                     if (pd_buftail < pd_bufhead)
!                         fprintf(stderr, "tkcmd bug\n");
!                 }
!                 else break;
              }
!             if (pd_bufhead)
              {
!                 if (pd_buftail > pd_bufhead)
!                     memmove(pd_tkbuf, pd_tkbuf + pd_bufhead,
!                         pd_buftail-pd_bufhead);
!                 pd_buftail  -= pd_bufhead;
!                 pd_bufhead = 0;
              }
          }

Index: d_soundfile.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_soundfile.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** d_soundfile.c	25 Jun 2005 02:49:09 -0000	1.6
--- d_soundfile.c	29 Jul 2005 19:01:20 -0000	1.7
***************
*** 105,108 ****
--- 105,110 ----
      char  dc_id[4];                 /* data chunk id 'SSND'       */
      uint32 dc_size;                 /* length of data chunk       */
+     uint32 dc_offset;               /* additional offset in bytes */
+     uint32 dc_block;                /* block size                 */
  } t_datachunk;
  
***************
*** 134,138 ****
  
  
! #define AIFFPLUS (AIFFHDRSIZE + 8)  /* header size including first chunk hdr */
  
  #define WHDR1 sizeof(t_nextstep)
--- 136,140 ----
  
  
! #define AIFFPLUS (AIFFHDRSIZE + 16)  /* header size including SSND chunk hdr */
  
  #define WHDR1 sizeof(t_nextstep)
***************
*** 679,682 ****
--- 681,685 ----
          longtmp = swap4(datasize, swap);
          memcpy(aiffhdr->a_samprate + sizeof(dogdoo), &longtmp, 4);
+         memset(aiffhdr->a_samprate + sizeof(dogdoo) + 4, 0, 8);
          headersize = AIFFPLUS;
      }
***************
*** 752,756 ****
                      SEEK_SET) == 0)
                          goto baddonewrite;
!             mofo = swap4(nframes, swap);
              if (write(fd, (char *)(&mofo), 4) < 4)
                  goto baddonewrite;
--- 755,771 ----
                      SEEK_SET) == 0)
                          goto baddonewrite;
!             mofo = swap4(itemswritten, swap);
!             if (write(fd, (char *)(&mofo), 4) < 4)
!                 goto baddonewrite;
!             if (lseek(fd,
!                 ((char *)(&((t_aiff *)0)->a_chunksize)) - (char *)0,
!                     SEEK_SET) == 0)
!                         goto baddonewrite;
!             mofo = swap4(itemswritten*bytesperframe+AIFFHDRSIZE, swap);
!             if (write(fd, (char *)(&mofo), 4) < 4)
!                 goto baddonewrite;
!             if (lseek(fd, (AIFFHDRSIZE+4), SEEK_SET) == 0)
!                 goto baddonewrite;
!             mofo = swap4(itemswritten*bytesperframe, swap);
              if (write(fd, (char *)(&mofo), 4) < 4)
                  goto baddonewrite;

Index: makefile.dependencies
===================================================================
RCS file: /cvsroot/pure-data/pd/src/makefile.dependencies,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** makefile.dependencies	24 Jul 2005 19:41:14 -0000	1.7
--- makefile.dependencies	29 Jul 2005 19:01:21 -0000	1.8
***************
*** 12,19 ****
    /usr/include/bits/wchar.h /usr/include/gconv.h \
    /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \
!   /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
!   /usr/include/bits/stdio.h m_pd.h m_imp.h s_stuff.h g_canvas.h \
!   /usr/include/string.h /usr/include/bits/string.h \
!   /usr/include/bits/string2.h g_all_guis.h
  g_graph.o: g_graph.c /usr/include/stdlib.h /usr/include/features.h \
    /usr/include/sys/cdefs.h /usr/include/gnu/stubs.h \
--- 12,17 ----
    /usr/include/bits/wchar.h /usr/include/gconv.h \
[...1262 lines suppressed...]
!   /usr/include/time.h /usr/include/endian.h /usr/include/bits/endian.h \
    /usr/include/sys/select.h /usr/include/bits/select.h \
    /usr/include/bits/sigset.h /usr/include/bits/time.h \
--- 952,959 ----
    /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/include/stdarg.h \
    /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
!   /usr/include/unistd.h /usr/include/bits/posix_opt.h \
!   /usr/include/bits/confname.h /usr/include/getopt.h \
!   /usr/include/stdlib.h /usr/include/sys/types.h /usr/include/time.h \
!   /usr/include/endian.h /usr/include/bits/endian.h \
    /usr/include/sys/select.h /usr/include/bits/select.h \
    /usr/include/bits/sigset.h /usr/include/bits/time.h \
***************
*** 1064,1068 ****
    /usr/include/linux/errno.h /usr/include/asm/errno.h \
    /usr/include/alsa/asoundlib.h /usr/include/string.h \
-   /usr/include/bits/string.h /usr/include/bits/string2.h \
    /usr/include/assert.h /usr/include/sys/poll.h /usr/include/bits/poll.h \
    /usr/include/alsa/asoundef.h /usr/include/alsa/version.h \
--- 964,967 ----

Index: d_osc.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_osc.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** d_osc.c	6 Sep 2004 20:20:33 -0000	1.2
--- d_osc.c	29 Jul 2005 19:01:19 -0000	1.3
***************
*** 18,22 ****
  #define LOWOFFSET 1    /* word offset to find LSB */
  #define int32 long  /* a data type that has 32 bits */
! #else
  #ifdef MSW
      /* little-endian; most significant byte is at highest address */
--- 18,23 ----
  #define LOWOFFSET 1    /* word offset to find LSB */
  #define int32 long  /* a data type that has 32 bits */
! #endif /* IRIX */
! 
  #ifdef MSW
      /* little-endian; most significant byte is at highest address */
***************
*** 24,48 ****
  #define LOWOFFSET 0
  #define int32 long
! #else
! #ifdef __FreeBSD__
  #include <machine/endian.h>
- #if BYTE_ORDER == LITTLE_ENDIAN
- #define HIOFFSET 1
- #define LOWOFFSET 0
- #else
- #define HIOFFSET 0    /* word offset to find MSB */
- #define LOWOFFSET 1    /* word offset to find LSB */
- #endif /* BYTE_ORDER */
- #include <sys/types.h>
- #define int32 int32_t
  #endif
- #ifdef __linux__
  
  #include <endian.h>
  
  #if !defined(__BYTE_ORDER) || !defined(__LITTLE_ENDIAN)                         
  #error No byte order defined                                                    
  #endif                                                                          
!                                                                                 
  #if __BYTE_ORDER == __LITTLE_ENDIAN                                             
  #define HIOFFSET 1                                                              
--- 25,48 ----
  #define LOWOFFSET 0
  #define int32 long
! #endif
! 
! #if defined(__FreeBSD__) || defined(MACOSX)
  #include <machine/endian.h>
  #endif
  
+ #ifdef MACOSX
+ #define __BYTE_ORDER BYTE_ORDER
+ #define __LITTLE_ENDIAN LITTLE_ENDIAN
+ #endif                                                                          
+ 
+ #ifdef __linux__
  #include <endian.h>
+ #endif
  
+ #if defined(__unix__) || defined(MACOSX)
  #if !defined(__BYTE_ORDER) || !defined(__LITTLE_ENDIAN)                         
  #error No byte order defined                                                    
  #endif                                                                          
! 
  #if __BYTE_ORDER == __LITTLE_ENDIAN                                             
  #define HIOFFSET 1                                                              
***************
*** 52,69 ****
  #define LOWOFFSET 1    /* word offset to find LSB */                            
  #endif /* __BYTE_ORDER */                                                       
- 
  #include <sys/types.h>
  #define int32 int32_t
  
- #else
- #ifdef MACOSX
- #define HIOFFSET 0    /* word offset to find MSB */
- #define LOWOFFSET 1    /* word offset to find LSB */
- #define int32 int  /* a data type that has 32 bits */
- 
- #endif /* MACOSX */
- #endif /* __linux__ */
- #endif /* MSW */
- #endif /* SGI */
  
  union tabfudge
--- 52,59 ----
  #define LOWOFFSET 1    /* word offset to find LSB */                            
  #endif /* __BYTE_ORDER */                                                       
  #include <sys/types.h>
  #define int32 int32_t
+ #endif /* __unix__ or MACOSX*/
  
  
  union tabfudge

Index: g_template.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_template.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** g_template.c	2 Jul 2005 05:03:06 -0000	1.9
--- g_template.c	29 Jul 2005 19:01:20 -0000	1.10
***************
*** 802,805 ****
--- 802,819 ----
  }
  
+ static void fielddesc_setsymbolarg(t_fielddesc *fd, int argc, t_atom *argv)
+ {
+         if (argc <= 0) fielddesc_setsymbol_const(fd, &s_);
+         else if (argv->a_type == A_SYMBOL)
+         {
+             fd->fd_type = A_SYMBOL;
+             fd->fd_var = 1;
+             fd->fd_un.fd_varsym = argv->a_w.w_symbol;
+             fd->fd_v1 = fd->fd_v2 = fd->fd_screen1 = fd->fd_screen2 =
+                 fd->fd_quantum = 0;
+         }
+         else fielddesc_setsymbol_const(fd, &s_);
+ }
+ 
  static void fielddesc_setarrayarg(t_fielddesc *fd, int argc, t_atom *argv)
  {
***************
*** 1903,1908 ****
          else break;
      }
!     if (argc) fielddesc_setfloatarg(&x->x_value, argc--, argv++);
!     else fielddesc_setfloat_const(&x->x_value, 0);
      if (argc) fielddesc_setfloatarg(&x->x_xloc, argc--, argv++);
      else fielddesc_setfloat_const(&x->x_xloc, 0);
--- 1917,1931 ----
          else break;
      }
!     if (flags & DRAW_SYMBOL)
!     {
!         if (argc) fielddesc_setsymbolarg(&x->x_value, argc--, argv++);
!         else fielddesc_setsymbol_const(&x->x_value, &s_);
!     
!     }
!     else
!     {
!         if (argc) fielddesc_setfloatarg(&x->x_value, argc--, argv++);
!         else fielddesc_setfloat_const(&x->x_value, 0);
!     }
      if (argc) fielddesc_setfloatarg(&x->x_xloc, argc--, argv++);
      else fielddesc_setfloat_const(&x->x_xloc, 0);





More information about the Pd-cvs mailing list