Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20201/src
Modified Files: Tag: devel_0_38 s_audio_asio.cpp Log Message: alternative way of waiting.. but not working yet
Index: s_audio_asio.cpp =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/s_audio_asio.cpp,v retrieving revision 1.1.4.6 retrieving revision 1.1.4.7 diff -C2 -d -r1.1.4.6 -r1.1.4.7 *** s_audio_asio.cpp 8 Nov 2004 13:23:47 -0000 1.1.4.6 --- s_audio_asio.cpp 8 Nov 2004 20:18:41 -0000 1.1.4.7 *************** *** 47,51 ****
// seconds to wait for driver to respond ! #define DRIVERWAIT 3
#ifdef PD_DEBUG --- 47,51 ----
// seconds to wait for driver to respond ! #define DRIVERWAIT 1
#ifdef PD_DEBUG *************** *** 202,206 **** asio_driver->sysRef = 0; #endif ! status = ASIOInit(asio_driver); --- 202,206 ---- asio_driver->sysRef = 0; #endif ! status = ASIOInit(asio_driver); *************** *** 545,548 **** --- 545,550 ---- asio_ringbuffer_inoffset += DEFDACBLKSIZE;
+ #if 1 + // blocking method if (asio_ringbuffer_inoffset >= asio_ringbuffer_outoffset + asio_bufsize) { *************** *** 567,575 **** asio_ringbuffer_outoffset += asio_bufsize; } - if ((timenow = sys_getrealtime()) - timeref > 0.002) { return SENDDACS_SLEPT; } return SENDDACS_YES; } --- 569,589 ---- asio_ringbuffer_outoffset += asio_bufsize; } if ((timenow = sys_getrealtime()) - timeref > 0.002) { return SENDDACS_SLEPT; } + #else + // non-blocking... let PD wait -> doesn't work! + if (asio_ringbuffer_inoffset >= asio_ringbuffer_outoffset + asio_bufsize) + return SENDDACS_NO; + + if (asio_ringbuffer_inoffset == asio_ringbuffer_length) + { + asio_ringbuffer_outoffset = 0; + asio_ringbuffer_inoffset = 0; + } + else + asio_ringbuffer_outoffset += asio_bufsize; + #endif return SENDDACS_YES; }