Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2113
Modified Files: d_soundfile.c g_editor.c g_mycanvas.c g_text.c m_glob.c m_sched.c makefile notes.txt s_audio.c s_audio_alsa.c s_audio_jack.c s_audio_mmio.c s_audio_oss.c s_inter.c s_main.c Removed Files: build.bat makefile.irix Log Message: merged with version_0_37_1test6
Index: d_soundfile.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_soundfile.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** d_soundfile.c 23 Sep 2003 00:18:13 -0000 1.2 --- d_soundfile.c 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 541,545 **** else if (!strcmp(flag, "little")) { ! endianness = 1; argc -= 1; argv += 1; } --- 541,545 ---- else if (!strcmp(flag, "little")) { ! endianness = 0; argc -= 1; argv += 1; } *************** *** 671,675 **** wavehdr->w_navgbytespersec = swap4((int)(samplerate * nchannels * bytespersamp), swap); ! wavehdr->w_nblockalign = swap2(bytespersamp, swap); wavehdr->w_nbitspersample = swap2(8 * bytespersamp, swap); strncpy(wavehdr->w_datachunkid, "data", 4); --- 671,675 ---- wavehdr->w_navgbytespersec = swap4((int)(samplerate * nchannels * bytespersamp), swap); ! wavehdr->w_nblockalign = swap2(nchannels * bytespersamp, swap); wavehdr->w_nbitspersample = swap2(8 * bytespersamp, swap); strncpy(wavehdr->w_datachunkid, "data", 4); *************** *** 730,733 **** --- 730,746 ---- goto baddonewrite; } + if (filetype == FORMAT_NEXT) + { + /* do it the lazy way: just set the size field to 'unknown size'*/ + uint32 nextsize = 0xffffffff; + if (lseek(fd, 8, SEEK_SET) == 0) + { + goto baddonewrite; + } + if (write(fd, &nextsize, 4) < 4) + { + goto baddonewrite; + } + } } return;
Index: g_editor.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_editor.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** g_editor.c 23 Sep 2003 00:18:13 -0000 1.2 --- g_editor.c 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 1435,1438 **** --- 1435,1440 ---- pd_list(keynamesym->s_thing, 0, 2, at); } + if (!x->gl_editor) /* if that 'invis'ed the window, we'd better stop. */ + return; if (x && down) {
Index: g_mycanvas.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_mycanvas.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** g_mycanvas.c 23 Sep 2003 00:18:14 -0000 1.2 --- g_mycanvas.c 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 317,327 **** &&IS_A_FLOAT(argv,i+9)) { ! if(IS_A_SYMBOL(argv,i+3)) ! srl[2] = atom_getsymbolarg(i+3, argc, argv); ! else if(IS_A_FLOAT(argv,i+3)) ! { ! sprintf(str, "%d", (int)atom_getintarg(i+3, argc, argv)); ! srl[2] = gensym(str); ! } ldx = (int)atom_getintarg(i+4, argc, argv); ldy = (int)atom_getintarg(i+5, argc, argv); --- 317,325 ---- &&IS_A_FLOAT(argv,i+9)) { ! /* disastrously, the "label" sits in a different part of the ! message. So we have to track its location separately (in ! the slot x_labelbindex) and initialize it specially here. */ ! iemgui_new_dogetname(&x->x_gui, i+3, argv); ! x->x_gui.x_labelbindex = i+4; ldx = (int)atom_getintarg(i+4, argc, argv); ldy = (int)atom_getintarg(i+5, argc, argv);
Index: g_text.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/g_text.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** g_text.c 23 Sep 2003 00:18:14 -0000 1.2 --- g_text.c 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 493,497 **** if (x->a_text.te_outlet) outlet_symbol(x->a_text.te_outlet, x->a_atom.a_w.w_symbol); ! if (*x->a_symto->s_name && x->a_symto->s_thing) { if (x->a_symto == x->a_symfrom) --- 493,497 ---- if (x->a_text.te_outlet) outlet_symbol(x->a_text.te_outlet, x->a_atom.a_w.w_symbol); ! if (*x->a_symto->s_name && x->a_expanded_to->s_thing) { if (x->a_symto == x->a_symfrom)
Index: m_glob.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_glob.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** m_glob.c 23 Sep 2003 00:18:14 -0000 1.2 --- m_glob.c 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 98,102 **** class_addmethod(glob_pdobject, (t_method)glob_path_dialog, gensym("path-dialog"), A_GIMME, 0); ! #ifdef UNIX class_addmethod(glob_pdobject, (t_method)glob_ping, gensym("ping"), 0); #endif --- 98,102 ---- class_addmethod(glob_pdobject, (t_method)glob_path_dialog, gensym("path-dialog"), A_GIMME, 0); ! #ifdef __linux__ class_addmethod(glob_pdobject, (t_method)glob_ping, gensym("ping"), 0); #endif
Index: m_sched.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/m_sched.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** m_sched.c 23 Sep 2003 00:18:14 -0000 1.2 --- m_sched.c 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 266,270 **** /* if there's no GUI but we're running in "realtime", here is where we arrange to ping the watchdog every 2 seconds. */ ! #ifdef UNIX if (sys_nogui && sys_hipriority && (sched_diddsp - sched_nextpingtime > 0)) { --- 266,270 ---- /* if there's no GUI but we're running in "realtime", here is where we arrange to ping the watchdog every 2 seconds. */ ! #ifdef __linux__ if (sys_nogui && sys_hipriority && (sched_diddsp - sched_nextpingtime > 0)) {
Index: makefile =================================================================== RCS file: /cvsroot/pure-data/pd/src/makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** makefile 20 Nov 2003 19:28:52 -0000 1.4 --- makefile 2 Feb 2004 14:31:34 -0000 1.5 *************** *** 15,29 **** # ALSA compilation
! SOUND_ALSA =
DEFINES = ! MORECFLAGS = -DDL_OPEN -DUSEAPI_OSS
INCLUDE = -I. ! GINCLUDE = $(INCLUDE) -I/usr/local/include/tcl8.4 -I/usr/local/include/tk8.4 -I/usr/X11R6/include -I/usr/local/include ! GLIB = -lX11 -L/usr/X11R6/lib -L/usr/local/lib -ltcl84 -ltk84
! LDFLAGS = -Wl,-export-dynamic -L/usr/local/lib/pth -lpthread ! LIB = -lm
#select either the DBG and OPT compiler flags below: --- 15,29 ---- # ALSA compilation
! SOUND_ALSA = yes
DEFINES = ! MORECFLAGS = -DDL_OPEN -DUSEAPI_PORTAUDIO -DPA_USE_OSS -DPA_LITTLE_ENDIAN -DUSEAPI_OSS -I../portaudio/pa_common -I../portaudio/pablio -I../portaudio/portmidi-macosx -Werror
INCLUDE = -I. ! GINCLUDE = $(INCLUDE) -I/usr/include/tcl8.4 ! GLIB = -ltk8.4 -ltcl8.4 -lX11 -L/usr/X11R6/lib -L/usr/local/lib
! LDFLAGS = -Wl,-export-dynamic ! LIB = -ldl -lm -lpthread -lasound
#select either the DBG and OPT compiler flags below: *************** *** 64,68 **** # the sources
! SYSSRC += s_midi_oss.c s_audio_oss.c
SRC = g_canvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c g_io.c \ --- 64,68 ---- # the sources
! SYSSRC += s_midi_oss.c s_audio_pa.c s_audio_oss.c ../portaudio/pa_common/pa_allocation.c ../portaudio/pa_common/pa_converters.c ../portaudio/pa_common/pa_cpuload.c ../portaudio/pa_common/pa_dither.c ../portaudio/pa_common/pa_front.c ../portaudio/pa_common/pa_process.c ../portaudio/pa_common/pa_skeleton.c ../portaudio/pa_common/pa_stream.c ../portaudio/pa_common/pa_trace.c ../portaudio/pablio/pablio_pd.c ../portaudio/pablio/ringbuffer_pd.c ../portaudio/pa_unix/pa_unix_hostapis.c ../portaudio/pa_unix/pa_unix_util.c ../portaudio/pa_unix_oss/pa_unix_oss.c
SRC = g_canvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c g_io.c \
Index: notes.txt =================================================================== RCS file: /cvsroot/pure-data/pd/src/notes.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** notes.txt 23 Sep 2003 00:18:14 -0000 1.2 --- notes.txt 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 2,13 ****
fix for 0.37: ! don't prepend help- if sethalpname is called ! Tom schouten: $HOME undefined crashes Pd ! update 'getting pd to run' to start in with dialog panels ! MIDI on windows?
0.38: ! message dialog not to disappear ! sprout inlets/outlets on objects whose creation failed. portaudio_pd files into src GOP bounding box object --- 2,16 ----
fix for 0.37: ! read xx.txt in "bad" gives warnings ! mess with RME ALSA some more; ALSA readn doesn't work yet. ! test MIDI I/O on all platforms, inc. sysex... ! windows quit doesn't confirm on Windows? ! check Pd in OSX 10.3
0.38: ! document env~ second argument (and why is it no less than 1/10 of first???) ! make watchdog work for MACOSX ! %x to %lx in all "tags" to make 64-bit safe ! plug-in support portaudio_pd files into src GOP bounding box object
Index: s_audio.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** s_audio.c 23 Sep 2003 00:18:14 -0000 1.2 --- s_audio.c 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 41,45 **** --- 41,51 ---- int sys_schedadvance; /* scheduler advance in microseconds */ float sys_dacsr; + + #ifdef MACOSX + int sys_hipriority = 1; + #else int sys_hipriority = 0; + #endif + t_sample *sys_soundout; t_sample *sys_soundin; *************** *** 327,330 **** --- 333,338 ---- sys_save_audio_params(naudioindev, audioindev, chindev, naudiooutdev, audiooutdev, choutdev, rate, advance); + if (sys_inchannels == 0 && sys_outchannels == 0) + enable = 0; audio_state = enable; sys_vgui("set pd_whichapi %d\n", (audio_isopen() ? sys_audioapi : 0));
Index: s_audio_alsa.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio_alsa.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** s_audio_alsa.c 23 Sep 2003 00:18:14 -0000 1.2 --- s_audio_alsa.c 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 664,667 **** --- 664,668 ---- #endif } + /* post ("putzeros %d", n); */ }
*************** *** 677,680 **** --- 678,682 ---- #endif } + /* post ("getzeros %d", n); */ }
*************** *** 714,718 **** } defect = indelay + outdelay - alsa_buf_samps; ! if (defect < -DEFDACBLKSIZE) { checkit = 1; --- 716,720 ---- } defect = indelay + outdelay - alsa_buf_samps; ! if (defect < -(3 * DEFDACBLKSIZE / 2) ) { checkit = 1; *************** *** 728,738 **** sys_log_error(ERR_RESYNC), alreadylogged = 1; } } } }
! void alsa_listdevs( void) { ! post("device listing not implemented in ALSA yet\n"); }
--- 730,767 ---- sys_log_error(ERR_RESYNC), alreadylogged = 1; } + /* if (alreadylogged) + post("in %d out %d defect %d", indelay, outdelay, defect); */ } } }
! static int alsa_nnames = 0; ! static char **alsa_names = 0; ! ! void alsa_adddev(char *name) { ! if (alsa_nnames) ! alsa_names = (char **)t_resizebytes(alsa_names, ! alsa_nnames * sizeof(char *), ! (alsa_nnames+1) * sizeof(char *)); ! else alsa_names = (char **)t_getbytes(sizeof(char *)); ! alsa_names[alsa_nnames] = gensym(name)->s_name; ! alsa_nnames++; ! } ! ! static void alsa_numbertoname(int devno, char *devname, int nchar) ! { ! int ndev = 0, cardno = -1; ! while (!snd_card_next(&cardno) && cardno >= 0) ! ndev++; ! if (devno < 2*ndev) ! { ! if (devno & 1) ! snprintf(devname, nchar, "plughw:%d", devno/2); ! else snprintf(devname, nchar, "hw:%d", devno/2); ! } ! else if (devno <2*ndev + alsa_nnames) ! snprintf(devname, nchar, "%s", alsa_names[devno - 2*ndev]); ! else snprintf(devname, nchar, "???"); }
Index: s_audio_jack.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio_jack.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** s_audio_jack.c 23 Sep 2003 00:18:14 -0000 1.2 --- s_audio_jack.c 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 55,65 **** jack_filled -= nframes; } else { /* PD could not keep up ! */ ! if (jack_started) sys_log_error(ERR_RESYNC); ! for (j = 0; j < sys_outchannels; j++) { ! out = jack_port_get_buffer (output_port[j], nframes); ! memset(out, 0, sizeof (float) * nframes); ! } ! memset(jack_outbuf,0,sizeof(jack_outbuf)); ! jack_filled = 0; } pthread_cond_broadcast(&jack_sem); --- 55,65 ---- jack_filled -= nframes; } else { /* PD could not keep up ! */ ! if (jack_started) sys_log_error(ERR_RESYNC); ! for (j = 0; j < outport_count; j++) { ! out = jack_port_get_buffer (output_port[j], nframes); ! memset(out, 0, sizeof (float) * nframes); ! } ! memset(jack_outbuf,0,sizeof(jack_outbuf)); ! jack_filled = 0; } pthread_cond_broadcast(&jack_sem);
Index: s_audio_mmio.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio_mmio.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** s_audio_mmio.c 23 Sep 2003 00:18:14 -0000 1.2 --- s_audio_mmio.c 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 33,37 **** #define DEFBUFFER 30 /* default is about 30x6 = 180 msec! */ static int nt_naudiobuffer = DEFBUFFER; - float sys_dacsr = DEFAULTSRATE;
--- 33,36 ---- *************** *** 114,118 **** }
- static int nt_inalloc[NAPORTS], nt_outalloc[NAPORTS]; static UINT nt_whichdac = WAVE_MAPPER, nt_whichadc = WAVE_MAPPER;
--- 113,116 ---- *************** *** 120,127 **** { PCMWAVEFORMAT form; ! int i; UINT mmresult; int nad, nda; ! if (sys_verbose) post("%d devices in, %d devices out", --- 118,125 ---- { PCMWAVEFORMAT form; ! int i, j; UINT mmresult; int nad, nda; ! static int naudioprepped = 0, nindevsprepped = 0, noutdevsprepped = 0; if (sys_verbose) post("%d devices in, %d devices out", *************** *** 137,140 **** --- 135,164 ---- if (nt_nwavein <= 1 && nt_nwaveout <= 1) nt_noresync(); + + if (nindevsprepped < nt_nwavein) + { + for (i = nindevsprepped; i < nt_nwavein; i++) + for (j = 0; j < nt_naudiobuffer; j++) + wave_prep(&ntsnd_invec[i][j]); + nindevsprepped = nt_nwavein; + } + if (noutdevsprepped < nt_nwaveout) + { + for (i = noutdevsprepped; i < nt_nwaveout; i++) + for (j = 0; j < nt_naudiobuffer; j++) + wave_prep(&ntsnd_outvec[i][j]); + noutdevsprepped = nt_nwaveout; + } + if (naudioprepped < nt_naudiobuffer) + { + for (j = naudioprepped; j < nt_naudiobuffer; j++) + { + for (i = 0; i < nt_nwavein; i++) + wave_prep(&ntsnd_invec[i][j]); + for (i = 0; i < nt_nwaveout; i++) + wave_prep(&ntsnd_outvec[i][j]); + } + naudioprepped = nt_naudiobuffer; + } for (nad=0; nad < nt_nwavein; nad++) { *************** *** 155,164 **** else { - if (!nt_inalloc[nad]) - { - for (i = 0; i < nt_naudiobuffer; i++) - wave_prep(&ntsnd_invec[nad][i]); - nt_inalloc[nad] = 1; - } for (i = 0; i < nt_naudiobuffer; i++) { --- 179,182 ---- *************** *** 175,184 **** } /* quickly start them all together */ ! for(nad=0; nad < nt_nwavein; nad++) waveInStart(ntsnd_indev[nad]);
! for(nda=0; nda < nt_nwaveout; nda++) ! { ! /* Open a waveform device for output in sucessiv device numbering*/ mmresult = waveOutOpen(&ntsnd_outdev[nda], nt_whichdac + nda, --- 193,201 ---- } /* quickly start them all together */ ! for (nad = 0; nad < nt_nwavein; nad++) waveInStart(ntsnd_indev[nad]);
! for (nda = 0; nda < nt_nwaveout; nda++) ! { /* Open a waveform device for output in sucessiv device numbering*/ mmresult = waveOutOpen(&ntsnd_outdev[nda], nt_whichdac + nda, *************** *** 195,211 **** nt_nwaveout = nda; } - else - { - if (!(nt_outalloc[nda])) - { - for (i = 0; i < nt_naudiobuffer; i++) - { - wave_prep(&ntsnd_outvec[nda][i]); - /* set DONE flag as if we had queued them */ - ntsnd_outvec[nda][i].lpWaveHdr->dwFlags = WHDR_DONE; - } - nt_outalloc[nda] = 1; - } - } }
--- 212,215 ----
Index: s_audio_oss.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio_oss.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** s_audio_oss.c 10 Nov 2003 16:13:11 -0000 1.3 --- s_audio_oss.c 2 Feb 2004 14:31:34 -0000 1.4 *************** *** 477,480 **** --- 477,482 ---- } sys_setalarm(0); + sys_inchannels = inchannels; + sys_outchannels = outchannels; return (0); }
Index: s_inter.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_inter.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** s_inter.c 23 Sep 2003 00:18:14 -0000 1.2 --- s_inter.c 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 521,524 **** --- 521,525 ---- static int sys_watchfd;
+ #ifdef __linux__ void glob_ping(t_pd *dummy) { *************** *** 529,532 **** --- 530,534 ---- } } + #endif
static int defaultfontshit[] = { *************** *** 626,630 **** if (setsockopt(xsock, IPPROTO_TCP, TCP_NODELAY, &intarg, sizeof(intarg)) < 0) ! post("setsockopt (TCP_NODELAY) failed\n"); --- 628,635 ---- if (setsockopt(xsock, IPPROTO_TCP, TCP_NODELAY, &intarg, sizeof(intarg)) < 0) ! #ifndef MSW ! post("setsockopt (TCP_NODELAY) failed\n") ! #endif ! ; *************** *** 733,737 **** /* in MSW land "guipath" is unused; we just do everything from the libdir. */ ! fprintf(stderr, "%s\n", sys_libdir->s_name); strcpy(scriptbuf, """); --- 738,742 ---- /* in MSW land "guipath" is unused; we just do everything from the libdir. */ ! /* fprintf(stderr, "%s\n", sys_libdir->s_name); */ strcpy(scriptbuf, """); *************** *** 832,835 **** --- 837,841 ---- #endif #ifdef MACOSX + if (sys_hipriority) { struct sched_param param; *************** *** 863,868 **** --- 869,876 ----
/* here is where we start the pinging. */ + #ifdef __linux__ if (sys_hipriority) sys_gui("pdtk_watchdog\n"); + #endif sys_get_audio_apis(buf); sys_vgui("pdtk_pd_startup {%s} %s\n", pd_version, buf); *************** *** 884,888 **** }
! /* LATER try to save dirty documents */ void sys_bail(int n) { --- 892,902 ---- }
! /* T.Grill - import clean quit function */ ! extern void sys_exit(void); ! ! /* This is called when something bad has happened, like a segfault. ! Call glob_quit() below to exit cleanly. ! LATER try to save dirty documents even in the bad case. */ ! void sys_bail(int n) { *************** *** 898,902 **** fprintf(stderr, "... done.\n"); #endif ! exit(1); } else _exit(n); --- 912,916 ---- fprintf(stderr, "... done.\n"); #endif ! exit(1); } else _exit(n); *************** *** 907,911 **** --- 921,928 ---- sys_vgui("exit\n"); if (!sys_nogui) + { close(sys_guisock); + sys_rmpollfn(sys_guisock); + } sys_bail(0); }
Index: s_main.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** s_main.c 23 Sep 2003 00:18:14 -0000 1.2 --- s_main.c 2 Feb 2004 14:31:34 -0000 1.3 *************** *** 8,12 **** */
! char pd_version[] = "Pd version 0.37.0\n"; char pd_compiletime[] = __TIME__; char pd_compiledate[] = __DATE__; --- 8,12 ---- */
! char pd_version[] = "Pd version 0.37.1 TEST6 devel\n"; char pd_compiletime[] = __TIME__; char pd_compiledate[] = __DATE__; *************** *** 39,42 **** --- 39,43 ---- int m_scheduler(void); void sys_addhelppath(char *p); + void alsa_adddev(char *name);
int sys_debuglevel; *************** *** 228,233 **** }
! static void sys_addextrapath(void); ! static void sys_addreferencepath(void);
/* this is called from main() in s_entry.c */ --- 229,233 ---- }
! static void sys_afterargparse(void);
/* this is called from main() in s_entry.c */ *************** *** 242,248 **** sys_rcfile(); /* parse the startup file */ #endif ! if (sys_argparse(argc, argv)) return (1); /* parse cmd line */ ! sys_addextrapath(); ! sys_addreferencepath(); if (sys_verbose || sys_version) fprintf(stderr, "%scompiled %s %s\n", pd_version, pd_compiletime, pd_compiledate); --- 242,248 ---- sys_rcfile(); /* parse the startup file */ #endif ! if (sys_argparse(argc, argv)) /* parse cmd line */ ! return (1); ! sys_afterargparse(); /* post-argparse settings */ if (sys_verbose || sys_version) fprintf(stderr, "%scompiled %s %s\n", pd_version, pd_compiletime, pd_compiledate); *************** *** 287,290 **** --- 287,291 ---- #ifdef USEAPI_ALSA "-alsa -- use ALSA audio API\n", + "-alsaadd <name> -- add an ALSA device name to list\n", "-alsadev <n> ----- obsolete: use -audiodev\n", #endif *************** *** 329,334 **** "-guicmd "cmd..." -- substitute another GUI program (e.g., rsh)\n", "-send "msg..." -- send a message at startup (after patches are loaded)\n", ! #ifdef __linux__ ! "-rt or -realtime -- use real-time priority (needs root privilege)\n", #endif }; --- 330,336 ---- "-guicmd "cmd..." -- substitute another GUI program (e.g., rsh)\n", "-send "msg..." -- send a message at startup (after patches are loaded)\n", ! #ifdef UNIX ! "-rt or -realtime -- use real-time priority\n", ! "-nrt -- don't use real-time priority\n", #endif }; *************** *** 459,471 **** }
int sys_argparse(int argc, char **argv) { char sbuf[MAXPDSTRING]; int i; - #ifdef MSW - int mmio = 1; - #else - int mmio = 0; - #endif argc--; argv++; while ((argc > 0) && **argv == '-') --- 461,474 ---- }
+ #ifdef MSW + static int sys_mmio = 1; + #else + static int sys_mmio = 0; + #endif + int sys_argparse(int argc, char **argv) { char sbuf[MAXPDSTRING]; int i; argc--; argv++; while ((argc > 0) && **argv == '-') *************** *** 561,564 **** --- 564,574 ---- argc--; argv++; } + else if (!strcmp(*argv, "-alsaadd")) + { + if (argc > 1) + alsa_adddev(argv[1]); + else goto usage; + argc -= 2; argv +=2; + } /* obsolete flag for setting ALSA device number or name */ else if (!strcmp(*argv, "-alsadev")) *************** *** 594,598 **** { sys_set_audio_api(API_PORTAUDIO); ! mmio = 0; argc--; argv++; } --- 604,608 ---- { sys_set_audio_api(API_PORTAUDIO); ! sys_mmio = 0; argc--; argv++; } *************** *** 602,606 **** { sys_set_audio_api(API_MMIO); ! mmio = 1; argc--; argv++; } --- 612,616 ---- { sys_set_audio_api(API_MMIO); ! sys_mmio = 1; argc--; argv++; } *************** *** 720,723 **** --- 730,738 ---- argc--; argv++; } + else if (!strcmp(*argv, "-nrt")) + { + sys_hipriority = 0; + argc--; argv++; + } #endif else if (!strcmp(*argv, "-soundindev") || *************** *** 763,781 **** sys_openlist = namelist_append(sys_openlist, *argv);
- /* correct to make audio and MIDI device lists zero based. On - MMIO, however, "1" really means the second device (the first one - is "mapper" which is was not included when the command args were - set up, so we leave it that way for compatibility. */ - if (!mmio) - { - for (i = 0; i < sys_nsoundin; i++) - sys_soundindevlist[i]--; - for (i = 0; i < sys_nsoundout; i++) - sys_soundoutdevlist[i]--; - } - for (i = 0; i < sys_nmidiin; i++) - sys_midiindevlist[i]--; - for (i = 0; i < sys_nmidiout; i++) - sys_midioutdevlist[i]--;
return (0); --- 778,781 ---- *************** *** 787,793 **** }
! static void sys_addextrapath(void) { char sbuf[MAXPDSTRING]; /* add "extra" library to path */ strncpy(sbuf, sys_libdir->s_name, MAXPDSTRING-30); --- 787,796 ---- }
! /* stuff to do, once, after calling sys_argparse() -- which may itself ! be called twice because of the .pdrc hack. */ ! static void sys_afterargparse(void) { char sbuf[MAXPDSTRING]; + int i; /* add "extra" library to path */ strncpy(sbuf, sys_libdir->s_name, MAXPDSTRING-30); *************** *** 795,803 **** strcat(sbuf, "/extra"); sys_addpath(sbuf); - } - - static void sys_addreferencepath(void) - { - char sbuf[MAXPDSTRING]; /* add "doc/5.reference" library to helppath */ strncpy(sbuf, sys_libdir->s_name, MAXPDSTRING-30); --- 798,801 ---- *************** *** 805,807 **** --- 803,825 ---- strcat(sbuf, "/doc/5.reference"); sys_addhelppath(sbuf); + /* correct to make audio and MIDI device lists zero based. On + MMIO, however, "1" really means the second device (the first one + is "mapper" which is was not included when the command args were + set up, so we leave it that way for compatibility. */ + if (!sys_mmio) + { + for (i = 0; i < sys_nsoundin; i++) + sys_soundindevlist[i]--; + for (i = 0; i < sys_nsoundout; i++) + sys_soundoutdevlist[i]--; + } + for (i = 0; i < sys_nmidiin; i++) + sys_midiindevlist[i]--; + for (i = 0; i < sys_nmidiout; i++) + sys_midioutdevlist[i]--; + } + + static void sys_addreferencepath(void) + { + char sbuf[MAXPDSTRING]; }
--- build.bat DELETED ---
--- makefile.irix DELETED ---