[PD-cvs] pd/src d_soundfile.c, 1.11, 1.12 g_canvas.c, 1.17, 1.18 g_canvas.h, 1.13, 1.14 g_editor.c, 1.19, 1.20 g_template.c, 1.17, 1.18 g_traversal.c, 1.6, 1.7 m_pd.h, 1.15, 1.16 s_loader.c, 1.12, 1.13 u_main.tk, 1.24, 1.25 x_qlist.c, 1.2, 1.3

Miller Puckette millerpuckette at users.sourceforge.net
Mon Oct 9 06:36:14 CEST 2006


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

Modified Files:
	d_soundfile.c g_canvas.c g_canvas.h g_editor.c g_template.c 
	g_traversal.c m_pd.h s_loader.c u_main.tk x_qlist.c 
Log Message:
bugfixes... pd 0.40-1.



Index: s_loader.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_loader.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** s_loader.c	8 Sep 2006 23:45:30 -0000	1.12
--- s_loader.c	9 Oct 2006 04:36:12 -0000	1.13
***************
*** 14,18 ****
  #include <windows.h>
  #endif
! #ifdef MACOSX
  #include <mach-o/dyld.h> 
  #endif
--- 14,18 ----
  #include <windows.h>
  #endif
! #ifdef __APPLE__
  #include <mach-o/dyld.h> 
  #endif
***************
*** 42,46 ****
  #endif
  #endif
! #ifdef MACOSX
  #ifndef MACOSX3
  static char sys_dllextent[] = ".d_fat", sys_dllextent2[] = ".pd_darwin";
--- 42,46 ----
  #endif
  #endif
! #ifdef __APPLE__
  #ifndef MACOSX3
  static char sys_dllextent[] = ".d_fat", sys_dllextent2[] = ".pd_darwin";

Index: g_traversal.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_traversal.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** g_traversal.c	3 Jun 2006 19:13:07 -0000	1.6
--- g_traversal.c	9 Oct 2006 04:36:12 -0000	1.7
***************
*** 144,148 ****
  }
  
! static void gpointer_setarray(t_gpointer *gp, t_array *array, t_word *w)
  {
      t_gstub *gs;
--- 144,148 ----
  }
  
! void gpointer_setarray(t_gpointer *gp, t_array *array, t_word *w)
  {
      t_gstub *gs;

Index: x_qlist.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/x_qlist.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** x_qlist.c	6 Sep 2004 20:20:36 -0000	1.2
--- x_qlist.c	9 Oct 2006 04:36:12 -0000	1.3
***************
*** 182,188 ****
      else if (*format->s_name)
          error("qlist_read: unknown flag: %s", format->s_name);
!         
!     if (binbuf_read_via_path(x->x_binbuf, filename->s_name,
!         canvas_getdir(x->x_canvas)->s_name, cr))
              error("%s: read failed", filename->s_name);
      x->x_onset = 0x7fffffff;
--- 182,187 ----
      else if (*format->s_name)
          error("qlist_read: unknown flag: %s", format->s_name);
! 
!     if (binbuf_read_via_canvas(x->x_binbuf, filename->s_name, x->x_canvas, cr))
              error("%s: read failed", filename->s_name);
      x->x_onset = 0x7fffffff;

Index: u_main.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** u_main.tk	4 Oct 2006 19:35:06 -0000	1.24
--- u_main.tk	9 Oct 2006 04:36:12 -0000	1.25
***************
*** 395,399 ****
      } else {
          exec rundll32 url.dll,FileProtocolHandler \
!             [format "file:%s" $filename] &
      }
  }
--- 395,399 ----
      } else {
          exec rundll32 url.dll,FileProtocolHandler \
!             [format "file://%s" $filename] &
      }
  }

Index: g_canvas.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_canvas.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** g_canvas.h	15 Aug 2006 04:54:15 -0000	1.13
--- g_canvas.h	9 Oct 2006 04:36:12 -0000	1.14
***************
*** 537,540 ****
--- 537,541 ----
  EXTERN void gstub_cutoff(t_gstub *gs);
  EXTERN void gpointer_setglist(t_gpointer *gp, t_glist *glist, t_scalar *x);
+ EXTERN void gpointer_setarray(t_gpointer *gp, t_array *array, t_word *w);
  
  /* --------------------- scalars ------------------------- */

