void RudeSound::Tick(float delta) { if(m_bgmVolFadeEnabled && m_curBGM != kBGMNone) { m_bgmVol += m_bgmVolFade * delta; if(m_bgmVol > 1.0f) { m_bgmVol = 1.0f; m_bgmVolFade = 0.0f; m_bgmVolFadeEnabled = false; } else if(m_bgmVol < 0.0f) { m_bgmVol = 0.0f; m_bgmVolFade = 0.0f; m_bgmVolFadeEnabled = false; StopSong(); return; } #if defined(RUDE_IPHONE) || defined(RUDE_MACOS) SoundEngine_SetBackgroundMusicVolume(m_bgmVol); #endif } }
void RudeSound::BgmVol(float vol) { m_bgmVol = vol; m_bgmVolFade = 0.0f; #if defined(RUDE_IPHONE) || defined(RUDE_MACOS) if(m_curBGM != kBGMNone) SoundEngine_SetBackgroundMusicVolume(m_bgmVol); #endif }
void ofxOpenALSoundPlayer::setVolume(float _vol) { if ( !bLoadedOk ) return; volume = _vol; if(iAmAnMp3) SoundEngine_SetBackgroundMusicVolume(volume); else SoundEngine_SetEffectLevel(myPrimedId, (Float32)volume); }
void ofxOpenALSoundPlayer::setBackgroundMusicVolume(float bgVol) { SoundEngine_SetBackgroundMusicVolume((Float32)bgVol); }