Quantcast
Channel: C++博客-所有随笔
Viewing all articles
Browse latest Browse all 7881

SimpleAudioEngine 判断音效是否播放完

$
0
0
SimpleAudioEngine.h 文件中添加以下函数定义:
//判断当前音效是否已经播放完
bool getEffectIsPlayingFinished(unsigned int nSoundId);

SimpleAudioEngine.cpp 函数实现,比较简单:
//判断当前音效是否已经播放完
bool SimpleAudioEngine::getEffectIsPlayingFinished(unsigned int nSoundId)
{
       EffectList::iterator itor = sharedList().find(nSoundId);
       bool bRet = false;
       if ( itor != sharedList().end() )
       {
              bRet = itor->second->IsPlaying();
       }
       return bRet;
}

注:修改后将libCocosDenshion类库重新编译一下。只要通过我们的soundid参数,便可找到MciPlayer,然后就可以处理了。


虚空骄阳 2014-05-18 15:21 发表评论

Viewing all articles
Browse latest Browse all 7881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>