Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13287
Modified Files: Tag: devel_0_38 s_audio.c Log Message: more portable peak metering and sleepgrain adaption
Index: s_audio.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/s_audio.c,v retrieving revision 1.5.4.10 retrieving revision 1.5.4.11 diff -C2 -d -r1.5.4.10 -r1.5.4.11 *** s_audio.c 7 Apr 2005 21:23:15 -0000 1.5.4.10 --- s_audio.c 8 Apr 2005 12:42:04 -0000 1.5.4.11 *************** *** 39,45 **** int sys_schedblocksize;
! static int sys_meters; /* true if we're metering */ ! static float sys_inmax; /* max input amplitude */ ! static float sys_outmax; /* max output amplitude */
/* exported variables */ --- 39,45 ---- int sys_schedblocksize;
! int sys_meters; /* true if we're metering */ ! float sys_inmax; /* max input amplitude */ ! float sys_outmax; /* max output amplitude */
/* exported variables */ *************** *** 323,337 **** sys_schedadvance = advance * 1000;
- /* tb { - * cut'n'paste from m_scheduler to adapt the sleepgrain with the latency */ - if (sys_schedadvance < 20000) - sys_sleepgrain = sys_schedadvance/4; - if (sys_sleepgrain < 100) - sys_sleepgrain = 100; - else - if (sys_sleepgrain > 5000) - sys_sleepgrain = 5000; - /* } tb */ - sys_setchsr(inchans, outchans, rate, dacblocksize); sys_log_error(ERR_NOTHING); --- 323,326 ---- *************** *** 352,356 **** if (sys_audioapi == API_JACK) jack_open_audio((naudioindev > 0 ? realinchans[0] : 0), ! (naudiooutdev > 0 ? realoutchans[0] : 0), rate);
else --- 341,345 ---- if (sys_audioapi == API_JACK) jack_open_audio((naudioindev > 0 ? realinchans[0] : 0), ! (naudiooutdev > 0 ? realoutchans[0] : 0), rate, schedmode);
else *************** *** 402,405 **** --- 391,405 ---- sys_vgui("set pd_whichapi %d\n", (audio_isopen() ? sys_audioapi : 0)); sched_set_using_dacs(enable); + + /* tb { + * cut'n'paste from m_scheduler to adapt the sleepgrain with the latency */ + if (sys_schedadvance < 20000) + sys_sleepgrain = sys_schedadvance/4; + if (sys_sleepgrain < 100) + sys_sleepgrain = 100; + else + if (sys_sleepgrain > 5000) + sys_sleepgrain = 5000; + /* } tb */ }
*************** *** 482,494 **** /* } */
int sys_send_dacs(void) { if (sys_meters) ! { ! sys_inmax = peak_fp(sys_soundin,sys_inchannels * sys_dacblocksize, ! sys_inmax); ! sys_outmax = peak_fp(sys_soundout,sys_outchannels * sys_dacblocksize, ! sys_outmax); ! }
#ifdef USEAPI_PORTAUDIO --- 482,497 ---- /* } */
+ void sys_peakmeters(void) + { + sys_inmax = peak_fp(sys_soundin,sys_inchannels * sys_dacblocksize, + sys_inmax); + sys_outmax = peak_fp(sys_soundout,sys_outchannels * sys_dacblocksize, + sys_outmax); + } + int sys_send_dacs(void) { if (sys_meters) ! sys_peakmeters();
#ifdef USEAPI_PORTAUDIO