Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6471
Modified Files: Tag: desiredata s_audio.c Log Message: removed many redundant "audio" inside long variable names
Index: s_audio.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio.c,v retrieving revision 1.5.4.16.2.20.2.17 retrieving revision 1.5.4.16.2.20.2.18 diff -C2 -d -r1.5.4.16.2.20.2.17 -r1.5.4.16.2.20.2.18 *** s_audio.c 9 Jul 2007 22:27:11 -0000 1.5.4.16.2.20.2.17 --- s_audio.c 10 Jul 2007 07:05:59 -0000 1.5.4.16.2.20.2.18 *************** *** 94,103 ****
/* last requested parameters */ ! static int audio_naudioindev = -1; ! static int audio_audioindev[MAXAUDIOINDEV]; ! static int audio_audiochindev[MAXAUDIOINDEV]; ! static int audio_naudiooutdev = -1; ! static int audio_audiooutdev[MAXAUDIOOUTDEV]; ! static int audio_audiochoutdev[MAXAUDIOOUTDEV]; static int audio_rate; static int audio_dacblocksize; --- 94,103 ----
/* last requested parameters */ ! static int audio_nindev = -1; ! static int audio_indev[MAXAUDIOINDEV]; ! static int audio_chindev[MAXAUDIOINDEV]; ! static int audio_noutdev = -1; ! static int audio_outdev[MAXAUDIOOUTDEV]; ! static int audio_choutdev[MAXAUDIOOUTDEV]; static int audio_rate; static int audio_dacblocksize; *************** *** 112,128 **** static int audio_isopen() { return audio_state ! && ((audio_naudioindev > 0 && audio_audiochindev[0] > 0) ! || (audio_naudiooutdev > 0 && audio_audiochoutdev[0] > 0)); }
void sys_get_audio_params( ! int *pnaudioindev, int *paudioindev, int *chindev, ! int *pnaudiooutdev, int *paudiooutdev, int *choutdev, ! 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; --- 112,127 ---- static int audio_isopen() { return audio_state ! && ((audio_nindev > 0 && audio_chindev[0] > 0) ! || (audio_noutdev > 0 && audio_choutdev[0] > 0)); }
void sys_get_audio_params( ! int *pnindev, int *pindev, int *chindev, ! int *pnoutdev, int *poutdev, int *choutdev, ! int *prate, int *pdacblocksize, int *padvance, int *pscheduler) { ! *pnindev = audio_nindev; ! *pnoutdev = audio_noutdev; ! for (int i=0; i<MAXAUDIOINDEV; i++) {pindev[i] = audio_indev[i]; chindev[i] = audio_chindev[i]; } ! for (int i=0; i<MAXAUDIOOUTDEV; i++) {poutdev[i] = audio_outdev[i]; choutdev[i] = audio_choutdev[i];} *prate = audio_rate; *pdacblocksize = audio_dacblocksize; *************** *** 132,142 ****
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; --- 131,141 ----
void sys_save_audio_params( ! int nindev, int *indev, int *chindev, ! int noutdev, int *outdev, int *choutdev, int rate, int dacblocksize, int advance, int scheduler) { ! audio_nindev = nindev; ! audio_noutdev = noutdev; ! for (int i=0; i<MAXAUDIOINDEV; i++) {audio_indev[i] = indev[i]; audio_chindev[i] = chindev[i];} ! for (int i=0; i<MAXAUDIOOUTDEV; i++) {audio_outdev[i] = outdev[i]; audio_choutdev[i] = choutdev[i];} audio_rate = rate; audio_dacblocksize = dacblocksize; *************** *** 198,203 **** extern int sgi_open_audio(int nindev, int *indev, int nchin, int *chin, int noutdev, int *outdev, int nchout, int *chout, int rate); ! void sys_open_audio(int naudioindev, int *audioindev, int nchindev, ! int *chindev, int naudiooutdev, int *audiooutdev, int nchoutdev, int *choutdev, int rate, int dacblocksize, int advance, int schedmode, int enable) { --- 197,202 ---- extern int sgi_open_audio(int nindev, int *indev, int nchin, int *chin, int noutdev, int *outdev, int nchout, int *chout, int rate); ! void sys_open_audio(int nindev, int *indev, int nchindev, ! int *chindev, int noutdev, int *outdev, int nchoutdev, int *choutdev, int rate, int dacblocksize, int advance, int schedmode, int enable) { *************** *** 219,290 **** if (advance <= 0) advance = DEFAULTADVANCE; audio_init(); ! /* Since the channel vector might be longer than the ! 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) { if (indevs >= 1) { nchindev=1; chindev[0] = defaultchannels; ! naudioindev = 1; ! audioindev[0] = DEFAULTAUDIODEV; ! } else naudioindev = nchindev = 0; } else { ! for (int i=0; i<MAXAUDIOINDEV; i++) audioindev[i] = i; ! naudioindev = nchindev; } } else { if (nchindev == -1) { ! nchindev = naudioindev; ! for (int i=0; i<naudioindev; i++) chindev[i] = defaultchannels; ! } else if (nchindev > naudioindev) { ! for (int i=naudioindev; i<nchindev; i++) { ! if (i == 0) audioindev[0] = DEFAULTAUDIODEV; else audioindev[i] = audioindev[i-1] + 1; } ! naudioindev = nchindev; ! } else if (nchindev < naudioindev) { ! for (int i=nchindev; i<naudioindev; i++) { if (i == 0) chindev[0] = defaultchannels; else chindev[i] = chindev[i-1]; } ! naudioindev = nchindev; } } ! if (naudiooutdev == -1) { /* not set */ if (nchoutdev == -1) { if (outdevs >= 1) { nchoutdev=1; choutdev[0]=defaultchannels; ! naudiooutdev=1; ! audiooutdev[0] = DEFAULTAUDIODEV; ! } else nchoutdev = naudiooutdev = 0; } else { ! for (int i=0; i<MAXAUDIOOUTDEV; i++) audiooutdev[i] = i; ! naudiooutdev = nchoutdev; } } else { if (nchoutdev == -1) { ! nchoutdev = naudiooutdev; ! for (int i=0; i<naudiooutdev; i++) choutdev[i] = defaultchannels; ! } else if (nchoutdev > naudiooutdev) { ! for (int i=naudiooutdev; i<nchoutdev; i++) { ! if (i == 0) audiooutdev[0] = DEFAULTAUDIODEV; else audiooutdev[i] = audiooutdev[i-1] + 1; } ! naudiooutdev = nchoutdev; ! } else if (nchoutdev < naudiooutdev) { ! for (int i=nchoutdev; i<naudiooutdev; i++) { if (i == 0) choutdev[0] = defaultchannels; else choutdev[i] = choutdev[i-1]; } ! naudiooutdev = nchoutdev; } } /* count total number of input and output channels */ int inchans=0, outchans=0; ! for (int i=0; i < naudioindev; i++) inchans += (realinchans[i] = (chindev[i] > 0 ? chindev[i] : 0)); ! for (int i=0; i < naudiooutdev; i++) outchans += (realoutchans[i] = (choutdev[i] > 0 ? choutdev[i] : 0)); /* if no input or output devices seem to have been specified, this really means just disable audio, which we now do. */ if (!inchans && !outchans) enable = 0; sys_schedadvance = advance * 1000; - sys_setchsr(inchans, outchans, rate, dacblocksize); sys_log_error(ERR_NOTHING); --- 218,286 ---- if (advance <= 0) advance = DEFAULTADVANCE; audio_init(); ! /* Since the channel vector might be longer than the 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 (nindev == -1) { /* no input audio devices specified */ if (nchindev == -1) { if (indevs >= 1) { nchindev=1; chindev[0] = defaultchannels; ! nindev = 1; ! indev[0] = DEFAULTAUDIODEV; ! } else nindev = nchindev = 0; } else { ! for (int i=0; i<MAXAUDIOINDEV; i++) indev[i] = i; ! nindev = nchindev; } } else { if (nchindev == -1) { ! nchindev = nindev; ! for (int i=0; i<nindev; i++) chindev[i] = defaultchannels; ! } else if (nchindev > nindev) { ! for (int i=nindev; i<nchindev; i++) { ! if (i == 0) indev[0] = DEFAULTAUDIODEV; else indev[i] = indev[i-1] + 1; } ! nindev = nchindev; ! } else if (nchindev < nindev) { ! for (int i=nchindev; i<nindev; i++) { if (i == 0) chindev[0] = defaultchannels; else chindev[i] = chindev[i-1]; } ! nindev = nchindev; } } ! if (noutdev == -1) { /* not set */ if (nchoutdev == -1) { if (outdevs >= 1) { nchoutdev=1; choutdev[0]=defaultchannels; ! noutdev=1; ! outdev[0] = DEFAULTAUDIODEV; ! } else nchoutdev = noutdev = 0; } else { ! for (int i=0; i<MAXAUDIOOUTDEV; i++) outdev[i] = i; ! noutdev = nchoutdev; } } else { if (nchoutdev == -1) { ! nchoutdev = noutdev; ! for (int i=0; i<noutdev; i++) choutdev[i] = defaultchannels; ! } else if (nchoutdev > noutdev) { ! for (int i=noutdev; i<nchoutdev; i++) { ! if (i == 0) outdev[0] = DEFAULTAUDIODEV; else outdev[i] = outdev[i-1] + 1; } ! noutdev = nchoutdev; ! } else if (nchoutdev < noutdev) { ! for (int i=nchoutdev; i<noutdev; i++) { if (i == 0) choutdev[0] = defaultchannels; else choutdev[i] = choutdev[i-1]; } ! noutdev = nchoutdev; } } /* count total number of input and output channels */ int inchans=0, outchans=0; ! for (int i=0; i < nindev; i++) inchans += (realinchans[i] = (chindev[i] > 0 ? chindev[i] : 0)); ! for (int i=0; i < noutdev; i++) outchans += (realoutchans[i] = (choutdev[i] > 0 ? choutdev[i] : 0)); /* if no input or output devices seem to have been specified, this really means just disable audio, which we now do. */ if (!inchans && !outchans) enable = 0; sys_schedadvance = advance * 1000; sys_setchsr(inchans, outchans, rate, dacblocksize); sys_log_error(ERR_NOTHING); *************** *** 294,320 **** if (sys_audioapi == API_PORTAUDIO) pa_open_audio(inchans, outchans, rate, advance, ! (naudiooutdev > 0 ? audioindev[0] : 0), ! (naudiooutdev > 0 ? audiooutdev[0] : 0), schedmode); else #endif #ifdef USEAPI_JACK if (sys_audioapi == API_JACK) ! jack_open_audio((naudioindev > 0 ? realinchans[0] : 0), ! (naudiooutdev > 0 ? realoutchans[0] : 0), rate, schedmode); else #endif if (sys_audioapi == API_OSS || sys_audioapi == API_ALSA || sys_audioapi == API_MMIO) ! sys_audio()->open_audio(naudioindev, audioindev, nchindev, realinchans, naudiooutdev, audiooutdev, nchoutdev, realoutchans, rate, -42); ! else ! if (sys_audioapi == API_SGI) ! sys_audio()->open_audio(naudioindev, audioindev, nchindev, chindev, naudiooutdev, audiooutdev, nchoutdev, choutdev, rate, -42); ! else ! if (sys_audioapi == API_ASIO) ! sys_audio()->open_audio(naudioindev, audioindev, nchindev, chindev, naudiooutdev, audiooutdev, nchoutdev, choutdev, rate, schedmode); ! else ! post("unknown audio API specified"); } ! sys_save_audio_params(naudioindev, audioindev, chindev, naudiooutdev, audiooutdev, choutdev, int(sys_dacsr), ! sys_dacblocksize, advance, schedmode); if (sys_inchannels == 0 && sys_outchannels == 0) enable = 0; audio_state = enable; --- 290,312 ---- if (sys_audioapi == API_PORTAUDIO) pa_open_audio(inchans, outchans, rate, advance, ! (noutdev > 0 ? indev[0] : 0), ! (noutdev > 0 ? outdev[0] : 0), schedmode); else #endif #ifdef USEAPI_JACK if (sys_audioapi == API_JACK) ! jack_open_audio((nindev > 0 ? realinchans[0] : 0), ! (noutdev > 0 ? realoutchans[0] : 0), rate, schedmode); else #endif if (sys_audioapi == API_OSS || sys_audioapi == API_ALSA || sys_audioapi == API_MMIO) ! sys_audio()->open_audio(nindev, indev, nchindev, realinchans, noutdev, outdev, nchoutdev, realoutchans, rate, -42); ! else if (sys_audioapi == API_SGI) ! sys_audio()->open_audio(nindev, indev, nchindev, chindev, noutdev, outdev, nchoutdev, choutdev, rate, -42); ! else if (sys_audioapi == API_ASIO) ! sys_audio()->open_audio(nindev, indev, nchindev, chindev, noutdev, outdev, nchoutdev, choutdev, rate, schedmode); ! else post("unknown audio API specified"); } ! sys_save_audio_params(nindev, indev, chindev, noutdev, outdev, choutdev, int(sys_dacsr), sys_dacblocksize, advance, schedmode); if (sys_inchannels == 0 && sys_outchannels == 0) enable = 0; audio_state = enable; *************** *** 329,333 **** typedmess(pd->s_thing, selector, 1, argv); } - }
--- 321,324 ---- *************** *** 345,356 **** /* open audio using whatever parameters were last used */ void sys_reopen_audio() { ! int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; ! sys_close_audio(); ! sys_get_audio_params(&naudioindev, audioindev, chindev, ! &naudiooutdev, audiooutdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); ! sys_open_audio(naudioindev, audioindev, naudioindev, chindev, ! naudiooutdev, audiooutdev, naudiooutdev, choutdev, rate, dacblocksize, advance, scheduler, 1); }
--- 336,345 ---- /* open audio using whatever parameters were last used */ void sys_reopen_audio() { ! int nindev, indev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int noutdev, outdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; ! sys_close_audio(); ! sys_get_audio_params(&nindev, indev, chindev, &noutdev, outdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); ! sys_open_audio(nindev, indev, nindev, chindev, noutdev, outdev, noutdev, choutdev, rate, dacblocksize, advance, scheduler, 1); }
*************** *** 430,435 **** void glob_audio_properties(t_pd *dummy, t_floatarg flongform) { /* these are the devices you're using: */ ! int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; /* these are all the devices on your system: */ --- 419,424 ---- void glob_audio_properties(t_pd *dummy, t_floatarg flongform) { /* these are the devices you're using: */ ! int nindev, indev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int noutdev, outdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; /* these are all the devices on your system: */ *************** *** 439,451 **** ostringstream indevliststring; for (int i=0; i<nindevs; i++) indevliststring << " {" << (indevlist + i*DEVDESCSIZE) << "}"; ostringstream outdevliststring; for (int i=0; i<noutdevs; i++) outdevliststring << " {" << (outdevlist + i*DEVDESCSIZE) << "}"; ! sys_get_audio_params(&naudioindev,audioindev,chindev,&naudiooutdev,audiooutdev,choutdev,&rate,&dacblocksize,&advance,&scheduler); ! if (naudioindev > 1 || naudiooutdev > 1) flongform = 1; ! ostringstream audioindevs; for (int i=0; i<naudioindev; i++) audioindevs << " " << audioindev [i]; ! ostringstream audiooutdevs; for (int i=0; i<naudiooutdev; i++) audiooutdevs << " " << audiooutdev[i]; ! ostringstream audioinchans; for (int i=0; i<naudioindev; i++) audioinchans << " " << chindev [i]; ! ostringstream audiooutchans; for (int i=0; i<naudiooutdev; i++) audiooutchans << " " << choutdev [i]; sys_vgui("pdtk_audio_dialog {%s} {%s} {%s} {%s} {%s} {%s} %d %d %d %d %d\n", ! indevliststring .str().data()+1, audioindevs.str().data()+1, audioinchans.str().data()+1, ! outdevliststring.str().data()+1, audiooutdevs.str().data()+1, audiooutchans.str().data()+1, rate, dacblocksize, advance, canmulti, flongform!=0); } --- 428,440 ---- ostringstream indevliststring; for (int i=0; i<nindevs; i++) indevliststring << " {" << (indevlist + i*DEVDESCSIZE) << "}"; ostringstream outdevliststring; for (int i=0; i<noutdevs; i++) outdevliststring << " {" << (outdevlist + i*DEVDESCSIZE) << "}"; ! sys_get_audio_params(&nindev,indev,chindev,&noutdev,outdev,choutdev,&rate,&dacblocksize,&advance,&scheduler); ! if (nindev > 1 || noutdev > 1) flongform = 1; ! ostringstream indevs; for (int i=0; i<nindev; i++) indevs << " " << indev [i]; ! ostringstream outdevs; for (int i=0; i<noutdev; i++) outdevs << " " << outdev[i]; ! ostringstream inchans; for (int i=0; i<nindev; i++) inchans << " " << chindev [i]; ! ostringstream outchans; for (int i=0; i<noutdev; i++) outchans << " " << choutdev [i]; sys_vgui("pdtk_audio_dialog {%s} {%s} {%s} {%s} {%s} {%s} %d %d %d %d %d\n", ! indevliststring .str().data()+1, indevs.str().data()+1, inchans.str().data()+1, ! outdevliststring.str().data()+1, outdevs.str().data()+1, outchans.str().data()+1, rate, dacblocksize, advance, canmulti, flongform!=0); } *************** *** 454,458 **** void glob_audio_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) { int nindev=0, noutdev=0; ! int newaudioindev[4], newaudioinchan[4], newaudiooutdev[4], newaudiooutchan[4]; /* the new values the dialog came back with: */ int newrate = atom_getintarg(16, argc, argv); --- 443,447 ---- void glob_audio_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) { int nindev=0, noutdev=0; ! int newindev[4], newinchan[4], newoutdev[4], newoutchan[4]; /* the new values the dialog came back with: */ int newrate = atom_getintarg(16, argc, argv); *************** *** 461,486 **** int newschedmode = atom_getintarg(19, argc, argv); for (int i=0; i<4; i++) { ! newaudioindev[i] = atom_getintarg(i, argc, argv); ! newaudioinchan[i] = atom_getintarg(i+4, argc, argv); ! newaudiooutdev[i] = atom_getintarg(i+8, argc, argv); ! newaudiooutchan[i] = atom_getintarg(i+12, argc, argv); } for (int i=0; i<4; i++) { ! if (newaudioinchan[i]) { ! newaudioindev[nindev] = newaudioindev[i]; ! newaudioinchan[nindev] = newaudioinchan[i]; nindev++; } } for (int i=0; i<4; i++) { ! if (newaudiooutchan[i]) { ! newaudiooutdev[noutdev] = newaudiooutdev[i]; ! newaudiooutchan[noutdev] = newaudiooutchan[i]; noutdev++; } } sys_close_audio(); ! sys_open_audio(nindev, newaudioindev, nindev, newaudioinchan, ! noutdev, newaudiooutdev, noutdev, newaudiooutchan, newrate, newdacblocksize, newadvance, newschedmode, 1); } --- 450,475 ---- int newschedmode = atom_getintarg(19, argc, argv); for (int i=0; i<4; i++) { ! newindev[i] = atom_getintarg(i, argc, argv); ! newinchan[i] = atom_getintarg(i+4, argc, argv); ! newoutdev[i] = atom_getintarg(i+8, argc, argv); ! newoutchan[i] = atom_getintarg(i+12, argc, argv); } for (int i=0; i<4; i++) { ! if (newinchan[i]) { ! newindev[nindev] = newindev[i]; ! newinchan[nindev] = newinchan[i]; nindev++; } } for (int i=0; i<4; i++) { ! if (newoutchan[i]) { ! newoutdev[noutdev] = newoutdev[i]; ! newoutchan[noutdev] = newoutchan[i]; noutdev++; } } sys_close_audio(); ! sys_open_audio(nindev, newindev, nindev, newinchan, ! noutdev, newoutdev, noutdev, newoutchan, newrate, newdacblocksize, newadvance, newschedmode, 1); } *************** *** 504,509 **** void sys_setblocksize(int n) { if (n < 1) n = 1; ! if (n != (1 << ilog2(n))) ! post("warning: adjusting blocksize to power of 2: %d", (n = (1 << ilog2(n)))); sys_blocksize = n; } --- 493,497 ---- void sys_setblocksize(int n) { if (n < 1) n = 1; ! if (n != (1 << ilog2(n))) post("warning: adjusting blocksize to power of 2: %d", (n = (1 << ilog2(n)))); sys_blocksize = n; } *************** *** 521,527 **** sys_audioapi = newapi; /* bash device params back to default */ ! audio_naudioindev = audio_naudiooutdev = 1; ! audio_audioindev[0] = audio_audiooutdev[0] = DEFAULTAUDIODEV; ! audio_audiochindev[0] = audio_audiochoutdev[0] = SYS_DEFAULTCH; } sched_set_using_dacs(0); --- 509,515 ---- sys_audioapi = newapi; /* bash device params back to default */ ! audio_nindev = audio_noutdev = 1; ! audio_indev[0] = audio_outdev[0] = DEFAULTAUDIODEV; ! audio_chindev[0] = audio_choutdev[0] = SYS_DEFAULTCH; } sched_set_using_dacs(0); *************** *** 594,606 **** * supported by vibrez.net { */ void glob_audio_samplerate(t_pd * dummy, t_float f) { ! int naudioindev, audioindev[MAXAUDIOINDEV], audiochindev[MAXAUDIOINDEV]; ! int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], audiochoutdev[MAXAUDIOOUTDEV]; 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(); ! sys_open_audio(naudioindev, audioindev, naudioindev, audiochindev, ! naudiooutdev, audiooutdev, naudiooutdev, audiochoutdev, (int)f, dacblocksize, advance, scheduler, 1); }
--- 582,592 ---- * supported by vibrez.net { */ void glob_audio_samplerate(t_pd * dummy, t_float f) { ! int nindev, indev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int noutdev, outdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; if (f == sys_getsr()) return; ! sys_get_audio_params(&nindev, indev, chindev, &noutdev, outdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); sys_close_audio(); ! sys_open_audio(nindev, indev, nindev, chindev, noutdev, outdev, noutdev, choutdev, (int)f, dacblocksize, advance, scheduler, 1); }
*************** *** 612,649 ****
void glob_audio_delay(t_pd *dummy, t_float f) { ! int naudioindev, audioindev[MAXAUDIOINDEV], audiochindev[MAXAUDIOINDEV]; ! int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], audiochoutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; if ((int)f == audio_advance) return; ! sys_get_audio_params(&naudioindev, audioindev, audiochindev, ! &naudiooutdev, audiooutdev, audiochoutdev, &rate, &dacblocksize, &advance, &scheduler); sys_close_audio(); ! sys_open_audio(naudioindev, audioindev, naudioindev, audiochindev, ! naudiooutdev, audiooutdev, naudiooutdev, audiochoutdev, rate, dacblocksize, (int) f, scheduler, 1); }
void glob_audio_dacblocksize(t_pd * dummy, t_float f) { ! int naudioindev, audioindev[MAXAUDIOINDEV], audiochindev[MAXAUDIOINDEV]; ! int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], audiochoutdev[MAXAUDIOOUTDEV]; 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(); ! sys_open_audio(naudioindev, audioindev, naudioindev, audiochindev, ! naudiooutdev, audiooutdev, naudiooutdev, audiochoutdev, rate, (int)f, advance, scheduler, 1); }
void glob_audio_scheduler(t_pd * dummy, t_float f) { ! int naudioindev, audioindev[MAXAUDIOINDEV], audiochindev[MAXAUDIOINDEV]; ! int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], audiochoutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; if ((int)f == sys_callbackscheduler) return; scheduler = f!=0; ! sys_get_audio_params(&naudioindev, audioindev, audiochindev, ! &naudiooutdev, audiooutdev, audiochoutdev, &rate, &dacblocksize, &advance, &scheduler); sys_close_audio(); ! sys_open_audio(naudioindev, audioindev, naudioindev, audiochindev, ! naudiooutdev, audiooutdev, naudiooutdev, audiochoutdev, rate, dacblocksize, advance, scheduler, 1); if (scheduler != sys_callbackscheduler) { if (scheduler == 1) { --- 598,629 ----
void glob_audio_delay(t_pd *dummy, t_float f) { ! int nindev, indev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int noutdev, outdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; if ((int)f == audio_advance) return; ! sys_get_audio_params(&nindev, indev, chindev, &noutdev, outdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); sys_close_audio(); ! sys_open_audio(nindev, indev, nindev, chindev, noutdev, outdev, noutdev, choutdev, rate, dacblocksize, (int) f, scheduler, 1); }
void glob_audio_dacblocksize(t_pd * dummy, t_float f) { ! int nindev, indev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int noutdev, outdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; if ((int)f == audio_dacblocksize) return; ! sys_get_audio_params(&nindev, indev, chindev, &noutdev, outdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); sys_close_audio(); ! sys_open_audio(nindev, indev, nindev, chindev, noutdev, outdev, noutdev, choutdev, rate, (int)f, advance, scheduler, 1); }
void glob_audio_scheduler(t_pd * dummy, t_float f) { ! int nindev, indev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int noutdev, outdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; if ((int)f == sys_callbackscheduler) return; scheduler = f!=0; ! sys_get_audio_params(&nindev, indev, chindev, &noutdev, outdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); sys_close_audio(); ! sys_open_audio(nindev, indev, nindev, chindev, noutdev, outdev, noutdev, choutdev, rate, dacblocksize, advance, scheduler, 1); if (scheduler != sys_callbackscheduler) { if (scheduler == 1) { *************** *** 656,705 ****
void glob_audio_device(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) { ! int naudioindev, audioindev[MAXAUDIOINDEV], audiochindev[MAXAUDIOINDEV]; ! int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], audiochoutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; ! sys_get_audio_params(&naudioindev, audioindev, audiochindev, ! &naudiooutdev, audiooutdev, audiochoutdev, &rate, &dacblocksize, &advance, &scheduler); ! naudiooutdev = naudioindev = (int)atom_getfloatarg(0, argc, argv); for (int i=0; i<MAXAUDIOINDEV; i++) { ! audiooutdev [i] = audioindev [i] = int(atom_getfloatarg(i*2+1, argc, argv)); ! audiochoutdev[i] = audiochindev[i] = int(atom_getfloatarg(i*2+2, argc, argv)); } sys_close_audio(); ! sys_open_audio(naudioindev, audioindev, naudioindev, audiochindev, ! naudiooutdev, audiooutdev, naudiooutdev, audiochoutdev, rate, dacblocksize, advance, scheduler, 1); }
void glob_audio_device_in(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) { ! int naudioindev, audioindev[MAXAUDIOINDEV], audiochindev[MAXAUDIOINDEV]; ! int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], audiochoutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; ! sys_get_audio_params(&naudioindev, audioindev, audiochindev, ! &naudiooutdev, audiooutdev, audiochoutdev, &rate, &dacblocksize, &advance, &scheduler); ! naudioindev = (int)atom_getfloatarg(0, argc, argv); for (int i=0; i<MAXAUDIOINDEV; i=i+2) { ! audioindev [i] = atom_getintarg(i+1, argc, argv); ! audiochindev[i] = atom_getintarg(i+2, argc, argv); } sys_close_audio(); ! sys_open_audio(naudioindev, audioindev, naudioindev, audiochindev, ! naudiooutdev, audiooutdev, naudiooutdev, audiochoutdev, rate, dacblocksize, advance, scheduler, 1); }
void glob_audio_device_out(t_pd * dummy, t_symbol *s, int argc, t_atom *argv) { ! int naudioindev, audioindev[MAXAUDIOINDEV], audiochindev[MAXAUDIOINDEV]; ! int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], audiochoutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; ! sys_get_audio_params(&naudioindev, audioindev, audiochindev, ! &naudiooutdev, audiooutdev, audiochoutdev, &rate, &dacblocksize, &advance, &scheduler); ! naudiooutdev = (int)atom_getfloatarg(0, argc, argv); /* i+=2 ? isn't that a bug??? */ for (int i=0; i<MAXAUDIOOUTDEV; i+=2) { ! audiooutdev [i] = atom_getintarg(i+1, argc, argv); ! audiochoutdev[i] = atom_getintarg(i+2, argc, argv); } sys_close_audio(); ! sys_open_audio(naudioindev, audioindev, naudioindev, audiochindev, ! naudiooutdev, audiooutdev, naudiooutdev, audiochoutdev, rate, dacblocksize, advance, scheduler, 1); }
--- 636,679 ----
void glob_audio_device(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) { ! int nindev, indev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int noutdev, outdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; ! sys_get_audio_params(&nindev, indev, chindev, &noutdev, outdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); ! noutdev = nindev = (int)atom_getfloatarg(0, argc, argv); for (int i=0; i<MAXAUDIOINDEV; i++) { ! outdev [i] = indev [i] = int(atom_getfloatarg(i*2+1, argc, argv)); ! choutdev[i] = chindev[i] = int(atom_getfloatarg(i*2+2, argc, argv)); } sys_close_audio(); ! sys_open_audio(nindev, indev, nindev, chindev, noutdev, outdev, noutdev, choutdev, rate, dacblocksize, advance, scheduler, 1); }
void glob_audio_device_in(t_pd *dummy, t_symbol *s, int argc, t_atom *argv) { ! int nindev, indev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int noutdev, outdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; ! sys_get_audio_params(&nindev, indev, chindev, &noutdev, outdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); ! nindev = (int)atom_getfloatarg(0, argc, argv); for (int i=0; i<MAXAUDIOINDEV; i=i+2) { ! indev [i] = atom_getintarg(i+1, argc, argv); ! chindev[i] = atom_getintarg(i+2, argc, argv); } sys_close_audio(); ! sys_open_audio(nindev, indev, nindev, chindev, noutdev, outdev, noutdev, choutdev, rate, dacblocksize, advance, scheduler, 1); }
void glob_audio_device_out(t_pd * dummy, t_symbol *s, int argc, t_atom *argv) { ! int nindev, indev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int noutdev, outdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; ! sys_get_audio_params(&nindev, indev, chindev, &noutdev, outdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); ! noutdev = (int)atom_getfloatarg(0, argc, argv); /* i+=2 ? isn't that a bug??? */ for (int i=0; i<MAXAUDIOOUTDEV; i+=2) { ! outdev [i] = atom_getintarg(i+1, argc, argv); ! choutdev[i] = atom_getintarg(i+2, argc, argv); } sys_close_audio(); ! sys_open_audio(nindev, indev, nindev, chindev, noutdev, outdev, noutdev, choutdev, rate, dacblocksize, advance, scheduler, 1); }
*************** *** 713,718 **** void glob_audio_getaudioindevices(t_pd * dummy, t_symbol *s, int ac, t_atom *av) { /* these are the devices you're using: */ ! int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; /* these are all the devices on your system: */ --- 687,692 ---- void glob_audio_getaudioindevices(t_pd * dummy, t_symbol *s, int ac, t_atom *av) { /* these are the devices you're using: */ ! int nindev, indev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int noutdev, outdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; /* these are all the devices on your system: */ *************** *** 724,729 **** t_symbol *pd = gensym("pd"); audio_getdevs(indevlist, &nindevs, outdevlist, &noutdevs, &canmulti, MAXNDEV, DEVDESCSIZE); ! sys_get_audio_params(&naudioindev, audioindev, chindev, &naudiooutdev, ! audiooutdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); if (f < 0) { for (int i=0; i<nindevs ;++i) SETSTRING(argv+i,indevlist + i * DEVDESCSIZE); --- 698,702 ---- t_symbol *pd = gensym("pd"); audio_getdevs(indevlist, &nindevs, outdevlist, &noutdevs, &canmulti, MAXNDEV, DEVDESCSIZE); ! sys_get_audio_params(&nindev, indev, chindev, &noutdev, outdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); if (f < 0) { for (int i=0; i<nindevs ;++i) SETSTRING(argv+i,indevlist + i * DEVDESCSIZE); *************** *** 737,742 **** void glob_audio_getaudiooutdevices(t_pd * dummy, t_symbol *s, int ac, t_atom *av) { /* these are the devices you're using: */ ! int naudioindev, audioindev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; /* these are all the devices on your system: */ --- 710,715 ---- void glob_audio_getaudiooutdevices(t_pd * dummy, t_symbol *s, int ac, t_atom *av) { /* these are the devices you're using: */ ! int nindev, indev[MAXAUDIOINDEV], chindev[MAXAUDIOINDEV]; ! int noutdev, outdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV]; int rate, dacblocksize, advance, scheduler; /* these are all the devices on your system: */ *************** *** 748,753 **** t_symbol * pd = gensym("pd"); audio_getdevs(indevlist, &nindevs, outdevlist, &noutdevs, &canmulti, MAXNDEV, DEVDESCSIZE); ! sys_get_audio_params(&naudioindev, audioindev, chindev, &naudiooutdev, ! audiooutdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); if (f < 0) { int i; --- 721,725 ---- t_symbol * pd = gensym("pd"); audio_getdevs(indevlist, &nindevs, outdevlist, &noutdevs, &canmulti, MAXNDEV, DEVDESCSIZE); ! sys_get_audio_params(&nindev, indev, chindev, &noutdev, outdev, choutdev, &rate, &dacblocksize, &advance, &scheduler); if (f < 0) { int i;