Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29536/pd/src
Modified Files: configure.in d_ugen.c g_array.c g_canvas.c g_canvas.h g_editor.c g_io.c g_readwrite.c m_binbuf.c m_class.c m_pd.h makefile.in notes.txt s_audio_alsamm.c s_audio_pablio.h s_audio_paring.c s_audio_paring.h s_inter.c s_loader.c s_main.c s_path.c s_stuff.h u_main.tk x_arithmetic.c Log Message: 0.40 test 01 commit ... although the "about" dialog thinks it's test02 :)
Index: s_loader.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_loader.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** s_loader.c 11 Aug 2006 20:09:07 -0000 1.9 --- s_loader.c 15 Aug 2006 04:54:15 -0000 1.10 *************** *** 53,62 **** #endif
void class_set_extern_dir(t_symbol *s);
! static int sys_do_load_lib(char *dirname, char *classname) { char symname[MAXPDSTRING], filename[MAXPDSTRING], dirbuf[MAXPDSTRING], ! *nameptr, altsymname[MAXPDSTRING]; void *dlobj; t_xxx makeout = NULL; --- 53,89 ---- #endif
+ /* maintain list of loaded modules to avoid repeating loads */ + typedef struct _loadedlist + { + struct _loadedlist *ll_next; + t_symbol *ll_name; + } t_loadlist; + + static t_loadlist *sys_loaded; + int sys_onloadlist(char *classname) /* return true if already loaded */ + { + t_symbol *s = gensym(classname); + t_loadlist *ll; + for (ll = sys_loaded; ll; ll = ll->ll_next) + if (ll->ll_name == s) + return (1); + return (0); + } + + void sys_putonloadlist(char *classname) /* add to list of loaded modules */ + { + t_loadlist *ll = (t_loadlist *)getbytes(sizeof(*ll)); + ll->ll_name = gensym(classname); + ll->ll_next = sys_loaded; + sys_loaded = ll; + post("put on list %s", classname); + } + void class_set_extern_dir(t_symbol *s);
! static int sys_do_load_lib(t_canvas *canvas, char *objectname) { char symname[MAXPDSTRING], filename[MAXPDSTRING], dirbuf[MAXPDSTRING], ! *classname, *nameptr, altsymname[MAXPDSTRING]; void *dlobj; t_xxx makeout = NULL; *************** *** 65,68 **** --- 92,104 ---- HINSTANCE ntdll; #endif + if (classname = strrchr(objectname, '/')) + classname++; + else classname = objectname; + post("classname %s", classname); + if (sys_onloadlist(classname)) + { + post("%s: already loaded", classname); + return (1); + } for (i = 0, nameptr = classname; i < MAXPDSTRING-7 && *nameptr; nameptr++) { *************** *** 94,119 **** } else strcat(symname, "_setup"); ! ! #if 0 ! fprintf(stderr, "lib %s %s\n", dirname, classname); #endif ! /* try looking in the path for (classname).(sys_dllextent) ... */ ! if ((fd = open_via_path(dirname, classname, sys_dllextent, dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0) goto gotone; /* same, with the more generic sys_dllextent2 */ ! if ((fd = open_via_path(dirname, classname, sys_dllextent2, dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0) goto gotone; ! /* next try (classname)/(classname).(sys_dllextent) ... */ ! strncpy(filename, classname, MAXPDSTRING); filename[MAXPDSTRING-2] = 0; strcat(filename, "/"); strncat(filename, classname, MAXPDSTRING-strlen(filename)); filename[MAXPDSTRING-1] = 0; ! if ((fd = open_via_path(dirname, filename, sys_dllextent, dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0) goto gotone; ! if ((fd = open_via_path(dirname, filename, sys_dllextent2, dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0) goto gotone; --- 130,155 ---- } else strcat(symname, "_setup"); ! ! #if 1 ! fprintf(stderr, "lib: %s\n", classname); #endif ! /* try looking in the path for (objectname).(sys_dllextent) ... */ ! if ((fd = canvas_open(canvas, objectname, sys_dllextent, dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0) goto gotone; /* same, with the more generic sys_dllextent2 */ ! if ((fd = canvas_open(canvas, objectname, sys_dllextent2, dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0) goto gotone; ! /* next try (objectname)/(classname).(sys_dllextent) ... */ ! strncpy(filename, objectname, MAXPDSTRING); filename[MAXPDSTRING-2] = 0; strcat(filename, "/"); strncat(filename, classname, MAXPDSTRING-strlen(filename)); filename[MAXPDSTRING-1] = 0; ! if ((fd = canvas_open(canvas, filename, sys_dllextent, dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0) goto gotone; ! if ((fd = canvas_open(canvas, filename, sys_dllextent2, dirbuf, &nameptr, MAXPDSTRING, 1)) >= 0) goto gotone; *************** *** 160,168 **** (*makeout)(); class_set_extern_dir(&s_); return (1); }
/* callback type definition */ ! typedef int (*loader_t)(char *dirname, char *classname);
/* linked list of loaders */ --- 196,205 ---- (*makeout)(); class_set_extern_dir(&s_); + sys_putonloadlist(classname); return (1); }
/* callback type definition */ ! typedef int (*loader_t)(t_canvas *canvas, char *classname);
/* linked list of loaders */ *************** *** 192,196 **** }
! int sys_load_lib(char *dirname, char *classname) { int dspstate = canvas_suspend_dsp(); --- 229,233 ---- }
! int sys_load_lib(t_canvas *canvas, char *classname) { int dspstate = canvas_suspend_dsp(); *************** *** 198,202 **** loader_queue_t *q; for(q = &loaders; q; q = q->next) ! if(ok = q->loader(dirname, classname)) break; canvas_resume_dsp(dspstate); return ok; --- 235,239 ---- loader_queue_t *q; for(q = &loaders; q; q = q->next) ! if (ok = q->loader(canvas, classname)) break; canvas_resume_dsp(dspstate); return ok;
Index: u_main.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/u_main.tk,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** u_main.tk 11 Aug 2006 20:09:07 -0000 1.20 --- u_main.tk 15 Aug 2006 04:54:15 -0000 1.21 *************** *** 36,41 **** global pd_tearoff set pd_gui2 [string range $argv0 0 [expr [string last \ $argv0 ] - 1]] ! regsub -all \\ $pd_gui2 / pd_gui3 ! set pd_guidir $pd_gui3/.. load $pd_guidir/bin/pdtcl.dll set pd_tearoff 1 --- 36,41 ---- global pd_tearoff set pd_gui2 [string range $argv0 0 [expr [string last \ $argv0 ] - 1]] ! regsub -all \\ $pd_gui2 / pd_guidir ! set pd_guidir [string range $pd_guidir 0 [expr [string last / $pd_guidir] - 1]] load $pd_guidir/bin/pdtcl.dll set pd_tearoff 1 *************** *** 204,207 **** --- 204,210 ---- . configure -menu .mbar -width 200 -height 150
+ # Intercept closing the main pd window: MP 20060413: + wm protocol . WM_DELETE_WINDOW menu_quit + ############### set up global variables ################################
*************** *** 369,374 **** set bigstring [read $f 1000] regsub -all PD_BASEDIR $bigstring $pd_guidir bigstring2 ! regsub -all PD_VERSION $bigstring2 $pd_myversion bigstring3 ! $name.text insert end $bigstring3 } close $f --- 372,376 ---- set bigstring [read $f 1000] regsub -all PD_BASEDIR $bigstring $pd_guidir bigstring2 ! $name.text insert end $bigstring2 } close $f *************** *** 2876,2879 **** --- 2878,2883 ---- set var_canvas_graphme [concat canvas_graphme_$vid] global $var_canvas_graphme + set var_canvas_hidetext [concat canvas_hidetext_$vid] + global $var_canvas_hidetext set var_canvas_x1 [concat canvas_x1_$vid] global $var_canvas_x1 *************** *** 2896,2900 **** [eval concat $$var_canvas_xscale] \ [eval concat $$var_canvas_yscale] \ ! [eval concat $$var_canvas_graphme] \ [eval concat $$var_canvas_x1] \ [eval concat $$var_canvas_y1] \ --- 2900,2904 ---- [eval concat $$var_canvas_xscale] \ [eval concat $$var_canvas_yscale] \ ! [expr [eval concat $$var_canvas_graphme]+2*[eval concat $$var_canvas_hidetext]] \ [eval concat $$var_canvas_x1] \ [eval concat $$var_canvas_y1] \ *************** *** 2928,2931 **** --- 2932,2937 ---- set var_canvas_graphme [concat canvas_graphme_$vid] global $var_canvas_graphme + set var_canvas_hidetext [concat canvas_hidetext_$vid] + global $var_canvas_hidetext set var_canvas_x1 [concat canvas_x1_$vid] global $var_canvas_x1 *************** *** 2946,2949 **** --- 2952,2956 ----
if { [eval concat $$var_canvas_graphme] != 0 } { + $id.hidetext configure -state normal $id.xrange.entry1 configure -state normal $id.xrange.entry2 configure -state normal *************** *** 2976,2979 **** --- 2983,2987 ---- } } else { + $id.hidetext configure -state disabled $id.xrange.entry1 configure -state disabled $id.xrange.entry2 configure -state disabled *************** *** 3005,3008 **** --- 3013,3018 ---- set var_canvas_graphme [concat canvas_graphme_$vid] global $var_canvas_graphme + set var_canvas_hidetext [concat canvas_hidetext_$vid] + global $var_canvas_hidetext set var_canvas_x1 [concat canvas_x1_$vid] global $var_canvas_x1 *************** *** 3022,3029 **** global $var_canvas_ymargin
- set $var_canvas_xscale $xscale set $var_canvas_yscale $yscale ! set $var_canvas_graphme $graphme set $var_canvas_x1 $x1 set $var_canvas_y1 $y1 --- 3032,3039 ---- global $var_canvas_ymargin
set $var_canvas_xscale $xscale set $var_canvas_yscale $yscale ! set $var_canvas_graphme [expr ($graphme!=0)?1:0] ! set $var_canvas_hidetext [expr ($graphme&2)?1:0] set $var_canvas_x1 $x1 set $var_canvas_y1 $y1 *************** *** 3059,3062 **** --- 3069,3077 ---- pack $id.graphme -side top
+ checkbutton $id.hidetext -text {hide object name and arguments} \ + -variable $var_canvas_hidetext -anchor w \ + -command [concat canvas_checkcommand $id] + pack $id.hidetext -side top + frame $id.xrange pack $id.xrange -side top *************** *** 3229,3236 ****
# tb: user defined typefaces ! proc pdtk_pd_startup {version apilist midiapilist fontname} { ! # puts stderr [concat $version $apilist $fontname] ! global pd_myversion pd_apilist pd_midiapilist ! set pd_myversion $version set pd_apilist $apilist set pd_midiapilist $midiapilist --- 3244,3250 ----
# tb: user defined typefaces ! proc pdtk_pd_startup {apilist midiapilist fontname} { ! # puts stderr [concat $apilist $midiapilist $fontname] ! global pd_apilist pd_midiapilist set pd_apilist $apilist set pd_midiapilist $midiapilist
Index: s_path.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_path.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** s_path.c 11 Aug 2006 20:09:07 -0000 1.9 --- s_path.c 15 Aug 2006 04:54:15 -0000 1.10 *************** *** 171,189 **** #endif
! /* search for a file in a specified directory, then along the globally ! defined search path, using ext as filename extension. Exception: ! if the 'name' starts with a slash or a letter, colon, and slash in MSW, ! there is no search and instead we just try to open the file literally. The ! fd is returned, the directory ends up in the "dirresult" which must be at ! least "size" bytes. "nameresult" is set to point to the filename, which ! ends up in the same buffer as dirresult. */
! int open_via_path(const char *dir, const char *name, const char* ext, char *dirresult, char **nameresult, unsigned int size, int bin) { ! t_namelist *nl, thislist; ! int fd = -1; ! char listbuf[MAXPDSTRING];
if (name[0] == '/' #ifdef MSW --- 171,239 ---- #endif
! /* try to open a file in the directory "dir", named "name""ext", ! for reading. "Name" may have slashes. The directory is copied to ! "dirresult" which must be at least "size" bytes. "nameresult" is set ! to point to the filename (copied elsewhere into the same buffer). ! The "bin" flag requests opening for binary (which only makes a difference ! on Windows). */
! int sys_trytoopenone(const char *dir, const char *name, const char* ext, char *dirresult, char **nameresult, unsigned int size, int bin) { ! int fd; ! if (strlen(dir) + strlen(name) + strlen(ext) + 4 > size) ! return (-1); ! strcpy(dirresult, dir); ! if (*dirresult && dirresult[strlen(dirresult)-1] != '/') ! strcat(dirresult, "/"); ! strcat(dirresult, name); ! strcat(dirresult, ext); ! sys_bashfilename(dirresult, dirresult); ! ! DEBUG(post("looking for %s",dirresult)); ! /* see if we can open the file for reading */ ! if ((fd=open(dirresult,O_RDONLY | MSWOPENFLAG(bin))) >= 0) ! { ! /* in unix, further check that it's not a directory */ ! #ifdef UNISTD ! struct stat statbuf; ! int ok = ((fstat(fd, &statbuf) >= 0) && ! !S_ISDIR(statbuf.st_mode)); ! if (!ok) ! { ! if (sys_verbose) post("tried %s; stat failed or directory", ! dirresult); ! close (fd); ! fd = -1; ! } ! else ! #endif ! { ! char *slash; ! if (sys_verbose) post("tried %s and succeeded", dirresult); ! sys_unbashfilename(dirresult, dirresult); ! slash = strrchr(dirresult, '/'); ! if (slash) ! { ! *slash = 0; ! *nameresult = slash + 1; ! } ! else *nameresult = dirresult;
+ return (fd); + } + } + else + { + if (sys_verbose) post("tried %s and failed", dirresult); + } + return (-1); + } + + /* check if we were given an absolute pathname, if so try to open it + and return 1 to signal the caller to cancel any path searches */ + int sys_open_absolute(const char *name, const char* ext, + char *dirresult, char **nameresult, unsigned int size, int bin, int *fdp) + { if (name[0] == '/' #ifdef MSW *************** *** 192,263 **** ) { ! thislist.nl_next = 0; ! thislist.nl_string = listbuf; ! listbuf[0] = 0; ! } ! else ! { ! thislist.nl_string = listbuf; ! thislist.nl_next = sys_searchpath; ! strncpy(listbuf, dir, MAXPDSTRING); ! listbuf[MAXPDSTRING-1] = 0; ! sys_unbashfilename(listbuf, listbuf); }
! /* search, first, through the search path (to which we prepended the ! current directory), then, if enabled, look in the "extra" dir */ ! for (nl = &thislist; nl; ! nl = (nl->nl_next ? nl->nl_next : ! (nl == pd_extrapath ? 0 : ! (sys_usestdpath ? pd_extrapath : 0)))) ! { ! if (strlen(nl->nl_string) + strlen(name) + strlen(ext) + 4 > ! size) ! continue; ! strcpy(dirresult, nl->nl_string); ! if (*dirresult && dirresult[strlen(dirresult)-1] != '/') ! strcat(dirresult, "/"); ! strcat(dirresult, name); ! strcat(dirresult, ext); ! sys_bashfilename(dirresult, dirresult);
- DEBUG(post("looking for %s",dirresult)); - /* see if we can open the file for reading */ - if ((fd=open(dirresult,O_RDONLY | MSWOPENFLAG(bin))) >= 0) - { - /* in unix, further check that it's not a directory */ - #ifdef UNISTD - struct stat statbuf; - int ok = ((fstat(fd, &statbuf) >= 0) && - !S_ISDIR(statbuf.st_mode)); - if (!ok) - { - if (sys_verbose) post("tried %s; stat failed or directory", - dirresult); - close (fd); - fd = -1; - } - else - #endif - { - char *slash; - if (sys_verbose) post("tried %s and succeeded", dirresult); - sys_unbashfilename(dirresult, dirresult); - slash = strrchr(dirresult, '/'); - if (slash) - { - *slash = 0; - *nameresult = slash + 1; - } - else *nameresult = dirresult; - - return (fd); - } - } - else - { - if (sys_verbose) post("tried %s and failed", dirresult); - } - } *dirresult = 0; *nameresult = dirresult; --- 242,297 ---- ) { ! char dirbuf[MAXPDSTRING]; ! int dirlen = (strrchr(name, '/') - name); ! if (dirlen > MAXPDSTRING-1) ! dirlen = MAXPDSTRING-1; ! strncpy(dirbuf, name, dirlen); ! dirbuf[dirlen] = 0; ! *fdp = sys_trytoopenone(dirbuf, name+(dirlen+1), ext, ! dirresult, nameresult, size, bin); ! return (1); } + else return (0); + }
! /* search for a file in a specified directory, then along the globally ! defined search path, using ext as filename extension. The ! fd is returned, the directory ends up in the "dirresult" which must be at ! least "size" bytes. "nameresult" is set to point to the filename, which ! ends up in the same buffer as dirresult. Exception: ! if the 'name' starts with a slash or a letter, colon, and slash in MSW, ! there is no search and instead we just try to open the file literally. */ ! ! /* see also canvas_openfile() which, in addition, searches down the ! canvas-specific path. */ ! ! static int do_open_via_path(const char *dir, const char *name, ! const char *ext, char *dirresult, char **nameresult, unsigned int size, ! int bin, t_namelist *searchpath) ! { ! t_namelist *nl; ! int fd = -1; ! ! /* first check if "name" is absolute (and if so, try to open) */ ! if (sys_open_absolute(name, ext, dirresult, nameresult, size, bin, &fd)) ! return (fd); ! ! /* otherwise "name" is relative; try the directory "dir" first. */ ! if ((fd = sys_trytoopenone(dir, name, ext, ! dirresult, nameresult, size, bin)) >= 0) ! return (fd); ! ! /* next go through the search path */ ! for (nl = searchpath; nl; nl = nl->nl_next) ! if ((fd = sys_trytoopenone(nl->nl_string, name, ext, ! dirresult, nameresult, size, bin)) >= 0) ! return (fd); ! ! /* next look in "extra" */ ! if (sys_usestdpath && ! (fd = sys_trytoopenone(pd_extrapath->nl_string, name, ext, ! dirresult, nameresult, size, bin)) >= 0) ! return (fd);
*dirresult = 0; *nameresult = dirresult; *************** *** 265,337 **** }
! static int do_open_via_helppath(const char *realname, t_namelist *listp) { ! t_namelist *nl; ! int fd = -1; ! char dirresult[MAXPDSTRING], realdir[MAXPDSTRING]; ! for (nl = listp; nl; nl = nl->nl_next) ! { ! strcpy(dirresult, nl->nl_string); ! strcpy(realdir, dirresult); ! if (*dirresult && dirresult[strlen(dirresult)-1] != '/') ! strcat(dirresult, "/"); ! strcat(dirresult, realname); ! sys_bashfilename(dirresult, dirresult); ! ! DEBUG(post("looking for %s",dirresult)); ! /* see if we can open the file for reading */ ! if ((fd=open(dirresult,O_RDONLY | MSWOPENFLAG(0))) >= 0) ! { ! /* in unix, further check that it's not a directory */ ! #ifdef UNISTD ! struct stat statbuf; ! int ok = ((fstat(fd, &statbuf) >= 0) && ! !S_ISDIR(statbuf.st_mode)); ! if (!ok) ! { ! if (sys_verbose) post("tried %s; stat failed or directory", ! dirresult); ! close (fd); ! fd = -1; ! } ! else ! #endif ! { ! char *slash; ! if (sys_verbose) post("tried %s and succeeded", dirresult); ! sys_unbashfilename(dirresult, dirresult); ! close (fd); ! glob_evalfile(0, gensym((char*)realname), gensym(realdir)); ! return (1); ! } ! } ! else ! { ! if (sys_verbose) post("tried %s and failed", dirresult); ! } ! } ! return (0); }
! /* LATER make this use open_via_path above. We expect the ".pd" suffix here, even though we have to tear it back off for one of the search attempts. */ void open_via_helppath(const char *name, const char *dir) { ! t_namelist *nl, thislist, *listp; ! int fd = -1; ! char dirbuf2[MAXPDSTRING], realname[MAXPDSTRING];
- /* if directory is supplied, put it at head of search list. */ - if (*dir) - { - thislist.nl_string = dirbuf2; - thislist.nl_next = sys_helppath; - strncpy(dirbuf2, dir, MAXPDSTRING); - dirbuf2[MAXPDSTRING-1] = 0; - sys_unbashfilename(dirbuf2, dirbuf2); - listp = &thislist; - } - else listp = sys_helppath; /* 1. "objectname-help.pd" */ strncpy(realname, name, MAXPDSTRING-10); --- 299,320 ---- }
! /* open via path, using the global search path. */ ! int open_via_path(const char *dir, const char *name, const char *ext, ! char *dirresult, char **nameresult, unsigned int size, int bin) { ! return (do_open_via_path(dir, name, ext, dirresult, nameresult, ! size, bin, sys_searchpath)); }
! /* Open a help file using the help search path. We expect the ".pd" suffix here, even though we have to tear it back off for one of the search attempts. */ void open_via_helppath(const char *name, const char *dir) { ! char realname[MAXPDSTRING], dirbuf[MAXPDSTRING], *basename; ! /* make up a silly "dir" if none is supplied */ ! const char *usedir = (*dir ? dir : "./"); ! int fd;
/* 1. "objectname-help.pd" */ strncpy(realname, name, MAXPDSTRING-10); *************** *** 340,356 **** realname[strlen(realname)-3] = 0; strcat(realname, "-help.pd"); ! if (do_open_via_helppath(realname, listp)) ! return; /* 2. "help-objectname.pd" */ strcpy(realname, "help-"); strncat(realname, name, MAXPDSTRING-10); realname[MAXPDSTRING-1] = 0; ! if (do_open_via_helppath(realname, listp)) ! return; /* 3. "objectname.pd" */ ! if (do_open_via_helppath(name, listp)) ! return; post("sorry, couldn't find help patch for "%s"", name); return; }
--- 323,347 ---- realname[strlen(realname)-3] = 0; strcat(realname, "-help.pd"); ! if ((fd = do_open_via_path(dir, realname, "", dirbuf, &basename, ! MAXPDSTRING, 0, sys_helppath)) >= 0) ! goto gotone; ! /* 2. "help-objectname.pd" */ strcpy(realname, "help-"); strncat(realname, name, MAXPDSTRING-10); realname[MAXPDSTRING-1] = 0; ! if ((fd = do_open_via_path(dir, realname, "", dirbuf, &basename, ! MAXPDSTRING, 0, sys_helppath)) >= 0) ! goto gotone; ! /* 3. "objectname.pd" */ ! if ((fd = do_open_via_path(dir, name, "", dirbuf, &basename, ! MAXPDSTRING, 0, sys_helppath)) >= 0) ! goto gotone; post("sorry, couldn't find help patch for "%s"", name); return; + gotone: + close (fd); + glob_evalfile(0, gensym((char*)realname), gensym(dirbuf)); }
Index: s_stuff.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_stuff.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** s_stuff.h 11 Aug 2006 20:09:07 -0000 1.9 --- s_stuff.h 15 Aug 2006 04:54:15 -0000 1.10 *************** *** 10,17 **** /* in s_path.c */
! typedef struct _namelist { ! struct _namelist *nl_next; ! char *nl_string; } t_namelist;
--- 10,17 ---- /* in s_path.c */
! typedef struct _namelist /* element in a linked list of stored strings */ { ! struct _namelist *nl_next; /* next in list */ ! char *nl_string; /* the string */ } t_namelist;
*************** *** 25,28 **** --- 25,33 ---- extern t_namelist *sys_searchpath; extern t_namelist *sys_helppath; + int sys_open_absolute(const char *name, const char* ext, + char *dirresult, char **nameresult, unsigned int size, int bin, int *fdp); + int sys_trytoopenone(const char *dir, const char *name, const char* ext, + char *dirresult, char **nameresult, unsigned int size, int bin); +
/* s_file.c */ *************** *** 47,51 ****
/* s_loader.c */ ! int sys_load_lib(char *dirname, char *filename);
/* s_audio.c */ --- 52,56 ----
/* s_loader.c */ ! int sys_load_lib(t_canvas *canvas, char *filename);
/* s_audio.c */
Index: g_canvas.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_canvas.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** g_canvas.c 11 Aug 2006 20:09:07 -0000 1.14 --- g_canvas.c 15 Aug 2006 04:54:15 -0000 1.15 *************** *** 382,385 **** --- 382,386 ---- env->ce_argv = canvas_newargv; env->ce_dollarzero = dollarzero++; + env->ce_path = 0; canvas_newdirectory = &s_; canvas_newargc = 0; *************** *** 533,537 **** int glist_isgraph(t_glist *x) { ! return (x->gl_isgraph); }
--- 534,538 ---- int glist_isgraph(t_glist *x) { ! return (x->gl_isgraph|(x->gl_hidetext<<1)); }
*************** *** 541,545 **** { int heightwas = y2 - y1; ! int heightchange = y2 - y1 - (x->gl_screeny2 - x->gl_screeny1); if (x->gl_screenx1 == x1 && x->gl_screeny1 == y1 && x->gl_screenx2 == x2 && x->gl_screeny2 == y2) --- 542,546 ---- { int heightwas = y2 - y1; ! int heightchange = y2 - y1 - (x->gl_screeny2 - x->gl_screeny1); if (x->gl_screenx1 == x1 && x->gl_screeny1 == y1 && x->gl_screenx2 == x2 && x->gl_screeny2 == y2) *************** *** 1196,1199 **** --- 1197,1201 ---- /* return true if the "canvas" object should be treated as a text object. This is true for abstractions but also for "table"s... */ + /* JMZ: add a flag to gop-abstractions to hide the title */ int canvas_showtext(t_canvas *x) { *************** *** 1202,1206 **** int isarray = (argc && argv[0].a_type == A_SYMBOL && argv[0].a_w.w_symbol == gensym("graph")); ! return (!isarray); }
--- 1204,1211 ---- int isarray = (argc && argv[0].a_type == A_SYMBOL && argv[0].a_w.w_symbol == gensym("graph")); ! if(x->gl_hidetext) ! return 0; ! else ! return (!isarray); }
*************** *** 1414,1417 **** --- 1419,1564 ---- }
+ /* ------------------------------- declare ------------------------ */ + + /* put "declare" objects in a patch to tell it about the environment in + which objects should be created in this canvas. This includes directories to + search ("-path", "-stdpath") and object libraries to load + ("-lib" and "-stdlib"). These must be set before the patch containing + the "declare" object is filled in with its contents; so when the patch is + saved, we throw early messages to the canvas to set the environment + before any objects are created in it. */ + + static t_class *declare_class; + + typedef struct _declare + { + t_object x_obj; + t_canvas *x_canvas; + int x_useme; + } t_declare; + + static void *declare_new(t_symbol *s, int argc, t_atom *argv) + { + t_declare *x = (t_declare *)pd_new(declare_class); + x->x_useme = 1; + x->x_canvas = canvas_getcurrent(); + /* LATER update environment and/or load libraries */ + return (x); + } + + static void declare_free(t_declare *x) + { + x->x_useme = 0; + /* LATER update environment */ + } + + void canvas_savedeclarationsto(t_canvas *x, t_binbuf *b) + { + t_gobj *y; + + for (y = x->gl_list; y; y = y->g_next) + { + if (pd_class(&y->g_pd) == declare_class) + { + binbuf_addv(b, "s", gensym("#X")); + binbuf_addbinbuf(b, ((t_declare *)y)->x_obj.te_binbuf); + binbuf_addv(b, ";"); + } + else if (pd_class(&y->g_pd) == canvas_class) + canvas_savedeclarationsto((t_canvas *)y, b); + } + } + + static void canvas_declare(t_canvas *x, t_symbol *s, int argc, t_atom *argv) + { + int i; + t_canvasenvironment *e = canvas_getenv(x); + #if 0 + startpost("declare:: %s", s->s_name); + postatom(argc, argv); + endpost(); + #endif + for (i = 0; i < argc; i++) + { + char strbuf[MAXPDSTRING]; + char *flag = atom_getsymbolarg(i, argc, argv)->s_name; + if ((argc > i+1) && !strcmp(flag, "-path")) + { + e->ce_path = namelist_append(e->ce_path, + atom_getsymbolarg(i+1, argc, argv)->s_name, 0); + i++; + } + else if ((argc > i+1) && !strcmp(flag, "-stdpath")) + { + strncpy(strbuf, sys_libdir->s_name, MAXPDSTRING-3); + strbuf[MAXPDSTRING-4] = 0; + strcat(strbuf, "/"); + strncpy(strbuf, atom_getsymbolarg(i+1, argc, argv)->s_name, + MAXPDSTRING-strlen(strbuf)); + strbuf[MAXPDSTRING-1] = 0; + e->ce_path = namelist_append(e->ce_path, strbuf, 0); + i++; + } + else if ((argc > i+1) && !strcmp(flag, "-lib")) + { + sys_load_lib(x, atom_getsymbolarg(i+1, argc, argv)->s_name); + i++; + } + else if ((argc > i+1) && !strcmp(flag, "-stdlib")) + { + strncpy(strbuf, sys_libdir->s_name, MAXPDSTRING-3); + strbuf[MAXPDSTRING-4] = 0; + strcat(strbuf, "/"); + strncpy(strbuf, atom_getsymbolarg(i+1, argc, argv)->s_name, + MAXPDSTRING-strlen(strbuf)); + strbuf[MAXPDSTRING-1] = 0; + sys_load_lib(0, strbuf); + i++; + } + else post("declare: %s: unknown declaration", flag); + } + } + + /* utility function to read a file, looking first down the canvas's search + path (set with "declare" objects in the patch and recursively in calling + patches), then down the system one. The filename is the concatenation of + "name" and "ext". "Name" may be absolute, or may be relative with + slashes. If anything can be opened, the true directory + ais put in the buffer dirresult (provided by caller), which should + be "size" bytes. The "nameresult" pointer will be set somewhere in + the interior of "dirresult" and will give the file basename (with + slashes trimmed). If "bin" is set a 'binary' open is + attempted, otherwise ASCII (this only matters on Microsoft.) + If "x" is zero, the file is sought in the directory "." or in the + global path.*/ + + int canvas_open(t_canvas *x, const char *name, const char *ext, + char *dirresult, char **nameresult, unsigned int size, int bin) + { + t_namelist *nl, thislist; + int fd = -1; + char listbuf[MAXPDSTRING]; + t_canvas *y; + + /* first check if "name" is absolute (and if so, try to open) */ + if (sys_open_absolute(name, ext, dirresult, nameresult, size, bin, &fd)) + return (fd); + + /* otherwise "name" is relative; start trying in directories named + in this and parent environments */ + for (y = x; y; y = y->gl_owner) + if (y->gl_env) + { + 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); + } + } + return (open_via_path((x ? canvas_getdir(x)->s_name : "."), name, ext, + dirresult, nameresult, size, bin)); + }
/* ------------------------------- setup routine ------------------------ */ *************** *** 1534,1537 **** --- 1681,1690 ---- A_DEFSYM, A_DEFFLOAT, 0);
+ /*---------------------------- declare ------------------- */ + declare_class = class_new(gensym("declare"), (t_newmethod)declare_new, + (t_method)declare_free, sizeof(t_declare), CLASS_NOINLET, A_GIMME, 0); + class_addmethod(canvas_class, (t_method)canvas_declare, + gensym("declare"), A_GIMME, 0); + /* -------------- setups from other files for canvas_class ---------------- */ g_graph_setup();
Index: m_class.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_class.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** m_class.c 11 Aug 2006 20:09:07 -0000 1.6 --- m_class.c 15 Aug 2006 04:54:15 -0000 1.7 *************** *** 520,524 **** { t_pd *current; - t_symbol *dir = canvas_getcurrentdir(); int fd; char dirbuf[MAXPDSTRING], *nameptr; --- 520,523 ---- *************** *** 526,530 **** newest = 0; class_loadsym = s; ! if (sys_load_lib(dir->s_name, s->s_name)) { tryingalready = 1; --- 525,529 ---- newest = 0; class_loadsym = s; ! if (sys_load_lib(canvas_getcurrent(), s->s_name)) { tryingalready = 1; *************** *** 535,541 **** class_loadsym = 0; current = s__X.s_thing; ! if ((fd = open_via_path(dir->s_name, s->s_name, ".pd", dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0 || ! (fd = open_via_path(dir->s_name, s->s_name, ".pat", dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0) { --- 534,540 ---- class_loadsym = 0; current = s__X.s_thing; ! if ((fd = canvas_open(canvas_getcurrent(), s->s_name, ".pd", dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0 || ! (fd = canvas_open(canvas_getcurrent(), s->s_name, ".pat", dirbuf, &nameptr, MAXPDSTRING, 0)) >= 0) {
Index: g_readwrite.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_readwrite.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** g_readwrite.c 11 Aug 2006 20:09:07 -0000 1.6 --- g_readwrite.c 15 Aug 2006 04:54:15 -0000 1.7 *************** *** 19,23 ****
static t_class *declare_class; ! static void canvas_savedeclarationsto(t_canvas *x, t_binbuf *b);
/* the following routines read "scalars" from a file into a canvas. */ --- 19,23 ----
static t_class *declare_class; ! void canvas_savedeclarationsto(t_canvas *x, t_binbuf *b);
/* the following routines read "scalars" from a file into a canvas. */ *************** *** 622,626 **** x->gl_x2, x->gl_y2, (float)x->gl_pixwidth, (float)x->gl_pixheight, ! 1., (float)x->gl_xmargin, (float)x->gl_ymargin); /* otherwise write in 0.38-compatible form */ else binbuf_addv(b, "ssfffffff;", gensym("#X"), gensym("coords"), --- 622,627 ---- x->gl_x2, x->gl_y2, (float)x->gl_pixwidth, (float)x->gl_pixheight, ! (float)((x->gl_hidetext)?2.:1.), ! (float)x->gl_xmargin, (float)x->gl_ymargin); /* otherwise write in 0.38-compatible form */ else binbuf_addv(b, "ssfffffff;", gensym("#X"), gensym("coords"), *************** *** 730,791 **** }
- /* ------------------------------- declare ------------------------ */ - - /* put "declare" objects in a patch to tell it about the environment in - which objects should be created in this canvas. This includes directories to - search ("-path", "-stdpath") and object libraries to load - ("-lib" and "-stdlib"). These must be set before the patch containing - the "declare" object is filled in with its contents; so when the patch is - saved, we throw early messages to the canvas to set the environment - before any objects are created in it. */ - - - typedef struct _declare - { - t_object x_obj; - t_canvas *x_canvas; - int x_useme; - } t_declare; - - static void *declare_new(t_symbol *s, int argc, t_atom *argv) - { - t_declare *x = (t_declare *)pd_new(declare_class); - x->x_useme = 1; - x->x_canvas = canvas_getcurrent(); - /* LATER update environment and/or load libraries */ - return (x); - } - - static void declare_free(t_declare *x) - { - x->x_useme = 0; - /* LATER update environment */ - } - - static void canvas_savedeclarationsto(t_canvas *x, t_binbuf *b) - { - t_gobj *y; - - for (y = x->gl_list; y; y = y->g_next) - { - if (pd_class(&y->g_pd) == declare_class) - { - binbuf_addv(b, "s", gensym("#X")); - binbuf_addbinbuf(b, ((t_declare *)y)->x_obj.te_binbuf); - binbuf_addv(b, ";"); - } - else if (pd_class(&y->g_pd) == canvas_class) - canvas_savedeclarationsto((t_canvas *)y, b); - } - } - - static void canvas_declare(t_canvas *x, t_symbol *s, int argc, t_atom *argv) - { - startpost("declare:: %s", s->s_name); - postatom(argc, argv); - endpost(); - } - - void g_readwrite_setup(void) { --- 731,734 ---- *************** *** 800,805 **** class_addmethod(canvas_class, (t_method)canvas_saveto, gensym("saveto"), A_CANT, 0); - class_addmethod(canvas_class, (t_method)canvas_declare, - gensym("declare"), A_GIMME, 0); /* ------------------ from the menu ------------------------- */ class_addmethod(canvas_class, (t_method)canvas_menusave, --- 743,746 ---- *************** *** 807,813 **** class_addmethod(canvas_class, (t_method)canvas_menusaveas, gensym("menusaveas"), 0); - /*---------------------------- declare ------------------- */ - declare_class = class_new(gensym("declare"), (t_newmethod)declare_new, - (t_method)declare_free, sizeof(t_declare), CLASS_NOINLET, A_GIMME, 0); - } --- 748,750 ----
Index: g_canvas.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_canvas.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** g_canvas.h 15 Sep 2005 03:17:27 -0000 1.12 --- g_canvas.h 15 Aug 2006 04:54:15 -0000 1.13 *************** *** 183,186 **** --- 183,187 ---- unsigned int gl_goprect:1; /* draw rectangle for graph-on-parent */ unsigned int gl_isgraph:1; /* show as graph on parent */ + unsigned int gl_hidetext:1; /* hide object-name + args when doing graph on parent */ };
Index: m_binbuf.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_binbuf.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** m_binbuf.c 11 Aug 2006 20:09:07 -0000 1.8 --- m_binbuf.c 15 Aug 2006 04:54:15 -0000 1.9 *************** *** 758,761 **** --- 758,780 ---- }
+ /* read a binbuf from a file, via the search patch of a canvas */ + int binbuf_read_via_canvas(t_binbuf *b, char *filename, t_canvas *canvas, + int crflag) + { + int filedesc; + char buf[MAXPDSTRING], *bufptr; + if ((filedesc = canvas_open(canvas, filename, "", + buf, &bufptr, MAXPDSTRING, 0)) < 0) + { + error("%s: can't open", filename); + return (1); + } + else close (filedesc); + if (binbuf_read(b, bufptr, buf, crflag)) + return (1); + else return (0); + } + + /* old version */ int binbuf_read_via_path(t_binbuf *b, char *filename, char *dirname, int crflag)
Index: configure.in =================================================================== RCS file: /cvsroot/pure-data/pd/src/configure.in,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** configure.in 11 Aug 2006 20:09:07 -0000 1.18 --- configure.in 15 Aug 2006 04:54:15 -0000 1.19 *************** *** 252,256 **** if test `uname -r` = 7.9.0; then ! MORECFLAGS="-Wno-error" EXTERNTARGET=d_ppc else --- 252,256 ---- if test `uname -r` = 7.9.0; then ! MORECFLAGS="-DPA_BIG_ENDIAN -Wno-error" EXTERNTARGET=d_ppc else
Index: notes.txt =================================================================== RCS file: /cvsroot/pure-data/pd/src/notes.txt,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** notes.txt 11 Aug 2006 20:09:07 -0000 1.26 --- notes.txt 15 Aug 2006 04:54:15 -0000 1.27 *************** *** 35,38 **** --- 35,40 ----
problems: + open_via_path call in d_soundfile.c isn't threadsafe + Jack interface never goes idle? (Michael Berkowski, Pd list Aug 11 2006) crashed Pd putting vec and template in wrong order in array element of struct z.pd - list to numbox misbehaves (inlet and object but object is noinlet)
Index: x_arithmetic.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/x_arithmetic.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** x_arithmetic.c 31 Dec 2005 20:55:25 -0000 1.3 --- x_arithmetic.c 15 Aug 2006 04:54:15 -0000 1.4 *************** *** 672,675 **** --- 672,676 ---- float x_f1; float x_f2; + float x_f3; } t_clip;
*************** *** 677,692 **** { t_clip *x = (t_clip *)pd_new(clip_class); - floatinlet_new(&x->x_ob, &x->x_f1); floatinlet_new(&x->x_ob, &x->x_f2); outlet_new(&x->x_ob, &s_float); ! x->x_f1 = f1; ! x->x_f2 = f2; return (x); }
static void clip_float(t_clip *x, t_float f) { ! outlet_float(x->x_ob.ob_outlet, (f < x->x_f1 ? x->x_f1 : ( ! f > x->x_f2 ? x->x_f2 : f))); }
--- 678,700 ---- { t_clip *x = (t_clip *)pd_new(clip_class); floatinlet_new(&x->x_ob, &x->x_f2); + floatinlet_new(&x->x_ob, &x->x_f3); outlet_new(&x->x_ob, &s_float); ! x->x_f2 = f1; ! x->x_f3 = f2; return (x); }
+ static void clip_bang(t_clip *x) + { + outlet_float(x->x_ob.ob_outlet, (x->x_f1 < x->x_f2 ? x->x_f2 : ( + x->x_f1 > x->x_f3 ? x->x_f3 : x->x_f1))); + } + static void clip_float(t_clip *x, t_float f) { ! x->x_f1 = f; ! outlet_float(x->x_ob.ob_outlet, (x->x_f1 < x->x_f2 ? x->x_f2 : ( ! x->x_f1 > x->x_f3 ? x->x_f3 : x->x_f1))); }
*************** *** 696,699 **** --- 704,708 ---- sizeof(t_clip), 0, A_DEFFLOAT, A_DEFFLOAT, 0); class_addfloat(clip_class, clip_float); + class_addbang(clip_class, clip_bang); }
Index: s_main.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** s_main.c 11 Aug 2006 20:09:07 -0000 1.24 --- s_main.c 15 Aug 2006 04:54:15 -0000 1.25 *************** *** 3,10 **** * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
- char pd_version[] = "Pd version 0.40-0test01\n"; - char pd_compiletime[] = __TIME__; - char pd_compiledate[] = __DATE__; - #include "m_pd.h" #include "m_imp.h" --- 3,6 ---- *************** *** 27,30 **** --- 23,30 ---- #endif
+ char *pd_version; + char pd_compiletime[] = __TIME__; + char pd_compiledate[] = __DATE__; + void pd_init(void); int sys_argparse(int argc, char **argv); *************** *** 34,38 **** --- 34,40 ---- int m_scheduler(void); void sys_addhelppath(char *p); + #ifdef USEAPI_ALSA void alsa_adddev(char *name); + #endif
int sys_debuglevel; *************** *** 57,61 **** int sys_midioutdevlist[MAXMIDIOUTDEV] = {1};
! char sys_font[] = "courier"; /* tb: font name */ static int sys_main_srate; static int sys_main_advance; --- 59,63 ---- int sys_midioutdevlist[MAXMIDIOUTDEV] = {1};
! char sys_font[100] = "courier"; /* tb: font name */ static int sys_main_srate; static int sys_main_advance; *************** *** 222,226 **** /* load dynamic libraries specified with "-lib" args */ for (nl = sys_externlist; nl; nl = nl->nl_next) ! if (!sys_load_lib(cwd, nl->nl_string)) post("%s: can't load library", nl->nl_string); /* open patches specifies with "-open" args */ --- 224,228 ---- /* load dynamic libraries specified with "-lib" args */ for (nl = sys_externlist; nl; nl = nl->nl_next) ! if (!sys_load_lib(0, nl->nl_string)) post("%s: can't load library", nl->nl_string); /* open patches specifies with "-open" args */ *************** *** 243,246 **** --- 245,257 ---- static void sys_afterargparse(void);
+ static void pd_makeversion(void) + { + char foo[100]; + sprintf(foo, "Pd version %d.%d-%d%s\n",PD_MAJOR_VERSION, + PD_MINOR_VERSION,PD_BUGFIX_VERSION,PD_TEST_VERSION); + pd_version = malloc(strlen(foo+1)); + strcpy(pd_version, foo); + } + /* this is called from main() in s_entry.c */ int sys_main(int argc, char **argv) *************** *** 260,263 **** --- 271,276 ---- return (1); sys_afterargparse(); /* post-argparse settings */ + /* build version string from defines in m_pd.h */ + pd_makeversion(); if (sys_verbose || sys_version) fprintf(stderr, "%scompiled %s %s\n", pd_version, pd_compiletime, pd_compiledate); *************** *** 727,734 **** else if (!strcmp(*argv, "-typeface") && argc > 1) { ! strcpy(sys_font,*(argv+1)); ! argc -= 2; ! argv += 2; ! } /* } tb */ else if (!strcmp(*argv, "-verbose")) --- 740,748 ---- else if (!strcmp(*argv, "-typeface") && argc > 1) { ! strncpy(sys_font,*(argv+1),sizeof(sys_font)-1); ! sys_font[sizeof(sys_font)-1] = 0; ! argc -= 2; ! argv += 2; ! } /* } tb */ else if (!strcmp(*argv, "-verbose"))
Index: g_array.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_array.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** g_array.c 3 Jun 2006 19:13:07 -0000 1.10 --- g_array.c 15 Aug 2006 04:54:15 -0000 1.11 *************** *** 1380,1385 **** } nelem = array->a_n; ! if ((filedesc = open_via_path( ! canvas_getdir(glist_getcanvas(x->x_glist))->s_name, filename->s_name, "", buf, &bufptr, MAXPDSTRING, 0)) < 0 || !(fd = fdopen(filedesc, "r"))) --- 1380,1384 ---- } nelem = array->a_n; ! if ((filedesc = canvas_open(glist_getcanvas(x->x_glist), filename->s_name, "", buf, &bufptr, MAXPDSTRING, 0)) < 0 || !(fd = fdopen(filedesc, "r")))
Index: g_io.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_io.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** g_io.c 28 Nov 2004 21:20:42 -0000 1.5 --- g_io.c 15 Aug 2006 04:54:15 -0000 1.6 *************** *** 132,136 **** else { ! dsp_add(vinlet_perform, 3, x, outsig->s_vec, outsig->s_n); x->x_read = x->x_buf; } --- 132,136 ---- else { ! dsp_add(vinlet_perform, 3, x, outsig->s_vec, outsig->s_vecsize); x->x_read = x->x_buf; } *************** *** 164,170 ****
/* set up prolog DSP code */ ! void vinlet_dspprolog(t_vinlet *x, t_signal **parentsigs, ! int myvecsize, int phase, int period, int frequency, ! int downsample, int upsample, int reblock, int switched) { t_signal *insig, *outsig; --- 164,170 ----
/* set up prolog DSP code */ ! void vinlet_dspprolog(struct _vinlet *x, t_signal **parentsigs, ! int myvecsize, int calcsize, int phase, int period, int frequency, ! int downsample, int upsample, int reblock, int switched) { t_signal *insig, *outsig; *************** *** 188,192 **** { insig = parentsigs[inlet_getsignalindex(x->x_inlet)]; ! parentvecsize = insig->s_n; re_parentvecsize = parentvecsize * upsample / downsample; } --- 188,192 ---- { insig = parentsigs[inlet_getsignalindex(x->x_inlet)]; ! parentvecsize = insig->s_vecsize; re_parentvecsize = parentvecsize * upsample / downsample; } *************** *** 429,434 **** back to whatever we see on our input during the "dsp" method called later. */ ! void voutlet_dspprolog(t_voutlet *x, t_signal **parentsigs, ! int myvecsize, int phase, int period, int frequency, int downsample, int upsample, int reblock, int switched) { --- 429,434 ---- back to whatever we see on our input during the "dsp" method called later. */ ! void voutlet_dspprolog(struct _voutlet *x, t_signal **parentsigs, ! int myvecsize, int calcsize, int phase, int period, int frequency, int downsample, int upsample, int reblock, int switched) { *************** *** 454,458 **** insig = sp[0]; if (x->x_justcopyout) ! dsp_add_copy(insig->s_vec, x->x_directsignal->s_vec, insig->s_n); else if (x->x_directsignal) { --- 454,458 ---- insig = sp[0]; if (x->x_justcopyout) ! dsp_add_copy(insig->s_vec, x->x_directsignal->s_vec, insig->s_n); else if (x->x_directsignal) { *************** *** 469,475 **** time to copy the samples out to the containing object's outlets. If we aren't reblocking, there's nothing to do here. */ ! void voutlet_dspepilog(t_voutlet *x, t_signal **parentsigs, ! int myvecsize, int phase, int period, int frequency, int downsample, ! int upsample, int reblock, int switched) { if (!x->x_buf) return; /* this shouldn't be necesssary... */ --- 469,475 ---- time to copy the samples out to the containing object's outlets. If we aren't reblocking, there's nothing to do here. */ ! void voutlet_dspepilog(struct _voutlet *x, t_signal **parentsigs, ! int myvecsize, int calcsize, int phase, int period, int frequency, ! int downsample, int upsample, int reblock, int switched) { if (!x->x_buf) return; /* this shouldn't be necesssary... */ *************** *** 485,489 **** { outsig = parentsigs[outlet_getsignalindex(x->x_parentoutlet)]; ! parentvecsize = outsig->s_n; re_parentvecsize = parentvecsize * upsample / downsample; } --- 485,489 ---- { outsig = parentsigs[outlet_getsignalindex(x->x_parentoutlet)]; ! parentvecsize = outsig->s_vecsize; re_parentvecsize = parentvecsize * upsample / downsample; }
Index: s_audio_alsamm.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio_alsamm.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** s_audio_alsamm.c 18 May 2005 04:28:51 -0000 1.3 --- s_audio_alsamm.c 15 Aug 2006 04:54:15 -0000 1.4 *************** *** 217,221 **** for(i=0;i < ALSA_MAXDEV;i++){ alsa_indev[i].a_synced=alsa_outdev[i].a_synced=0; ! alsa_indev[i].a_channels=alsa_outdev[i].a_channels=0; } alsamm_inchannels = 0; --- 217,221 ---- for(i=0;i < ALSA_MAXDEV;i++){ alsa_indev[i].a_synced=alsa_outdev[i].a_synced=0; ! alsa_indev[i].a_channels=alsa_outdev[i].a_channels=-1; /* query defaults */ } alsamm_inchannels = 0; *************** *** 511,515 **** post("Getting channels:min=%d, max= %d for request=%d",minchs,maxchs,channels); #endif ! if(channels > maxchs)channels = maxchs; if(channels < minchs)channels = minchs; --- 511,515 ---- post("Getting channels:min=%d, max= %d for request=%d",minchs,maxchs,channels); #endif ! if(channels < 0)channels=maxchs; if(channels > maxchs)channels = maxchs; if(channels < minchs)channels = minchs;
Index: s_inter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** s_inter.c 3 Jun 2006 19:13:07 -0000 1.16 --- s_inter.c 15 Aug 2006 04:54:15 -0000 1.17 *************** *** 86,90 **** };
- extern char pd_version[]; extern int sys_guisetportnumber; extern char sys_font[]; /* tb: typeface */ --- 86,89 ---- *************** *** 848,851 **** --- 847,851 ---- 8, 5, 9, 10, 6, 10, 12, 7, 13, 14, 9, 17, 16, 10, 19, 24, 15, 28, 24, 15, 28}; + #define NDEFAULTFONT (sizeof(defaultfontshit)/sizeof(*defaultfontshit))
int sys_startgui(const char *guidir) *************** *** 895,899 **** /* fake the GUI's message giving cwd and font sizes; then skip starting the GUI up. */ ! t_atom zz[19]; int i; #ifdef MSW --- 895,899 ---- /* fake the GUI's message giving cwd and font sizes; then skip starting the GUI up. */ ! t_atom zz[NDEFAULTFONT+2]; int i; #ifdef MSW *************** *** 907,913 **** #endif SETSYMBOL(zz, gensym(cmdbuf)); ! for (i = 1; i < 22; i++) ! SETFLOAT(zz + i, defaultfontshit[i-1]); ! SETFLOAT(zz+22,0); glob_initfromgui(0, 0, 23, zz); } --- 907,913 ---- #endif SETSYMBOL(zz, gensym(cmdbuf)); ! for (i = 0; i < (int)NDEFAULTFONT; i++) ! SETFLOAT(zz+i+1, defaultfontshit[i]); ! SETFLOAT(zz+NDEFAULTFONT+1,0); glob_initfromgui(0, 0, 23, zz); } *************** *** 1248,1253 **** sys_get_audio_apis(buf); sys_get_midi_apis(buf2); ! sys_vgui("pdtk_pd_startup {%s} %s %s {%s}\n", pd_version, buf, buf2, ! sys_font); } return (0); --- 1248,1252 ---- sys_get_audio_apis(buf); sys_get_midi_apis(buf2); ! sys_vgui("pdtk_pd_startup %s %s {%s}\n", buf, buf2, sys_font); } return (0);
Index: m_pd.h =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_pd.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** m_pd.h 31 Dec 2005 20:55:25 -0000 1.9 --- m_pd.h 15 Aug 2006 04:54:15 -0000 1.10 *************** *** 10,14 ****
#define PD_MAJOR_VERSION 0 ! #define PD_MINOR_VERSION 39
/* old name for "MSW" flag -- we have to take it for the sake of many old --- 10,16 ----
#define PD_MAJOR_VERSION 0 ! #define PD_MINOR_VERSION 40 ! #define PD_BUGFIX_VERSION 0 ! #define PD_TEST_VERSION "test02"
/* old name for "MSW" flag -- we have to take it for the sake of many old *************** *** 289,292 **** --- 291,296 ---- EXTERN int binbuf_read(t_binbuf *b, char *filename, char *dirname, int crflag); + EXTERN int binbuf_read_via_canvas(t_binbuf *b, char *filename, t_canvas *canvas, + int crflag); EXTERN int binbuf_read_via_path(t_binbuf *b, char *filename, char *dirname, int crflag); *************** *** 368,371 **** --- 372,377 ---- EXTERN int sys_fontheight(int fontsize); EXTERN void canvas_dataproperties(t_glist *x, t_scalar *sc, t_binbuf *b); + EXTERN int canvas_open(t_canvas *x, const char *name, const char *ext, + char *dirresult, char **nameresult, unsigned int size, int bin);
/* ---------------- widget behaviors ---------------------- */ *************** *** 480,486 **** struct _signal *s_nextfree; /* next in freelist */ struct _signal *s_nextused; /* next in used list */ } t_signal;
- typedef t_int *(*t_perfroutine)(t_int *args);
--- 486,492 ---- struct _signal *s_nextfree; /* next in freelist */ struct _signal *s_nextused; /* next in used list */ + int s_vecsize; /* allocated size of array in points */ } t_signal;
typedef t_int *(*t_perfroutine)(t_int *args);
Index: makefile.in =================================================================== RCS file: /cvsroot/pure-data/pd/src/makefile.in,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** makefile.in 11 Aug 2006 20:09:07 -0000 1.11 --- makefile.in 15 Aug 2006 04:54:15 -0000 1.12 *************** *** 60,63 **** --- 60,77 ---- GOBJ = $(GSRC:.c=.o)
+ # get version from m_pd.h to use in doc/1.manual/1.introduction.txt + PD_MAJOR_VERSION := $(shell grep PD_MAJOR_VERSION m_pd.h | \ + sed 's|^.define *PD_MAJOR_VERSION *([0-9]*).*|\1|' ) + PD_MINOR_VERSION := $(shell grep PD_MINOR_VERSION m_pd.h | \ + sed 's|^.define *PD_MINOR_VERSION *([0-9]*).*|\1|' ) + PD_BUGFIX_VERSION := $(shell grep PD_BUGFIX_VERSION m_pd.h | \ + sed 's|^.define *PD_BUGFIX_VERSION *([0-9]*).*|\1|' ) + PD_TEST_VERSION := $(shell grep PD_TEST_VERSION m_pd.h | \ + sed 's|^.define *PD_TEST_VERSION *"(.*)".*|\1|' ) + PD_VERSION := $(PD_MAJOR_VERSION).$(PD_MINOR_VERSION).$(PD_BUGFIX_VERSION) + ifneq ($(PD_TEST_VERSION),) + PD_VERSION := $(PD_VERSION)-$(PD_TEST_VERSION) + endif + # # ------------------ targets ------------------------------------ *************** *** 84,97 **** pd-watchdog: $(BIN_DIR)/pd-watchdog
! $(BIN_DIR)/pd-watchdog: s_watchdog.c $(CC) -O2 $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
! $(BIN_DIR)/pdsend: u_pdsend.c $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c
! $(BIN_DIR)/pdreceive: u_pdreceive.c $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c
! $(PDEXEC): $(OBJ) cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(OBJ) \ $(LIB) --- 98,114 ---- pd-watchdog: $(BIN_DIR)/pd-watchdog
! $(BIN_DIR): ! test -d $(BIN_DIR) || mkdir -p $(BIN_DIR) ! ! $(BIN_DIR)/pd-watchdog: s_watchdog.c $(BIN_DIR) $(CC) -O2 $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
! $(BIN_DIR)/pdsend: u_pdsend.c $(BIN_DIR) $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c
! $(BIN_DIR)/pdreceive: u_pdreceive.c $(BIN_DIR) $(CC) $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c
! $(PDEXEC): $(OBJ) $(BIN_DIR) cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(OBJ) \ $(LIB) *************** *** 128,131 **** --- 145,149 ---- BINARYMODE=@binarymode@
+ ABOUT_FILE=$(pddocdir)/1.manual/1.introduction.txt install: all install -d $(libpdbindir) *************** *** 147,150 **** --- 165,172 ---- install -p ../doc/7.stuff/$$dir/*.* $(pddocdir)/7.stuff/$$dir ; \ done + mv $(ABOUT_FILE) $(ABOUT_FILE).tmp + cat $(ABOUT_FILE).tmp | sed 's|PD_VERSION|Pd version $(PD_VERSION)|' \ + > $(ABOUT_FILE) + rm $(ABOUT_FILE).tmp cp -pr ../extra $(libpddir)/ rm -f $(libpddir)/extra/*/*.o
Index: g_editor.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_editor.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** g_editor.c 11 Aug 2006 20:09:07 -0000 1.16 --- g_editor.c 15 Aug 2006 04:54:15 -0000 1.17 *************** *** 822,826 **** } } ! else if (flag && !glist_isgraph(x)) { if (x->gl_pixwidth <= 0) --- 822,826 ---- } } ! else if (flag) { if (x->gl_pixwidth <= 0) *************** *** 833,836 **** --- 833,837 ---- gobj_vis(&x->gl_gobj, x->gl_owner, 0); x->gl_isgraph = 1; + x->gl_hidetext = !(!(flag&2)); if (!nogoprect && !x->gl_goprect) { *************** *** 868,872 **** "pdtk_canvas_dialog %%s %g %g %d %g %g %g %g %d %d %d %d\n", 0., 0., ! 1, x->gl_x1, x->gl_y1, x->gl_x2, x->gl_y2, (int)x->gl_pixwidth, (int)x->gl_pixheight, --- 869,873 ---- "pdtk_canvas_dialog %%s %g %g %d %g %g %g %g %d %d %d %d\n", 0., 0., ! glist_isgraph(x) ,//1, x->gl_x1, x->gl_y1, x->gl_x2, x->gl_y2, (int)x->gl_pixwidth, (int)x->gl_pixheight, *************** *** 898,902 **** xperpix = atom_getfloatarg(0, argc, argv); yperpix = atom_getfloatarg(1, argc, argv); ! graphme = (atom_getfloatarg(2, argc, argv) != 0); x1 = atom_getfloatarg(3, argc, argv); y1 = atom_getfloatarg(4, argc, argv); --- 899,903 ---- xperpix = atom_getfloatarg(0, argc, argv); yperpix = atom_getfloatarg(1, argc, argv); ! graphme = (int)(atom_getfloatarg(2, argc, argv)); x1 = atom_getfloatarg(3, argc, argv); y1 = atom_getfloatarg(4, argc, argv);
Index: d_ugen.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_ugen.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** d_ugen.c 21 Aug 2005 14:46:17 -0000 1.6 --- d_ugen.c 15 Aug 2006 04:54:15 -0000 1.7 *************** *** 21,35 **** t_sample *obj_findsignalscalar(t_object *x, int m); static int ugen_loud; EXTERN_STRUCT _vinlet; EXTERN_STRUCT _voutlet;
void vinlet_dspprolog(struct _vinlet *x, t_signal **parentsigs, ! int myvecsize, int phase, int period, int frequency, int downsample, int upsample, int reblock, int switched); void voutlet_dspprolog(struct _voutlet *x, t_signal **parentsigs, ! int myvecsize, int phase, int period, int frequency, int downsample, int upsample, int reblock, int switched); void voutlet_dspepilog(struct _voutlet *x, t_signal **parentsigs, ! int myvecsize, int phase, int period, int frequency, int downsample, int upsample, int reblock, int switched);
--- 21,38 ---- t_sample *obj_findsignalscalar(t_object *x, int m); static int ugen_loud; + static t_int *dsp_chain; + static int dsp_chainsize; + EXTERN_STRUCT _vinlet; EXTERN_STRUCT _voutlet;
void vinlet_dspprolog(struct _vinlet *x, t_signal **parentsigs, ! int myvecsize, int calcsize, int phase, int period, int frequency, int downsample, int upsample, int reblock, int switched); void voutlet_dspprolog(struct _voutlet *x, t_signal **parentsigs, ! int myvecsize, int calcsize, int phase, int period, int frequency, int downsample, int upsample, int reblock, int switched); void voutlet_dspepilog(struct _voutlet *x, t_signal **parentsigs, ! int myvecsize, int calcsize, int phase, int period, int frequency, int downsample, int upsample, int reblock, int switched);
*************** *** 105,114 **** { t_object x_obj; ! int x_vecsize; int x_overlap; int x_phase; /* from 0 to period-1; when zero we run the block */ int x_period; /* submultiple of containing canvas */ int x_frequency; /* supermultiple of comtaining canvas */ ! int x_count; int x_blocklength; /* length of dspchain for this block */ int x_epiloglength; /* length of epilog */ --- 108,119 ---- { t_object x_obj; ! int x_vecsize; /* size of audio signals in this block */ ! int x_calcsize; /* number of samples actually to compute */ int x_overlap; int x_phase; /* from 0 to period-1; when zero we run the block */ int x_period; /* submultiple of containing canvas */ int x_frequency; /* supermultiple of comtaining canvas */ ! int x_count; /* number of times parent block has called us */ ! int x_chainonset; /* beginning of code in DSP chain */ int x_blocklength; /* length of dspchain for this block */ int x_epiloglength; /* length of epilog */ *************** *** 118,122 **** int x_upsample; /* upsampling-factor */ int x_downsample; /* downsampling-factor */ ! } t_block;
--- 123,127 ---- int x_upsample; /* upsampling-factor */ int x_downsample; /* downsampling-factor */ ! int x_return; /* stop right after this block (for one-shots) */ } t_block;
*************** *** 137,151 **** }
! static void block_set(t_block *x, t_floatarg fvecsize, t_floatarg foverlap, t_floatarg fupsample) { int upsample, downsample; ! int vecsize = fvecsize; int overlap = foverlap; int dspstate = canvas_suspend_dsp(); if (overlap < 1) overlap = 1; ! if (vecsize < 0) ! vecsize = 0; /* this means we'll get it from parent later. */
if (fupsample <= 0) --- 142,157 ---- }
! static void block_set(t_block *x, t_floatarg fcalcsize, t_floatarg foverlap, t_floatarg fupsample) { int upsample, downsample; ! int calcsize = fcalcsize; int overlap = foverlap; int dspstate = canvas_suspend_dsp(); + int vecsize; if (overlap < 1) overlap = 1; ! if (calcsize < 0) ! calcsize = 0; /* this means we'll get it from parent later. */
if (fupsample <= 0) *************** *** 161,164 **** --- 167,177 ---- }
+ /* vecsize is smallest power of 2 large enough to hold calcsize */ + if (calcsize) + { + if ((vecsize = (1 << ilog2(calcsize))) != calcsize) + vecsize *= 2; + } + else vecsize = 0; if (vecsize && (vecsize != (1 << ilog2(vecsize)))) { *************** *** 182,185 **** --- 195,199 ---- }
+ x->x_calcsize = calcsize; x->x_vecsize = vecsize; x->x_overlap = overlap; *************** *** 203,206 **** --- 217,235 ---- x->x_switchon = (f != 0); } + + static void block_bang(t_block *x) + { + if (x->x_switched && !x->x_switchon) + { + t_int *ip; + x->x_return = 1; + for (ip = dsp_chain + x->x_chainonset; ip; ) + ip = (*(t_perfroutine)(*ip))(ip); + x->x_return = 0; + } + else pd_error(x, "bang to block~ or on-state switch~ has no effect"); + } + + #define PROLOGCALL 2 #define EPILOGCALL 2 *************** *** 232,235 **** --- 261,266 ---- t_block *x = (t_block *)w[1]; int count = x->x_count - 1; + if (x->x_return) + return (0); if (!x->x_reblock) return (w + x->x_epiloglength + EPILOGCALL); *************** *** 258,267 **** class_addmethod(block_class, (t_method)block_dsp, gensym("dsp"), 0); class_addfloat(block_class, block_float); }
/* ------------------ DSP call list ----------------------- */
! static t_int *dsp_chain; ! static int dsp_chainsize;
void dsp_add(t_perfroutine f, int n, ...) --- 289,301 ---- class_addmethod(block_class, (t_method)block_dsp, gensym("dsp"), 0); class_addfloat(block_class, block_float); + class_addbang(block_class, block_bang); }
/* ------------------ DSP call list ----------------------- */
! static t_int dsp_done(t_int *w) ! { ! return (0); ! }
void dsp_add(t_perfroutine f, int n, ...) *************** *** 277,281 **** dsp_chain[dsp_chainsize + i] = va_arg(ap, t_int); va_end(ap); ! dsp_chain[newsize-1] = 0; dsp_chainsize = newsize; } --- 311,315 ---- dsp_chain[dsp_chainsize + i] = va_arg(ap, t_int); va_end(ap); ! dsp_chain[newsize-1] = (t_int)dsp_done; dsp_chainsize = newsize; } *************** *** 291,295 **** for (i = 0; i < n; i++) dsp_chain[dsp_chainsize + i] = vec[i]; ! dsp_chain[newsize-1] = 0; dsp_chainsize = newsize; } --- 325,329 ---- for (i = 0; i < n; i++) dsp_chain[dsp_chainsize + i] = vec[i]; ! dsp_chain[newsize-1] = (t_int)dsp_done; dsp_chainsize = newsize; } *************** *** 300,304 **** { t_int *ip; ! for (ip = dsp_chain; *ip; ) ip = (*(t_perfroutine)(*ip))(ip); dsp_phase++; } --- 334,338 ---- { t_int *ip; ! for (ip = dsp_chain; ip; ) ip = (*(t_perfroutine)(*ip))(ip); dsp_phase++; } *************** *** 335,339 **** signal_usedlist = sig->s_nextused; if (!sig->s_isborrowed) ! t_freebytes(sig->s_vec, sig->s_n * sizeof (*sig->s_vec)); t_freebytes(sig, sizeof *sig); } --- 369,373 ---- signal_usedlist = sig->s_nextused; if (!sig->s_isborrowed) ! t_freebytes(sig->s_vec, sig->s_vecsize * sizeof (*sig->s_vec)); t_freebytes(sig, sizeof *sig); } *************** *** 346,350 **** void signal_makereusable(t_signal *sig) { ! int logn = ilog2(sig->s_n); #if 1 t_signal *s5; --- 380,384 ---- void signal_makereusable(t_signal *sig) { ! int logn = ilog2(sig->s_vecsize); #if 1 t_signal *s5; *************** *** 396,400 **** t_signal *signal_new(int n, float sr) { ! int logn, n2; t_signal *ret, **whichlist; t_sample *fp; --- 430,434 ---- t_signal *signal_new(int n, float sr) { ! int logn, n2, vecsize = 0; t_signal *ret, **whichlist; t_sample *fp; *************** *** 402,407 **** if (n) { ! if (n != (1 << logn)) ! bug("signal buffer not a power of 2"); if (logn > MAXLOGSIG) bug("signal buffer too large"); --- 436,441 ---- if (n) { ! if ((vecsize = (1<<logn)) != n) ! vecsize *= 2; if (logn > MAXLOGSIG) bug("signal buffer too large"); *************** *** 420,424 **** if (n) { ! ret->s_vec = (t_sample *)getbytes(n * sizeof (*ret->s_vec)); ret->s_isborrowed = 0; } --- 454,458 ---- if (n) { ! ret->s_vec = (t_sample *)getbytes(vecsize * sizeof (*ret->s_vec)); ret->s_isborrowed = 0; } *************** *** 432,435 **** --- 466,470 ---- } ret->s_n = n; + ret->s_vecsize = vecsize; ret->s_sr = sr; ret->s_refcount = 0; *************** *** 453,456 **** --- 488,492 ---- sig->s_vec = sig2->s_vec; sig->s_n = sig2->s_n; + sig->s_vecsize = sig2->s_vecsize; }
*************** *** 505,509 **** t_signal **dc_iosigs; float dc_srate; ! int dc_vecsize; char dc_toplevel; /* true if "iosigs" is invalid. */ char dc_reblock; /* true if we have to reblock inlets/outlets */ --- 541,546 ---- t_signal **dc_iosigs; float dc_srate; ! int dc_vecsize; /* vector size, power of two */ ! int dc_calcsize; /* number of elements to calculate */ char dc_toplevel; /* true if "iosigs" is invalid. */ char dc_reblock; /* true if we have to reblock inlets/outlets */ *************** *** 833,837 **** float parent_srate; int parent_vecsize; ! int period, frequency, phase, vecsize; float srate; int chainblockbegin; /* DSP chain onset before block prolog code */ --- 870,874 ---- float parent_srate; int parent_vecsize; ! int period, frequency, phase, vecsize, calcsize; float srate; int chainblockbegin; /* DSP chain onset before block prolog code */ *************** *** 887,890 **** --- 924,930 ---- if (vecsize == 0) vecsize = parent_vecsize; + calcsize = blk->x_calcsize; + if (calcsize == 0) + calcsize = vecsize; realoverlap = blk->x_overlap; if (realoverlap > vecsize) realoverlap = vecsize; *************** *** 907,911 **** (vecsize != parent_vecsize) || (downsample != 1) || (upsample != 1)) ! reblock = 1; switched = blk->x_switched; } --- 947,951 ---- (vecsize != parent_vecsize) || (downsample != 1) || (upsample != 1)) ! reblock = 1; switched = blk->x_switched; } *************** *** 924,927 **** --- 964,968 ---- dc->dc_srate = srate; dc->dc_vecsize = vecsize; + dc->dc_calcsize = calcsize;
/* if we're reblocking or switched, we now have to create output *************** *** 968,976 **** if (pd_class(zz) == vinlet_class) vinlet_dspprolog((struct _vinlet *)zz, ! dc->dc_iosigs, vecsize, dsp_phase, period, frequency, downsample, upsample, reblock, switched); else if (pd_class(zz) == voutlet_class) voutlet_dspprolog((struct _voutlet *)zz, ! outsigs, vecsize, dsp_phase, period, frequency, downsample, upsample, reblock, switched); } --- 1009,1017 ---- if (pd_class(zz) == vinlet_class) vinlet_dspprolog((struct _vinlet *)zz, ! dc->dc_iosigs, vecsize, calcsize, dsp_phase, period, frequency, downsample, upsample, reblock, switched); else if (pd_class(zz) == voutlet_class) voutlet_dspprolog((struct _voutlet *)zz, ! outsigs, vecsize, calcsize, dsp_phase, period, frequency, downsample, upsample, reblock, switched); } *************** *** 978,983 ****
if (blk && (reblock || switched)) /* add the block DSP prolog */ dsp_add(block_prolog, 1, blk); ! /* Initialize for sorting */ for (u = dc->dc_ugenlist; u; u = u->u_next) --- 1019,1026 ----
if (blk && (reblock || switched)) /* add the block DSP prolog */ + { dsp_add(block_prolog, 1, blk); ! blk->x_chainonset = dsp_chainsize - 1; ! } /* Initialize for sorting */ for (u = dc->dc_ugenlist; u; u = u->u_next) *************** *** 1045,1049 **** if (iosigs) iosigs += dc->dc_ninlets; voutlet_dspepilog((struct _voutlet *)zz, ! iosigs, vecsize, dsp_phase, period, frequency, downsample, upsample, reblock, switched); } --- 1088,1092 ---- if (iosigs) iosigs += dc->dc_ninlets; voutlet_dspepilog((struct _voutlet *)zz, ! iosigs, vecsize, calcsize, dsp_phase, period, frequency, downsample, upsample, reblock, switched); }