本文整理汇总了C++中LLAudioChannel::updateBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ LLAudioChannel::updateBuffer方法的具体用法?C++ LLAudioChannel::updateBuffer怎么用?C++ LLAudioChannel::updateBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLAudioChannel
的用法示例。
在下文中一共展示了LLAudioChannel::updateBuffer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: idle
//.........这里部分代码省略.........
}
// Do this BEFORE we update the channels
// Update the channels to sync up with any changes that the source made,
// such as changing what sound was playing.
updateChannels();
// Update queued sounds (switch to next queued data if the current has finished playing)
for (iter = mAllSources.begin(); iter != mAllSources.end(); ++iter)
{
// This is lame, instead of this I could actually iterate through all the sources
// attached to each channel, since only those with active channels
// can have anything interesting happen with their queue? (Maybe not true)
LLAudioSource *sourcep = iter->second;
if (!sourcep->mQueuedDatap || sourcep->isMuted())
{
// Muted, or nothing queued, so we don't care.
continue;
}
LLAudioChannel *channelp = sourcep->getChannel();
if (!channelp)
{
// This sound isn't playing, so we just process move the queue
sourcep->mCurrentDatap = sourcep->mQueuedDatap;
sourcep->mQueuedDatap = NULL;
// Reset the timer so the source doesn't die.
sourcep->mAgeTimer.reset();
// Make sure we have the buffer set up if we just decoded the data
if (sourcep->mCurrentDatap)
{
updateBufferForData(sourcep->mCurrentDatap);
}
// Actually play the associated data.
sourcep->setupChannel();
channelp = sourcep->getChannel();
if (channelp)
{
channelp->updateBuffer();
sourcep->getChannel()->play();
}
continue;
}
else
{
// Check to see if the current sound is done playing, or looped.
if (!channelp->isPlaying())
{
sourcep->mCurrentDatap = sourcep->mQueuedDatap;
sourcep->mQueuedDatap = NULL;
// Reset the timer so the source doesn't die.
sourcep->mAgeTimer.reset();
// Make sure we have the buffer set up if we just decoded the data
if (sourcep->mCurrentDatap)
{
updateBufferForData(sourcep->mCurrentDatap);
}
// Actually play the associated data.
sourcep->setupChannel();
channelp->updateBuffer();