Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4479
Modified Files:
Tag: desiredata
s_audio.c desire.tk
Log Message:
simplify pdtk_audio_dialog
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.210
retrieving revision 1.1.2.600.2.211
diff -C2 -d -r1.1.2.600.2.210 -r1.1.2.600.2.211
*** desire.tk 9 Jul 2007 20:10:02 -0000 1.1.2.600.2.210
--- desire.tk 9 Jul 2007 20:17:39 -0000 1.1.2.600.2.211
***************
*** 7292,7305 ****
}
! proc pdtk_audio_dialog {id indevlist indev1 indev2 indev3 indev4 \
! inchan1 inchan2 inchan3 inchan4 \
! outdevlist outdev1 outdev2 outdev3 outdev4 \
! outchan1 outchan2 outchan3 outchan4 \
! sr dspblock advance multi longform} {
! pdrc audio_properties $indevlist [list $indev1 $indev2 $indev3 $indev4] \
! [list $inchan1 $inchan2 $inchan3 $inchan4] \
! $outdevlist [list $outdev1 $outdev2 $outdev3 $outdev4] \
! [list $outchan1 $outchan2 $outchan3 $outchan4] $sr $dspblock \
! $advance $multi
}
--- 7292,7297 ----
}
! proc pdtk_audio_dialog {indevlist indevs inchans outdevlist outdevs outchans sr dspblock advance multi longform} {
! pdrc audio_properties $indevlist $indevs $inchans $outdevlist $outdevs $outchans $sr $dspblock $advance $multi
}
Index: s_audio.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_audio.c,v
retrieving revision 1.5.4.16.2.20.2.13
retrieving revision 1.5.4.16.2.20.2.14
diff -C2 -d -r1.5.4.16.2.20.2.13 -r1.5.4.16.2.20.2.14
*** s_audio.c 9 Jul 2007 17:41:02 -0000 1.5.4.16.2.20.2.13
--- s_audio.c 9 Jul 2007 20:17:39 -0000 1.5.4.16.2.20.2.14
***************
*** 4,8 ****
/* machine-independent (well, mostly!) audio layer. Stores and recalls
! audio settings from argparse routine and from dialog window.
*/
--- 4,8 ----
/* machine-independent (well, mostly!) audio layer. Stores and recalls
! audio settings from argparse routine and from dialog window.
*/
***************
*** 25,29 ****
typedef long t_pa_sample;
#define SYS_SAMPLEWIDTH sizeof(t_pa_sample)
! #define SYS_BYTESPERCHAN (sys_dacblocksize * SYS_SAMPLEWIDTH)
#define SYS_XFERSAMPS (SYS_DEFAULTCH*sys_dacblocksize)
#define SYS_XFERSIZE (SYS_SAMPLEWIDTH * SYS_XFERSAMPS)
--- 25,29 ----
typedef long t_pa_sample;
#define SYS_SAMPLEWIDTH sizeof(t_pa_sample)
! #define SYS_BYTESPERCHAN (sys_dacblocksize * SYS_SAMPLEWIDTH)
#define SYS_XFERSAMPS (SYS_DEFAULTCH*sys_dacblocksize)
#define SYS_XFERSIZE (SYS_SAMPLEWIDTH * SYS_XFERSAMPS)
***************
*** 61,67 ****
}
! 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,
--- 61,66 ----
}
! 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,
***************
*** 109,115 ****
static int audio_isopen(void) {
! return (audio_state &&
! ((audio_naudioindev > 0 && audio_audiochindev[0] > 0)
! || (audio_naudiooutdev > 0 && audio_audiochoutdev[0] > 0)));
}
--- 108,114 ----
static int audio_isopen(void) {
! return audio_state
! && ((audio_naudioindev > 0 && audio_audiochindev[0] > 0)
! || (audio_naudiooutdev > 0 && audio_audiochoutdev[0] > 0));
}
***************
*** 119,127 ****
int *prate, int *pdacblocksize, int *padvance, int *pscheduler)
{
- int i;
*pnaudioindev = audio_naudioindev;
*pnaudiooutdev = audio_naudiooutdev;
! for (i = 0; i < MAXAUDIOINDEV; i++) paudioindev[i] = audio_audioindev[i], chindev[i] = audio_audiochindev[i];
! for (i = 0; i < MAXAUDIOOUTDEV; i++) paudiooutdev[i] = audio_audiooutdev[i], choutdev[i] = audio_audiochoutdev[i];
*prate = audio_rate;
*pdacblocksize = audio_dacblocksize;
--- 118,125 ----
int *prate, int *pdacblocksize, int *padvance, int *pscheduler)
{
*pnaudioindev = audio_naudioindev;
*pnaudiooutdev = audio_naudiooutdev;
! for (int i=0; i<MAXAUDIOINDEV; i++) {paudioindev[i] = audio_audioindev[i]; chindev[i] = audio_audiochindev[i]; }
! for (int i=0; i<MAXAUDIOOUTDEV; i++) {paudiooutdev[i] = audio_audiooutdev[i]; choutdev[i] = audio_audiochoutdev[i];}
*prate = audio_rate;
*pdacblocksize = audio_dacblocksize;
***************
*** 131,143 ****
void sys_save_audio_params(
! int naudioindev, int *audioindev, int *chindev,
! int naudiooutdev, int *audiooutdev, int *choutdev,
! int rate, int dacblocksize, int advance, int scheduler)
! {
! int i;
audio_naudioindev = naudioindev;
audio_naudiooutdev = naudiooutdev;
! for (i = 0; i < MAXAUDIOINDEV; i++) audio_audioindev[i] = audioindev[i], audio_audiochindev[i] = chindev[i];
! for (i = 0; i < MAXAUDIOOUTDEV; i++) audio_audiooutdev[i] = audiooutdev[i], audio_audiochoutdev[i] = choutdev[i];
audio_rate = rate;
audio_dacblocksize = dacblocksize;
--- 129,139 ----
void sys_save_audio_params(
! int naudioindev, int *audioindev, int *chindev,
! int naudiooutdev, int *audiooutdev, int *choutdev,
! int rate, int dacblocksize, int advance, int scheduler) {
audio_naudioindev = naudioindev;
audio_naudiooutdev = naudiooutdev;
! for (int i=0; i<MAXAUDIOINDEV; i++) audio_audioindev[i] = audioindev[i], audio_audiochindev[i] = chindev[i];
! for (int i=0; i<MAXAUDIOOUTDEV; i++) audio_audiooutdev[i] = audiooutdev[i], audio_audiochoutdev[i] = choutdev[i];
audio_rate = rate;
audio_dacblocksize = dacblocksize;
***************
*** 152,157 ****
#endif
! static void audio_init( void)
! {
static int initted = 0;
if (initted)
--- 148,152 ----
#endif
! static void audio_init() {
static int initted = 0;
if (initted)
***************
*** 161,165 ****
oss_init();
#endif
! }
/* set channels and sample rate. */
--- 156,160 ----
oss_init();
#endif
! }
/* set channels and sample rate. */
***************
*** 217,221 ****
int indevs = 0, outdevs = 0, canmulti = 0;
audio_getdevs(indevlist, &indevs, outdevlist, &outdevs, &canmulti, MAXNDEV, DEVDESCSIZE);
!
/* jsarlo { (*/
if (sys_externalschedlib) return;
--- 212,216 ----
int indevs = 0, outdevs = 0, canmulti = 0;
audio_getdevs(indevlist, &indevs, outdevlist, &outdevs, &canmulti, MAXNDEV, DEVDESCSIZE);
!
/* jsarlo { (*/
if (sys_externalschedlib) return;
***************
*** 231,235 ****
audio device vector, or vice versa, we fill the shorter one
in to match the longer one. Also, if both are empty, we fill in
! one device (the default) and two channels. */
if (naudioindev == -1) { /* no input audio devices specified */
if (nchindev == -1) {
--- 226,230 ----
audio device vector, or vice versa, we fill the shorter one
in to match the longer one. Also, if both are empty, we fill in
! one device (the default) and two channels. */
if (naudioindev == -1) { /* no input audio devices specified */
if (nchindev == -1) {
***************
*** 306,310 ****
#ifdef USEAPI_PORTAUDIO
if (sys_audioapi == API_PORTAUDIO)
! pa_open_audio(inchans, outchans, rate, advance,
(naudiooutdev > 0 ? audioindev[0] : 0),
(naudiooutdev > 0 ? audiooutdev[0] : 0), schedmode);
--- 301,305 ----
#ifdef USEAPI_PORTAUDIO
if (sys_audioapi == API_PORTAUDIO)
! pa_open_audio(inchans, outchans, rate, advance,
(naudiooutdev > 0 ? audioindev[0] : 0),
(naudiooutdev > 0 ? audiooutdev[0] : 0), schedmode);
***************
*** 312,316 ****
#endif
#ifdef USEAPI_JACK
! if (sys_audioapi == API_JACK)
jack_open_audio((naudioindev > 0 ? realinchans[0] : 0),
(naudiooutdev > 0 ? realoutchans[0] : 0), rate, schedmode);
--- 307,311 ----
#endif
#ifdef USEAPI_JACK
! if (sys_audioapi == API_JACK)
jack_open_audio((naudioindev > 0 ? realinchans[0] : 0),
(naudiooutdev > 0 ? realoutchans[0] : 0), rate, schedmode);
***************
*** 495,509 ****
audiooutchan3 = (naudiooutdev > 2 ? choutdev[2] : 0);
audiooutchan4 = (naudiooutdev > 3 ? choutdev[3] : 0);
! sys_vgui("pdtk_audio_dialog %%s \
! %s %d %d %d %d %d %d %d %d \
! %s %d %d %d %d %d %d %d %d \
! %d %d %d %d %d\n",
! indevliststring,
! audioindev1, audioindev2, audioindev3, audioindev4,
! audioinchan1, audioinchan2, audioinchan3, audioinchan4,
! outdevliststring,
! audiooutdev1, audiooutdev2, audiooutdev3, audiooutdev4,
! audiooutchan1, audiooutchan2, audiooutchan3, audiooutchan4,
! rate, dacblocksize, advance, canmulti, (flongform != 0));
}
--- 490,497 ----
audiooutchan3 = (naudiooutdev > 2 ? choutdev[2] : 0);
audiooutchan4 = (naudiooutdev > 3 ? choutdev[3] : 0);
! sys_vgui("pdtk_audio_dialog %s {%d %d %d %d} {%d %d %d %d} %s {%d %d %d %d} {%d %d %d %d} %d %d %d %d %d\n",
! indevliststring, audioindev1, audioindev2, audioindev3, audioindev4, audioinchan1, audioinchan2, audioinchan3, audioinchan4,
! outdevliststring, audiooutdev1, audiooutdev2, audiooutdev3, audiooutdev4, audiooutchan1, audiooutchan2, audiooutchan3, audiooutchan4,
! rate, dacblocksize, advance, canmulti, flongform!=0);
}
***************
*** 655,659 ****
int rate, dacblocksize, advance, scheduler;
if (f == sys_getsr()) return;
! sys_get_audio_params(&naudioindev, audioindev, audiochindev,
&naudiooutdev, audiooutdev, audiochoutdev, &rate, &dacblocksize, &advance, &scheduler);
sys_close_audio();
--- 643,647 ----
int rate, dacblocksize, advance, scheduler;
if (f == sys_getsr()) return;
! sys_get_audio_params(&naudioindev, audioindev, audiochindev,
&naudiooutdev, audiooutdev, audiochoutdev, &rate, &dacblocksize, &advance, &scheduler);
sys_close_audio();
***************
*** 685,689 ****
int rate, dacblocksize, advance, scheduler;
if ((int)f == audio_dacblocksize) return;
! sys_get_audio_params(&naudioindev, audioindev, audiochindev,
&naudiooutdev, audiooutdev, audiochoutdev, &rate, &dacblocksize, &advance, &scheduler);
sys_close_audio();
--- 673,677 ----
int rate, dacblocksize, advance, scheduler;
if ((int)f == audio_dacblocksize) return;
! sys_get_audio_params(&naudioindev, audioindev, audiochindev,
&naudiooutdev, audiooutdev, audiochoutdev, &rate, &dacblocksize, &advance, &scheduler);
sys_close_audio();