Index: g_canvas.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_canvas.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** g_canvas.c	19 Sep 2006 22:30:33 -0000	1.17
--- g_canvas.c	9 Oct 2006 04:36:12 -0000	1.18
***************
*** 1553,1559 ****
      {
          t_namelist *nl;
          for (nl = y->gl_env->ce_path; nl; nl = nl->nl_next)
          {
!             if ((fd = sys_trytoopenone(nl->nl_string, name, ext,
                  dirresult, nameresult, size, bin)) >= 0)
                      return (fd);
--- 1553,1570 ----
      {
          t_namelist *nl;
+         t_canvas *x2 = x;
+         char *dir;
+         while (x2 && x2->gl_owner)
+             x2 = x2->gl_owner;
+         dir = (x2 ? canvas_getdir(x2)->s_name : ".");
          for (nl = y->gl_env->ce_path; nl; nl = nl->nl_next)
          {
!             char realname[MAXPDSTRING];
!             strncpy(realname, dir, MAXPDSTRING);
!             realname[MAXPDSTRING-3] = 0;
!             strcat(realname, "/");
!             strncat(realname, nl->nl_string, MAXPDSTRING-strlen(realname));
!             realname[MAXPDSTRING-1] = 0;
!             if ((fd = sys_trytoopenone(realname, name, ext,
                  dirresult, nameresult, size, bin)) >= 0)
                      return (fd);

Index: m_pd.h
===================================================================
RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** m_pd.h	4 Oct 2006 19:35:06 -0000	1.15
--- m_pd.h	9 Oct 2006 04:36:12 -0000	1.16
***************
*** 11,15 ****
  #define PD_MAJOR_VERSION 0
  #define PD_MINOR_VERSION 40
! #define PD_BUGFIX_VERSION 0
  #define PD_TEST_VERSION ""
  
--- 11,15 ----
  #define PD_MAJOR_VERSION 0
  #define PD_MINOR_VERSION 40
! #define PD_BUGFIX_VERSION 1
  #define PD_TEST_VERSION ""
  

Index: d_soundfile.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/d_soundfile.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** d_soundfile.c	3 Jun 2006 19:13:07 -0000	1.11
--- d_soundfile.c	9 Oct 2006 04:36:12 -0000	1.12
***************
*** 201,216 ****
  */
  
! int open_soundfile(const char *dirname, const char *filename, int headersize,
      int *p_bytespersamp, int *p_bigendian, int *p_nchannels, long *p_bytelimit,
      long skipframes)
  {
!     char buf[OBUFSIZE], *bufptr;
!     int fd, format, nchannels, bigendian, bytespersamp, swap, sysrtn;
      long bytelimit = 0x7fffffff;
      errno = 0;
-     fd = open_via_path(dirname, filename,
-         "", buf, &bufptr, MAXPDSTRING, 1);
-     if (fd < 0)
-         return (-1);
      if (headersize >= 0) /* header detection overridden */
      {
--- 201,211 ----
  */
  
! int open_soundfile_via_fd(int fd, int headersize,
      int *p_bytespersamp, int *p_bigendian, int *p_nchannels, long *p_bytelimit,
      long skipframes)
  {
!     int format, nchannels, bigendian, bytespersamp, swap, sysrtn;
      long bytelimit = 0x7fffffff;
      errno = 0;
      if (headersize >= 0) /* header detection overridden */
      {
***************
*** 222,225 ****
--- 217,221 ----
      else
      {
+         char buf[OBUFSIZE];
          int bytesread = read(fd, buf, READHDRSIZE);
          int format;
***************
*** 393,396 ****
--- 389,424 ----
  }
  
+     /* open a soundfile, using open_via_path().  This is used by readsf~ in
+     a not-perfectly-threadsafe way.  LATER replace with a thread-hardened
+     version of open_soundfile_via_canvas() */
+ int open_soundfile(const char *dirname, const char *filename, int headersize,
+     int *p_bytespersamp, int *p_bigendian, int *p_nchannels, long *p_bytelimit,
+     long skipframes)
+ {
+     char buf[OBUFSIZE], *bufptr;
+     int fd;
+     fd = open_via_path(dirname, filename, "", buf, &bufptr, MAXPDSTRING, 1);
+     if (fd < 0)
+         return (-1);
+     else return (open_soundfile_via_fd(fd, headersize, p_bytespersamp,
+         p_bigendian, p_nchannels, p_bytelimit, skipframes));
+ }
+ 
+     /* open a soundfile, using open_via_canvas().  This is used by readsf~ in
+     a not-perfectly-threadsafe way.  LATER replace with a thread-hardened
+     version of open_soundfile_via_canvas() */
+ int open_soundfile_via_canvas(t_canvas *canvas, const char *filename, int headersize,
+     int *p_bytespersamp, int *p_bigendian, int *p_nchannels, long *p_bytelimit,
+     long skipframes)
+ {
+     char buf[OBUFSIZE], *bufptr;
+     int fd;
+     fd = canvas_open(canvas, filename, "", buf, &bufptr, MAXPDSTRING, 1);
+     if (fd < 0)
+         return (-1);
+     else return (open_soundfile_via_fd(fd, headersize, p_bytespersamp,
+         p_bigendian, p_nchannels, p_bytelimit, skipframes));
+ }
+ 
  static void soundfile_xferin(int sfchannels, int nvecs, float **vecs,
      long itemsread, unsigned char *buf, int nitems, int bytespersamp,
***************
*** 1034,1038 ****
          finalsize = vecsize;
      }
!     fd = open_soundfile(canvas_getdir(x->x_canvas)->s_name, filename,
          headersize, &bytespersamp, &bigendian, &channels, &bytelimit,
              skipframes);
--- 1062,1066 ----
          finalsize = vecsize;
      }
!     fd = open_soundfile_via_canvas(x->x_canvas, filename,
          headersize, &bytespersamp, &bigendian, &channels, &bytelimit,
              skipframes);

Index: g_editor.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_editor.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** g_editor.c	4 Oct 2006 19:35:06 -0000	1.19
--- g_editor.c	9 Oct 2006 04:36:12 -0000	1.20
***************
*** 1948,1952 ****
          rtext_getseltext(x->gl_editor->e_textedfor, &buf, &bufsize);
  
! #if defined(MSW) || defined(MACOSX)
              /* for Mac or Windows, copy the text to the clipboard here */
          sys_vgui("clipboard clear\n", bufsize, buf);
--- 1948,1952 ----
          rtext_getseltext(x->gl_editor->e_textedfor, &buf, &bufsize);
  
! #if defined(MSW) || defined(__APPLE__)
              /* for Mac or Windows, copy the text to the clipboard here */
          sys_vgui("clipboard clear\n", bufsize, buf);
***************
*** 2112,2116 ****
      {
              /* simulate keystrokes as if the copy buffer were typed in. */
! #if defined(MSW) || defined(MACOSX)
              /* for Mac or Windows,  ask the GUI to send the clipboard down */
          sys_gui("pdtk_pastetext\n");
--- 2112,2116 ----
      {
              /* simulate keystrokes as if the copy buffer were typed in. */
! #if defined(MSW) || defined(__APPLE__)
              /* for Mac or Windows,  ask the GUI to send the clipboard down */
          sys_gui("pdtk_pastetext\n");

Index: g_template.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_template.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** g_template.c	8 Sep 2006 23:45:30 -0000	1.17
--- g_template.c	9 Oct 2006 04:36:12 -0000	1.18
***************
*** 1286,1291 ****
          curve_motion_field = 2*bestn;
          curve_motion_template = template;
!         gpointer_setglist(&curve_motion_gpointer, curve_motion_glist,
!             curve_motion_scalar);
          glist_grab(glist, z, curve_motion, 0, xpix, ypix);
      }
--- 1286,1294 ----
          curve_motion_field = 2*bestn;
          curve_motion_template = template;
!         if (curve_motion_scalar)
!             gpointer_setglist(&curve_motion_gpointer, curve_motion_glist,
!                 curve_motion_scalar);
!         else gpointer_setarray(&curve_motion_gpointer,
!                 curve_motion_array, curve_motion_wp);
          glist_grab(glist, z, curve_motion, 0, xpix, ypix);
      }
***************
*** 2269,2275 ****
                  fielddesc_getfloat(&x->x_value, template, data, 0);
              drawnumber_motion_symbol = ((x->x_flags & DRAW_SYMBOL) != 0);
!             gpointer_setglist(&drawnumber_motion_gpointer, 
!                 drawnumber_motion_glist, drawnumber_motion_scalar);
!             glist_grab(glist, z, drawnumber_motion, drawnumber_key,
                  xpix, ypix);
          }
--- 2272,2281 ----
                  fielddesc_getfloat(&x->x_value, template, data, 0);
              drawnumber_motion_symbol = ((x->x_flags & DRAW_SYMBOL) != 0);
!             if (drawnumber_motion_scalar)
!                 gpointer_setglist(&drawnumber_motion_gpointer, 
!                     drawnumber_motion_glist, drawnumber_motion_scalar);
!             else gpointer_setarray(&drawnumber_motion_gpointer,
!                     drawnumber_motion_array, drawnumber_motion_wp);
!            glist_grab(glist, z, drawnumber_motion, drawnumber_key,
                  xpix, ypix);
          }





More information about the Pd-cvs mailing list