Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8128/pd/src
Modified Files: notes.txt s_audio.c s_file.c s_inter.c s_main.c s_path.c t_tkcmd.c u_main.tk x_gui.c Log Message: Bug fixes, notably for mac if no audio input device is available; also worked around a problem in ASIO support on MSW (but need to fix it better.)
Index: s_main.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** s_main.c 15 Sep 2005 03:17:27 -0000 1.18 --- s_main.c 15 Oct 2005 23:14:28 -0000 1.19 *************** *** 3,7 **** * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */
! char pd_version[] = "Pd version 0.39-1test1\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-1\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.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** u_main.tk 19 Aug 2005 23:28:03 -0000 1.16 --- u_main.tk 15 Oct 2005 23:14:28 -0000 1.17 *************** *** 70,75 **** if {$pd_macready != 0} { pd [concat pd open [pdtk_enquote [file tail $file]] \ ! [pdtk_enquote [file dirname $file]] ;] ! menu_doc_open [file dirname $file] [file tail $file] } else { set pd_macdropped $args --- 70,75 ---- if {$pd_macready != 0} { pd [concat pd open [pdtk_enquote [file tail $file]] \ ! [pdtk_enquote [file dirname $file]] ;] [...3518 lines suppressed...] pack $id.nortframe -side bottom -fill x -pady 2m if {$pd_nt != 1} { ! checkbutton $id.nortframe.nort -text {defeat real-time scheduling} \ ! -variable pd_nort -anchor w } button $id.nortframe.save -text {Save all settings}\ ! -command "startup_apply $id ; pd pd save-preferences \;" if {$pd_nt != 1} { ! pack $id.nortframe.nort $id.nortframe.save -side left -expand 1 } else { ! pack $id.nortframe.save -side left -expand 1 }
for {set x 0} {$x < 10} {incr x} { ! entry $id.f$x -textvariable pd_startup$x -width 80 ! bind $id.f$x <KeyPress-Return> [concat startup_ok $id] ! pdtk_standardkeybindings $id.f$x ! pack $id.f$x -side top }
Index: s_path.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_path.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** s_path.c 18 May 2005 04:28:51 -0000 1.6 --- s_path.c 15 Oct 2005 23:14:28 -0000 1.7 *************** *** 376,379 **** --- 376,385 ---- char* buffer; char fname[MAXPDSTRING], buf[1000], *home = getenv("HOME"); + int retval = 1; /* that's what we will return at the end; for now, let's think it'll be an error */ + + /* initialize rc-arg-array so we can safely clean up at the end */ + for (i = 1; i < NUMARGS-1; i++) + rcargv[i]=0; +
/* parse a startup file */ *************** *** 399,403 **** buf[1000] = 0; if (!(rcargv[i] = malloc(strlen(buf) + 1))) ! return (1); strcpy(rcargv[i], buf); } --- 405,409 ---- buf[1000] = 0; if (!(rcargv[i] = malloc(strlen(buf) + 1))) ! goto cleanup; strcpy(rcargv[i], buf); } *************** *** 424,430 **** { post("error parsing RC arguments"); ! return (1); } ! return (0); } #endif /* MSW */ --- 430,444 ---- { post("error parsing RC arguments"); ! goto cleanup; } ! ! retval=0; /* we made it without an error */ ! ! ! cleanup: /* prevent memleak */ ! for (i = 1; i < NUMARGS-1; i++) ! if(rcargv[i])free(rcargv[i]); ! ! return(retval); } #endif /* MSW */
Index: s_inter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** s_inter.c 19 Aug 2005 23:28:03 -0000 1.13 --- s_inter.c 15 Oct 2005 23:14:28 -0000 1.14 *************** *** 285,288 **** --- 285,289 ---- #endif
+ #ifdef REALLY_POSIX_MEMLOCK /* this doesn't work on Fedora 4, for example. */ #ifdef _POSIX_MEMLOCK /* tb: force memlock to physical memory { */ *************** *** 297,301 **** fprintf(stderr, "memory locking enabled.\n"); #endif ! }
--- 298,302 ---- fprintf(stderr, "memory locking enabled.\n"); #endif ! #endif }
Index: notes.txt =================================================================== RCS file: /cvsroot/pure-data/pd/src/notes.txt,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** notes.txt 21 Aug 2005 17:46:52 -0000 1.21 --- notes.txt 15 Oct 2005 23:14:28 -0000 1.22 *************** *** 66,69 **** --- 66,70 ---- expr to parse exponential notation pipe to handle symbols&pointers (just takes floats now???) + use snd_pcm_poll_descriptors_count, etc., to set alsa FDs CLOEXEC? editing: "enter" into object box to create new one (also, change border? forking?)
Index: t_tkcmd.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/t_tkcmd.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** t_tkcmd.c 19 Aug 2005 23:28:03 -0000 1.5 --- t_tkcmd.c 15 Oct 2005 23:14:28 -0000 1.6 *************** *** 480,490 **** static void pdgui_setupsocket(void) { - #ifdef DEBUGCONNECT - debugfd = fopen("/Users/msp/bratwurst", "w"); - fprintf(debugfd, "turning stderr back on\n"); - fflush(debugfd); - dup2(fileno(debugfd), 2); - fprintf(stderr, "duped to stderr?\n"); - #endif #ifdef MSW pdgui_connecttosocket(); --- 480,483 ---- *************** *** 625,630 **** --- 618,641 ---- const char *argv = Tcl_GetVar(interp, "argv", 0); int portno, argno = 0; + /* argument passing seems to be different in MSW as opposed to + unix-likes. Here we check if we got sent a "port number" as an + argument. If so. we're to connect to a previously running pd (i.e., + pd got started first). If not, we start Pd from here. */ + #ifdef MSW if (argv && (portno = atoi(argv)) > 1) + #else + char *firstspace; + if (argv && (firstspace = strchr(argv, ' ')) && (portno = atoi(firstspace)) > 1) + #endif pdgui_setsock(portno); + #ifdef DEBUGCONNECT + debugfd = fopen("/Users/msp/bratwurst", "w"); + fprintf(debugfd, "turning stderr back on\n"); + fflush(debugfd); + dup2(fileno(debugfd), 2); + fprintf(stderr, "duped to stderr?\n"); + fprintf(stderr, "portno %d\n", pd_portno); + fprintf(stderr, "argv %s\n", argv); + #endif tk_pdinterp = interp; pdgui_startup(interp);
Index: s_audio.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** s_audio.c 28 Nov 2004 21:20:42 -0000 1.7 --- s_audio.c 15 Oct 2005 23:14:28 -0000 1.8 *************** *** 26,29 **** --- 26,35 ---- #define SYS_XFERSAMPS (SYS_DEFAULTCH*DEFDACBLKSIZE) #define SYS_XFERSIZE (SYS_SAMPLEWIDTH * SYS_XFERSAMPS) + #define MAXNDEV 20 + #define DEVDESCSIZE 80 + + static void audio_getdevs(char *indevlist, int *nindevs, + char *outdevlist, int *noutdevs, int *canmulti, + int maxndev, int devdescsize);
/* these are set in this file when opening audio, but then may be reduced, *************** *** 168,171 **** --- 174,182 ---- int realinchans[MAXAUDIOINDEV], realoutchans[MAXAUDIOOUTDEV];
+ char indevlist[MAXNDEV*DEVDESCSIZE], outdevlist[MAXNDEV*DEVDESCSIZE]; + int indevs = 0, outdevs = 0, canmulti = 0; + audio_getdevs(indevlist, &indevs, outdevlist, &outdevs, &canmulti, + MAXNDEV, DEVDESCSIZE); + if (sys_externalschedlib) { *************** *** 189,196 **** if (nchindev == -1) { ! nchindev=1; ! chindev[0] = defaultchannels; ! naudioindev = 1; ! audioindev[0] = DEFAULTAUDIODEV; } else --- 200,211 ---- if (nchindev == -1) { ! if (indevs >= 1) ! { ! nchindev=1; ! chindev[0] = defaultchannels; ! naudioindev = 1; ! audioindev[0] = DEFAULTAUDIODEV; ! } ! else naudioindev = nchindev = 0; } else *************** *** 235,242 **** if (nchoutdev == -1) { ! nchoutdev=1; ! choutdev[0]=defaultchannels; ! naudiooutdev=1; ! audiooutdev[0] = DEFAULTAUDIODEV; } else --- 250,261 ---- if (nchoutdev == -1) { ! if (outdevs >= 1) ! { ! nchoutdev=1; ! choutdev[0]=defaultchannels; ! naudiooutdev=1; ! audiooutdev[0] = DEFAULTAUDIODEV; ! } ! else nchoutdev = naudiooutdev = 0; } else *************** *** 501,507 **** }
- #define MAXNDEV 20 - #define DEVDESCSIZE 80 - static void audio_getdevs(char *indevlist, int *nindevs, char *outdevlist, int *noutdevs, int *canmulti, --- 520,523 ---- *************** *** 606,609 **** --- 622,626 ---- }
+ /* start an audio settings dialog window */ void glob_audio_properties(t_pd *dummy, t_floatarg flongform)
Index: x_gui.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/x_gui.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** x_gui.c 6 Sep 2004 20:20:36 -0000 1.3 --- x_gui.c 15 Oct 2005 23:14:28 -0000 1.4 *************** *** 45,49 **** void gfxstub_new(t_pd *owner, void *key, const char *cmd) { ! char buf[MAXPDSTRING]; char namebuf[80]; t_gfxstub *x; --- 45,49 ---- void gfxstub_new(t_pd *owner, void *key, const char *cmd) { ! char buf[4*MAXPDSTRING]; char namebuf[80]; t_gfxstub *x; *************** *** 53,59 **** if (x->x_key == key) gfxstub_deleteforkey(key); ! if (strlen(cmd) + 50 > MAXPDSTRING) { bug("audio dialog too long"); return; } --- 53,60 ---- if (x->x_key == key) gfxstub_deleteforkey(key); ! if (strlen(cmd) + 50 > 4*MAXPDSTRING) { bug("audio dialog too long"); + bug("%x", cmd); return; }
Index: s_file.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_file.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** s_file.c 29 Jul 2005 19:01:21 -0000 1.7 --- s_file.c 15 Oct 2005 23:14:28 -0000 1.8 *************** *** 258,261 **** --- 258,262 ---- #endif /* MACOSX */
+ void sys_loadpreferences( void) { *************** *** 266,269 **** --- 267,271 ---- int i, rate = 0, advance = 0, api, nolib, maxi; char prefbuf[MAXPDSTRING], keybuf[80]; + sys_initloadpreferences(); /* load audio preferences */ *************** *** 272,276 **** sys_set_audio_api(api); if (sys_getpreference("noaudioin", prefbuf, MAXPDSTRING) && ! !strcmp(prefbuf, ".") || !strcmp(prefbuf, "True")) naudioindev = 0; else --- 274,278 ---- sys_set_audio_api(api); if (sys_getpreference("noaudioin", prefbuf, MAXPDSTRING) && ! (!strcmp(prefbuf, ".") || !strcmp(prefbuf, "True"))) /* JMZ/MB: brackets for initializing */ naudioindev = 0; else *************** *** 290,294 **** } if (sys_getpreference("noaudioout", prefbuf, MAXPDSTRING) && ! !strcmp(prefbuf, ".") || !strcmp(prefbuf, "True")) naudiooutdev = 0; else --- 292,296 ---- } if (sys_getpreference("noaudioout", prefbuf, MAXPDSTRING) && ! (!strcmp(prefbuf, ".") || !strcmp(prefbuf, "True"))) /* JMZ/MB: brackets for initializing */ naudiooutdev = 0; else *************** *** 315,319 **** /* load MIDI preferences */ if (sys_getpreference("nomidiin", prefbuf, MAXPDSTRING) && ! !strcmp(prefbuf, ".") || !strcmp(prefbuf, "True")) nmidiindev = 0; else for (i = 0, nmidiindev = 0; i < MAXMIDIINDEV; i++) --- 317,321 ---- /* load MIDI preferences */ if (sys_getpreference("nomidiin", prefbuf, MAXPDSTRING) && ! (!strcmp(prefbuf, ".") || !strcmp(prefbuf, "True"))) /* JMZ/MB: brackets for initializing */ nmidiindev = 0; else for (i = 0, nmidiindev = 0; i < MAXMIDIINDEV; i++) *************** *** 327,331 **** } if (sys_getpreference("nomidiout", prefbuf, MAXPDSTRING) && ! !strcmp(prefbuf, ".") || !strcmp(prefbuf, "True")) nmidioutdev = 0; else for (i = 0, nmidioutdev = 0; i < MAXMIDIOUTDEV; i++) --- 329,333 ---- } if (sys_getpreference("nomidiout", prefbuf, MAXPDSTRING) && ! (!strcmp(prefbuf, ".") || !strcmp(prefbuf, "True"))) /* JMZ/MB: brackets for initializing */ nmidioutdev = 0; else for (i = 0, nmidioutdev = 0; i < MAXMIDIOUTDEV; i++)