本文整理汇总了C++中FixedSizeQueue::pop_front方法的典型用法代码示例。如果您正苦于以下问题:C++ FixedSizeQueue::pop_front方法的具体用法?C++ FixedSizeQueue::pop_front怎么用?C++ FixedSizeQueue::pop_front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FixedSizeQueue
的用法示例。
在下文中一共展示了FixedSizeQueue::pop_front方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __AudioMix
// numFrames is number of stereo frames.
// This is called from *outside* the emulator thread.
int __AudioMix(short *outstereo, int numFrames)
{
// TODO: if mixFrequency != the actual output frequency, resample!
lock_guard guard(section);
int underrun = -1;
s16 sampleL = 0;
s16 sampleR = 0;
bool anythingToPlay = false;
for (int i = 0; i < numFrames; i++) {
if (outAudioQueue.size() >= 2) {
sampleL = outAudioQueue.pop_front();
sampleR = outAudioQueue.pop_front();
outstereo[i * 2 + 0] = sampleL;
outstereo[i * 2 + 1] = sampleR;
anythingToPlay = true;
} else {
if (underrun == -1) underrun = i;
outstereo[i * 2 + 0] = sampleL; // repeat last sample, can reduce clicking
outstereo[i * 2 + 1] = sampleR; // repeat last sample, can reduce clicking
}
}
if (anythingToPlay && underrun >= 0) {
DEBUG_LOG(HLE, "Audio out buffer UNDERRUN at %i of %i", underrun, numFrames);
} else {
// DEBUG_LOG(HLE, "No underrun, mixed %i samples fine", numFrames);
}
return underrun >= 0 ? underrun : numFrames;
}