void SimpleAudioEngine::end() { sharedAudioController()->StopBackgroundMusic(true); sharedAudioController()->StopAllSoundEffects(true); sharedAudioController()->ReleaseResources(); s_initialized = false; }
void SimpleAudioEngine::end() { // 停止音乐播放并回收资源 sharedAudioController()->StopBackgroundMusic(true); sharedAudioController()->StopAllSoundEffects(); sharedAudioController()->ReleaseResources(); }
void SimpleAudioEngine::end() { sharedAudioController()->StopBackgroundMusic(true); sharedAudioController()->StopAllSoundEffects(); sharedAudioController()->ReleaseResources(); //set here to tell the s_bAudioControllerNeedReInitialize should be re-initialized s_bAudioControllerNeedReInitialize = true; }
unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop) { unsigned int sound; sharedAudioController()->PlaySoundEffect(pszFilePath, bLoop, sound); return sound; }
unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop,float pitch, float pan, float gain) { unsigned int sound; sharedAudioController()->PlaySoundEffect(pszFilePath, bLoop, sound); // TODO: need to support playEffect parameters return sound; }
unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop,float pitch, float pan, float gain) { unsigned int sound; string fullPath = CCFileUtils::getInstance()->fullPathForFilename(pszFilePath); sharedAudioController()->PlaySoundEffect(fullPath.c_str(), bLoop, sound); // TODO: need to support playEffect parameters return sound; }
unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop) { unsigned int sound; string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath); sharedAudioController()->PlaySoundEffect(fullPath.c_str(), bLoop, sound); return sound; }
void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop) { if (! pszFilePath) { return; } sharedAudioController()->PlayBackgroundMusic(pszFilePath, bLoop); }
void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop) { if (! pszFilePath) { return; } string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath); sharedAudioController()->PlayBackgroundMusic(fullPath.c_str(), bLoop); }
void SimpleAudioEngine::unloadEffect(const char* pszFilePath) { string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(pszFilePath); sharedAudioController()->UnloadSoundEffect(fullPath.c_str()); }
float SimpleAudioEngine::getBackgroundMusicVolume() { return sharedAudioController()->GetBackgroundVolume(); }
void SimpleAudioEngine::resumeAllEffects() { sharedAudioController()->ResumeAllSoundEffects(); }
void SimpleAudioEngine::stopAllEffects() { sharedAudioController()->StopAllSoundEffects(); }
void SimpleAudioEngine::render() { sharedAudioController()->Render(); }
void SimpleAudioEngine::unloadEffect(const char* pszFilePath) { sharedAudioController()->UnloadSoundEffect(pszFilePath); }
void SimpleAudioEngine::stopEffect(unsigned int nSoundId) { sharedAudioController()->StopSoundEffect(nSoundId); }
void SimpleAudioEngine::setEffectsVolume(float volume) { sharedAudioController()->SetSoundEffectVolume((volume<=0.0f)? 0.0f : volume); }
bool SimpleAudioEngine::isBackgroundMusicPlaying() { return sharedAudioController()->IsBackgroundMusicPlaying(); }
void SimpleAudioEngine::setEffectPitch(unsigned int nSoundId, float pitch) { sharedAudioController()->setEffectPitch(nSoundId, pitch); }
void SimpleAudioEngine::rewindBackgroundMusic() { sharedAudioController()->RewindBackgroundMusic(); }
void SimpleAudioEngine::pauseBackgroundMusic() { sharedAudioController()->PauseBackgroundMusic(); }
void SimpleAudioEngine::stopBackgroundMusic(bool bReleaseData) { sharedAudioController()->StopBackgroundMusic(bReleaseData); }
void SimpleAudioEngine::setBackgroundMusicVolume(float volume) { sharedAudioController()->SetBackgroundVolume((volume<=0.0f)? 0.0f : volume); }
void SimpleAudioEngine::pauseEffect(unsigned int nSoundId) { sharedAudioController()->PauseSoundEffect(nSoundId); }
float SimpleAudioEngine::getEffectsVolume() { return sharedAudioController()->GetSoundEffectVolume(); }
void SimpleAudioEngine::resumeEffect(unsigned int nSoundId) { sharedAudioController()->ResumeSoundEffect(nSoundId); }
void SimpleAudioEngine::setEffectVolume(unsigned int nSoundId, float volume) { sharedAudioController()->setEffectVolume(nSoundId, volume); }
void SimpleAudioEngine::pauseAllEffects() { sharedAudioController()->PauseAllSoundEffects(); }
unsigned int SimpleAudioEngine::playEffect(const char* pszFilePath, bool bLoop,float pitch, float pan, float gain) { return sharedAudioController()->playSoundEffect(pszFilePath, bLoop, pitch, pan, gain); }
void SimpleAudioEngine::preloadEffect(const char* pszFilePath) { string fullPath = CCFileUtils::getInstance()->fullPathForFilename(pszFilePath); sharedAudioController()->PreloadSoundEffect(fullPath.c_str()); }