// from ASIOv1 void bufferSwitch(long bufferIndex, ASIOBool directProcess) { ASIOTime asioTime = {0}; ASIOError errorCode = ASIOGetSamplePosition(&asioTime.timeInfo.samplePosition, &asioTime.timeInfo.systemTime); if (errorCode == ASE_OK) { asioTime.timeInfo.flags = kSystemTimeValid | kSamplePositionValid; } bufferSwitchTimeInfo(&asioTime, bufferIndex, directProcess); }
//---------------------------------------------------------------------------------- void bufferSwitch(long index, ASIOBool processNow) { // the actual processing callback. // Beware that this is normally in a seperate thread, hence be sure that you take care // about thread synchronization. This is omitted here for simplicity. // as this is a "back door" into the bufferSwitchTimeInfo a timeInfo needs to be created // though it will only set the timeInfo.samplePosition and timeInfo.systemTime fields and the according flags ASIOTime timeInfo; memset (&timeInfo, 0, sizeof (timeInfo)); // get the time stamp of the buffer, not necessary if no // synchronization to other media is required if(ASIOGetSamplePosition(&timeInfo.timeInfo.samplePosition, &timeInfo.timeInfo.systemTime) == ASE_OK) timeInfo.timeInfo.flags = kSystemTimeValid | kSamplePositionValid; bufferSwitchTimeInfo (&timeInfo, index, processNow); }