本文整理汇总了C++中WaveTrack::clearPrefetchFifo方法的典型用法代码示例。如果您正苦于以下问题:C++ WaveTrack::clearPrefetchFifo方法的具体用法?C++ WaveTrack::clearPrefetchFifo怎么用?C++ WaveTrack::clearPrefetchFifo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WaveTrack
的用法示例。
在下文中一共展示了WaveTrack::clearPrefetchFifo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: seek
void AudioPrefetch::seek(unsigned seekTo)
{
// printf("seek %d\n", seekTo);
#ifdef AUDIOPREFETCH_DEBUG
printf("AudioPrefetch::seek to:%u seekCount:%d\n", seekTo, seekCount);
#endif
// Speedup: More than one seek message pending?
// Eat up seek messages until we get to the very LATEST one,
// because all the rest which came before it are irrelevant now,
// and processing them all was taking extreme time, especially with
// resampling enabled.
// In particular, when the user 'slides' the play cursor back and forth
// there are MANY seek messages in the pipe, and with resampling enabled
// it was taking minutes to finish seeking. If the user hit play during that time,
// things were messed up (FIFO underruns, choppy intermittent sound etc).
// Added by Tim. p3.3.20
if (seekCount > 1)
{
--seekCount;
return;
}
writePos = seekTo;
WaveTrackList* tl = song->waves();
for (iWaveTrack it = tl->begin(); it != tl->end(); ++it)
{
WaveTrack* track = *it;
track->clearPrefetchFifo();
}
bool isFirstPrefetch = true;
for (unsigned int i = 0; i < (fifoLength) - 1; ++i)//prevent compiler warning: comparison of signed/unsigned
{
// Indicate do a seek command before read, but only on the first pass.
// Changed by Tim. p3.3.17
//prefetch();
prefetch(isFirstPrefetch);
isFirstPrefetch = false;
// To help speed things up even more, check the count again. Return if more seek messages are pending.
// Added by Tim. p3.3.20
if (seekCount > 1)
{
--seekCount;
return;
}
}
seekPos = seekTo;
//seekDone = true;
--seekCount;
}