Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27536
Modified Files: Tag: desiredata s_main.c Log Message: cleanup
Index: s_main.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_main.c,v retrieving revision 1.7.4.17.2.22.2.22 retrieving revision 1.7.4.17.2.22.2.23 diff -C2 -d -r1.7.4.17.2.22.2.22 -r1.7.4.17.2.22.2.23 *** s_main.c 10 Jul 2007 16:36:03 -0000 1.7.4.17.2.22.2.22 --- s_main.c 11 Jul 2007 19:49:18 -0000 1.7.4.17.2.22.2.23 *************** *** 47,51 **** #endif /* THREDED_SF */
! char pd_version[] = "DesireData 2007.06.30"; char pd_compiletime[] = __TIME__; char pd_compiledate[] = __DATE__; --- 47,51 ---- #endif /* THREDED_SF */
! char pd_version[] = "DesireData 2007.07.11"; char pd_compiletime[] = __TIME__; char pd_compiledate[] = __DATE__; *************** *** 87,101 **** /* } jsarlo */
- /* IOhannes { */ ! ! /* here the "-1" counts signify that the corresponding vector hasn't been ! specified in command line arguments; sys_open_audio will detect this ! and fill things in. */ static int sys_nsoundin = -1; static int sys_nsoundout = -1; static int sys_soundindevlist[MAXAUDIOINDEV]; static int sys_soundoutdevlist[MAXAUDIOOUTDEV]; - static int sys_nchin = -1; static int sys_nchout = -1; --- 87,97 ---- /* } jsarlo */
/* IOhannes { */ ! /* here the "-1" counts signify that the corresponding vector hasn't been ! specified in command line arguments; sys_open_audio will detect this and fill things in. */ static int sys_nsoundin = -1; static int sys_nsoundout = -1; static int sys_soundindevlist[MAXAUDIOINDEV]; static int sys_soundoutdevlist[MAXAUDIOOUTDEV]; static int sys_nchin = -1; static int sys_nchout = -1; *************** *** 106,110 **** /* jsarlo { */ t_sample* get_sys_soundout() { return sys_soundout; } ! t_sample* get_sys_soundin() { return sys_soundin; } int* get_sys_main_advance() { return &sys_main_advance; } double* get_sys_time_per_dsp_tick() { return &sys_time_per_dsp_tick; } --- 102,106 ---- /* jsarlo { */ t_sample* get_sys_soundout() { return sys_soundout; } ! t_sample* get_sys_soundin() { return sys_soundin; } int* get_sys_main_advance() { return &sys_main_advance; } double* get_sys_time_per_dsp_tick() { return &sys_time_per_dsp_tick; } *************** *** 124,128 **** int noprefs = 0, i; class_table = hash_new(127); - /* jsarlo { */ sys_externalschedlib = 0; --- 120,123 ---- *************** *** 289,307 **** };
! static void sys_parsedevlist(int *np, int *vecp, int max, char *str) ! { int n = 0; ! while (n < max) ! { if (!*str) break; ! else ! { char *endp; vecp[n] = strtol(str, &endp, 10); ! if (endp == str) ! break; n++; ! if (!endp) ! break; str = endp + 1; } --- 284,297 ---- };
! static void sys_parsedevlist(int *np, int *vecp, int max, char *str) { int n = 0; ! while (n < max) { if (!*str) break; ! else { char *endp; vecp[n] = strtol(str, &endp, 10); ! if (endp == str) break; n++; ! if (!endp) break; str = endp + 1; } *************** *** 310,319 **** }
! /* this routine tries to figure out where to find the auxilliary files ! Pd will need to run. This is either done by looking at the command line ! invokation for Pd, or if that fails, by consulting the variable ! INSTALL_PREFIX. In MSW, we don't try to use INSTALL_PREFIX. */ ! void sys_findprogdir(char *progname) ! { char sbuf[MAXPDSTRING], sbuf2[MAXPDSTRING]; char *lastslash; --- 300,311 ---- }
! #ifndef INSTALL_PREFIX ! #define INSTALL_PREFIX "." ! #endif ! ! /* this routine tries to figure out where to find the auxilliary files Pd will need to run. ! This is either done by looking at the command line invokation for Pd, or if that fails, ! by consulting the variable INSTALL_PREFIX. In MSW, we don't try to use INSTALL_PREFIX. */ ! void sys_findprogdir(char *progname) { char sbuf[MAXPDSTRING], sbuf2[MAXPDSTRING]; char *lastslash; *************** *** 321,325 **** struct stat statbuf; #endif - /* find out by what string Pd was invoked; put answer in "sbuf". */ #ifdef MSW --- 313,316 ---- *************** *** 333,376 **** #endif lastslash = strrchr(sbuf, '/'); ! if (lastslash) ! { ! /* bash last slash to zero so that sbuf is directory pd was in, ! e.g., ~/pd/bin */ *lastslash = 0; ! /* go back to the parent from there, e.g., ~/pd */ lastslash = strrchr(sbuf, '/'); ! if (lastslash) ! { strncpy(sbuf2, sbuf, lastslash-sbuf); sbuf2[lastslash-sbuf] = 0; ! } ! else strcpy(sbuf2, ".."); ! } ! else ! { ! /* no slashes found. Try INSTALL_PREFIX. */ ! #ifdef INSTALL_PREFIX strcpy(sbuf2, INSTALL_PREFIX); - #else - strcpy(sbuf2, "."); - #endif } ! /* now we believe sbuf2 holds the parent directory of the directory ! pd was found in. We now want to infer the "lib" directory and the ! "gui" directory. In "simple" unix installations, the layout is .../bin/pd .../bin/pd-gui .../doc ! and in "complicated" unix installations, it's: .../bin/pd .../lib/pd/bin/pd-gui .../lib/pd/doc ! To decide which, we stat .../lib/pd; if that exists, we assume it's ! the complicated layout. In MSW, it's the "simple" layout, but ! the gui program is straight wish80: .../bin/pd .../bin/wish80.exe .../doc ! */ #ifdef MSW sys_libdir = gensym(sbuf2); --- 324,356 ---- #endif lastslash = strrchr(sbuf, '/'); ! if (lastslash) { ! /* bash last slash to zero so that sbuf is directory pd was in, e.g., ~/pd/bin */ *lastslash = 0; ! /* go back to the parent from there, e.g., ~/pd */ lastslash = strrchr(sbuf, '/'); ! if (lastslash) { strncpy(sbuf2, sbuf, lastslash-sbuf); sbuf2[lastslash-sbuf] = 0; ! } else strcpy(sbuf2, ".."); ! } else { /* no slashes found. Try INSTALL_PREFIX. */ strcpy(sbuf2, INSTALL_PREFIX); } ! /* now we believe sbuf2 holds the parent directory of the directory ! pd was found in. We now want to infer the "lib" directory and the ! "gui" directory. In "simple" unix installations, the layout is .../bin/pd .../bin/pd-gui .../doc ! and in "complicated" unix installations, it's: .../bin/pd .../lib/pd/bin/pd-gui .../lib/pd/doc ! To decide which, we stat .../lib/pd; if that exists, we assume it's ! the complicated layout. In MSW, it's the "simple" layout, but ! the gui program is straight wish80: .../bin/pd .../bin/wish80.exe .../doc ! */ #ifdef MSW sys_libdir = gensym(sbuf2); *************** *** 633,637 **** static void sys_afterargparse() { char sbuf[MAXPDSTRING]; - int i; t_audiodevs audio_in, audio_out; int nchindev, nchoutdev, rate, dacblksize, advance, scheduler; --- 613,616 ---- *************** *** 659,663 **** for (int i=0; i<sys_nmidiout; i++) sys_midioutdevlist[i]--; if (sys_listplease) sys_listdevs(); - /* get the current audio parameters. These are set by the preferences mechanism (sys_loadpreferences()) or else are the default. Overwrite them with any results of argument parsing, and store them again. */ --- 638,641 ---- *************** *** 665,674 **** nchindev = sys_nchin>=0 ? sys_nchin : audio_in.ndev; nchoutdev = sys_nchout>=0 ? sys_nchout : audio_out.ndev; ! if (sys_nchin >=0) {for (i=0; i< nchindev; i++) audio_in.chdev[i] = sys_chinlist[i];} ! if (sys_nchout>=0) {for (i=0; i< nchoutdev; i++) audio_out.chdev[i] = sys_choutlist[i];} ! if (sys_nsoundin>=0) {audio_in.ndev = sys_nsoundin; for (i=0; i< audio_in.ndev; i++) audio_in.dev[i] = sys_soundindevlist[i];} ! if (sys_nsoundout>=0) {audio_out.ndev = sys_nsoundout;for (i=0; i<audio_out.ndev; i++) audio_out.dev[i] = sys_soundoutdevlist[i];} ! if (sys_nmidiin >=0) {nmidiindev = sys_nmidiin; for (i=0; i< nmidiindev; i++) midiindev[i] = sys_midiindevlist[i];} ! if (sys_nmidiout>=0) {nmidioutdev = sys_nmidiout; for (i=0; i< nmidioutdev; i++) midioutdev[i] = sys_midioutdevlist[i];} if (sys_main_advance) advance = sys_main_advance; if (sys_main_srate) rate = sys_main_srate; --- 643,652 ---- nchindev = sys_nchin>=0 ? sys_nchin : audio_in.ndev; nchoutdev = sys_nchout>=0 ? sys_nchout : audio_out.ndev; ! if (sys_nchin >=0) {for (int i=0; i< nchindev; i++) audio_in.chdev[i] = sys_chinlist[i];} ! if (sys_nchout>=0) {for (int i=0; i<nchoutdev; i++) audio_out.chdev[i] = sys_choutlist[i];} ! if (sys_nsoundin>=0) {audio_in.ndev = sys_nsoundin; for (int i=0; i< audio_in.ndev; i++) audio_in.dev[i] = sys_soundindevlist[i];} ! if (sys_nsoundout>=0) {audio_out.ndev = sys_nsoundout;for (int i=0; i<audio_out.ndev; i++) audio_out.dev[i] = sys_soundoutdevlist[i];} ! if (sys_nmidiin >=0) {nmidiindev = sys_nmidiin; for (int i=0; i< nmidiindev; i++) midiindev[i] = sys_midiindevlist[i];} ! if (sys_nmidiout>=0) {nmidioutdev = sys_nmidiout; for (int i=0; i< nmidioutdev; i++) midioutdev[i] = sys_midioutdevlist[i];} if (sys_main_advance) advance = sys_main_advance; if (sys_main_srate) rate = sys_main_srate;