本文整理汇总了C++中FileIO::writeNextBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ FileIO::writeNextBuffer方法的具体用法?C++ FileIO::writeNextBuffer怎么用?C++ FileIO::writeNextBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileIO
的用法示例。
在下文中一共展示了FileIO::writeNextBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void * FileIO::threadFunction(void * ptr) {
FileIO *me = (FileIO *)ptr;
// printf("D: %d\n", me->mDuration);
#ifdef DO_TIMING
int sleepTime;
struct timeval *meThen = &me->mThen;
struct timeval *meNow = & me->mNow;
#endif
while (me->mIsPlaying) { // loop until turned off
#ifdef DO_TIMING
GET_TIME(meThen);
#endif
me->writeNextBuffer(); // get and write the next buffer
#ifdef DO_TIMING
GET_TIME(meNow);
me->printTimeStatistics(meNow, meThen, & me->mThisSec, & me->mTimeSum, & me->mTimeVals);
GET_TIME(meNow);
sleepTime = me->mDuration - (((meNow->tv_sec - meThen->tv_sec) * 1000000) + (meNow->tv_usec - meThen->tv_usec));
// printf("S: %d\n", sleepTime);
if (sleepTime > 0)
csl::sleepUsec(sleepTime);
#else
csl::sleepUsec(me->mDuration);
#endif
}
// do this to prevent a race condition
me->mIsThreadRunning = false;
logMsg("Stopping sound file output thread");
return 0;
}