Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20802
Modified Files: Tag: devel_0_38 s_audio_asio.cpp Log Message: make callback scheduler selectable by user
Index: s_audio_asio.cpp =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/s_audio_asio.cpp,v retrieving revision 1.1.4.19 retrieving revision 1.1.4.20 diff -C2 -d -r1.1.4.19 -r1.1.4.20 *** s_audio_asio.cpp 11 Dec 2004 10:42:40 -0000 1.1.4.19 --- s_audio_asio.cpp 14 Dec 2004 09:48:08 -0000 1.1.4.20 *************** *** 7,11 **** */
- #define CALLBACK_SCHEDULER
#ifdef USEAPI_ASIO --- 7,10 ---- *************** *** 60,64 **** extern "C" void asio_open_audio(int naudioindev, int *audioindev, int nchindev, int *chindev, int naudiooutdev, int *audiooutdev, ! int nchoutdev, int *choutdev, int srate); extern "C" void asio_close_audio(void); extern "C" void asio_getdevs(char *indevlist, int *nindevs, --- 59,63 ---- extern "C" void asio_open_audio(int naudioindev, int *audioindev, int nchindev, int *chindev, int naudiooutdev, int *audiooutdev, ! int nchoutdev, int *choutdev, int srate, int scheduler); extern "C" void asio_close_audio(void); extern "C" void asio_getdevs(char *indevlist, int *nindevs, *************** *** 195,199 **** void asio_open_audio(int naudioindev, int *audioindev, int nchindev, int *chindev, int naudiooutdev, int *audiooutdev, ! int nchoutdev, int *choutdev, int srate) { ASIOError status; --- 194,198 ---- void asio_open_audio(int naudioindev, int *audioindev, int nchindev, int *chindev, int naudiooutdev, int *audiooutdev, ! int nchoutdev, int *choutdev, int srate, int scheduler) { ASIOError status; *************** *** 233,242 **** asio_driver = (ASIODriverInfo*) getbytes (sizeof(ASIODriverInfo)); asio_driver->asioVersion = ASIOVERSION; - - #ifdef MSW asio_driver->sysRef = GetDesktopWindow(); ! #else ! asio_driver->sysRef = 0; ! #endif
status = ASIOInit(asio_driver); --- 232,237 ---- asio_driver = (ASIODriverInfo*) getbytes (sizeof(ASIODriverInfo)); asio_driver->asioVersion = ASIOVERSION; asio_driver->sysRef = GetDesktopWindow(); !
status = ASIOInit(asio_driver); *************** *** 247,255 **** post("driverversion: %d", asio_driver->driverVersion); post("name: %s", asio_driver->name); - if(status) post("error: %s", asio_driver->errorMessage); #endif
switch (status) { case ASE_NotPresent: error("ASIO: ASE_NotPresent"); --- 242,250 ---- post("driverversion: %d", asio_driver->driverVersion); post("name: %s", asio_driver->name); #endif
switch (status) { + if(status) post("error: %s", asio_driver->errorMessage); case ASE_NotPresent: error("ASIO: ASE_NotPresent"); *************** *** 285,289 **** status = ASIOGetBufferSize(&asio_minbufsize, &asio_maxbufsize, &asio_prefbufsize, ! &asio_granularity); if(status != ASE_OK) { --- 280,284 ---- status = ASIOGetBufferSize(&asio_minbufsize, &asio_maxbufsize, &asio_prefbufsize, ! &asio_granularity); if(status != ASE_OK) { *************** *** 301,316 **** asio_bufsize = asio_prefbufsize;
! #ifdef CALLBACK_SCHEDULER ! if ( asio_bufsize % sys_dacblocksize == 0 ) { ! /* use callback scheduler */ ! sys_keepsched = 0; ! sys_callbackscheduler = 1; ! asio_ticks_per_callback = asio_bufsize / sys_dacblocksize; ! post("ASIO: using callback-based scheduler"); } else post("ASIO: using traditional scheduler"); - #endif --- 296,312 ---- asio_bufsize = asio_prefbufsize;
! if (scheduler) { ! if ( asio_bufsize % sys_dacblocksize == 0 ) ! { ! /* use callback scheduler */ ! sys_keepsched = 0; ! sys_callbackscheduler = 1; ! asio_ticks_per_callback = asio_bufsize / sys_dacblocksize; ! post("ASIO: using callback-based scheduler"); ! } } else post("ASIO: using traditional scheduler"); *************** *** 358,363 **** asio_bufferinfo = (ASIOBufferInfo*) getbytes (channels * sizeof (ASIOBufferInfo)); ! asio_channelinfo = (ASIOChannelInfo*) getbytes(channels * ! sizeof (ASIOChannelInfo)); if (!(asio_bufferinfo && asio_channelinfo)) { --- 354,359 ---- asio_bufferinfo = (ASIOBufferInfo*) getbytes (channels * sizeof (ASIOBufferInfo)); ! asio_channelinfo = (ASIOChannelInfo*) getbytes(channels * ! sizeof (ASIOChannelInfo)); if (!(asio_bufferinfo && asio_channelinfo)) {