本文整理汇总了C++中SoundChannel::GetState方法的典型用法代码示例。如果您正苦于以下问题:C++ SoundChannel::GetState方法的具体用法?C++ SoundChannel::GetState怎么用?C++ SoundChannel::GetState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoundChannel
的用法示例。
在下文中一共展示了SoundChannel::GetState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
SoundChannel * SoundSystem::FindChannel(int32 priority)
{
Deque<SoundChannel*>::iterator it;
Deque<SoundChannel*>::iterator itEnd = channelsPool.end();
for(it = channelsPool.begin(); it != itEnd; ++it)
{
SoundChannel * ch = *it;
if(SoundChannel::STATE_FREE == ch->GetState())
{
return ch;
}
}
for(it = channelsPool.begin(); it != itEnd; ++it)
{
SoundChannel * ch = *it;
if(ch->GetProirity() < priority)
{
ch->Stop();
return ch;
}
}
return 0;
}
示例2: Update
void SoundSystem::Update()
{
Deque<SoundChannel*>::iterator it;
Deque<SoundChannel*>::iterator itEnd = channelsPool.end();
for(it = channelsPool.begin(); it != itEnd; ++it)
{
SoundChannel * ch = *it;
if(SoundChannel::STATE_FREE != ch->GetState())
{
ch->Update();
}
}
List<SoundInstance*>::iterator sit = soundInstances.begin();
List<SoundInstance*>::iterator sEnd = soundInstances.end();
while(sit != sEnd)
{
if(!(*sit)->Update())
{
sit = soundInstances.begin();
continue;
}
++sit;
}
}
示例3: Resume
void SoundSystem::Resume()
{
#ifdef __DAVASOUND_AL__
alcProcessContext(context);
Deque<SoundChannel*>::iterator it;
Deque<SoundChannel*>::iterator itEnd = channelsPool.end();
for(it = channelsPool.begin(); it != itEnd; ++it)
{
SoundChannel * ch = *it;
if(SoundChannel::STATE_PAUSED == ch->GetState())
{
ch->Pause(false);
}
}
#endif
}
示例4: Suspend
void SoundSystem::Suspend()
{
Deque<SoundChannel*>::iterator it;
Deque<SoundChannel*>::iterator itEnd = channelsPool.end();
for(it = channelsPool.begin(); it != itEnd; ++it)
{
SoundChannel * ch = *it;
if(SoundChannel::STATE_PLAYING == ch->GetState())
{
ch->Pause(true);
}
}
#ifdef __DAVASOUND_AL__
alcSuspendContext(context);
#endif
}