当前位置: 首页>>代码示例>>C++>>正文


C++ WaveTrack::clearPrefetchFifo方法代码示例

本文整理汇总了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;
}
开发者ID:87maxi,项目名称:oom,代码行数:54,代码来源:audioprefetch.cpp


注:本文中的WaveTrack::clearPrefetchFifo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。