From 2eddc4f3b950b4f395cd2314c2dabc02648fe984 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Sat, 30 May 2009 03:05:51 +0000 Subject: reformat and rename svn path=/trunk/; revision=11576 --- desiredata/src/s_audio.c | 77 ++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 45 deletions(-) (limited to 'desiredata/src') diff --git a/desiredata/src/s_audio.c b/desiredata/src/s_audio.c index f8fddcdc..bc62e449 100644 --- a/desiredata/src/s_audio.c +++ b/desiredata/src/s_audio.c @@ -105,9 +105,9 @@ static float (*peak_fp)(t_float*, t_int, t_float) = peakvec; static int audio_isopen() {return audio_state && ((audi.ndev > 0 && audi.chdev[0] > 0) || (audo.ndev > 0 && audo.chdev[0] > 0));} -extern "C" void sys_get_audio_params(t_audiodevs *in, t_audiodevs *out, int *prate, int *pdacblocksize, int *padvance, int *pscheduler) { - in->ndev =audi.ndev; for (int i=0; idev[i] = audi.dev[i]; in->chdev[i]=audi.chdev[i];} - out->ndev=audo.ndev; for (int i=0; idev[i] = audo.dev[i]; out->chdev[i]=audo.chdev[i];} +extern "C" void sys_get_audio_params(t_audiodevs *ai, t_audiodevs *ao, int *prate, int *pdacblocksize, int *padvance, int *pscheduler) { + ai->ndev=audi.ndev; for (int i=0; i< MAXAUDIOINDEV; i++) {ai->dev[i] = audi.dev[i]; ai->chdev[i]=audi.chdev[i];} + ao->ndev=audo.ndev; for (int i=0; idev[i] = audo.dev[i]; ao->chdev[i]=audo.chdev[i];} *prate = audio_rate; *pdacblocksize = audio_dacblocksize; *padvance = audio_advance; @@ -128,8 +128,8 @@ int rate, int dacblocksize, int advance, int scheduler) { audio_scheduler = scheduler; } -extern "C" void sys_open_audio2(t_audiodevs *in, t_audiodevs *out, int rate, int dacblocksize, int advance, int scheduler) { - sys_open_audio(in->ndev,in->dev,in->ndev,in->chdev,out->ndev,out->dev,out->ndev,out->chdev,rate,dacblocksize,advance,scheduler,1); +extern "C" void sys_open_audio2(t_audiodevs *ai, t_audiodevs *ao, int rate, int dacblocksize, int advance, int scheduler) { + sys_open_audio(ai->ndev,ai->dev,ai->ndev,ai->chdev,ao->ndev,ao->dev,ao->ndev,ao->chdev,rate,dacblocksize,advance,scheduler,1); } /* init routines for any API which needs to set stuff up before any other API gets used. This is only true of OSS so far. */ @@ -311,11 +311,11 @@ void sys_close_audio() { /* open audio using whatever parameters were last used */ void sys_reopen_audio() { - t_audiodevs in, out; + t_audiodevs ai,ao; int rate, dacblocksize, advance, scheduler; sys_close_audio(); - sys_get_audio_params(&in,&out,&rate, &dacblocksize, &advance, &scheduler); - sys_open_audio2(&in,&out, rate, dacblocksize, advance, scheduler); + sys_get_audio_params(&ai,&ao,&rate,&dacblocksize,&advance,&scheduler); + sys_open_audio2( &ai,&ao, rate, dacblocksize, advance, scheduler); } /* tb: default value of peak_fp {*/ @@ -383,23 +383,23 @@ void sys_listdevs() { /* start an audio settings dialog window */ void glob_audio_properties(t_pd *dummy, t_floatarg flongform) { /* these are the devices you're using: */ - t_audiodevs in,out; + t_audiodevs ai,ao; int rate, dacblocksize, advance, scheduler; /* these are all the devices on your system: */ - char indevlist[MAXNDEV*DEVDESCSIZE], outdevlist[MAXNDEV*DEVDESCSIZE]; - int nindevs = 0, noutdevs = 0, canmulti = 0; - audio_getdevs(indevlist, &nindevs, outdevlist, &noutdevs, &canmulti, MAXNDEV, DEVDESCSIZE); - ostringstream indevliststring; for (int i=0; i 1 || out.ndev > 1) flongform = 1; - ostringstream indevs; for (int i=0; i< in.ndev; i++) indevs << " " << in.dev [i]; - ostringstream outdevs; for (int i=0; i 1 || ao.ndev > 1) flongform = 1; + ostringstream idevs; for (int i=0; i