added new method to JSoundSystem to pause music. Previously, "pause" meant kill the music and "resume" effectively restarted the music. iOS will now pause and resume appropriately

modified pc and android impls to ensure new calls are made.  These still have the same effective outcome (kill and start) until the equivalent is coded on these platforms to pause and resume the music.  
fixed bug with iOS sound effects not playing.  Forgot to assign the key to the associated music sample
This commit is contained in:
techdragon.nguyen@gmail.com
2012-02-05 08:21:06 +00:00
parent 2eec7f9a6d
commit 5c293e2fbb
13 changed files with 149 additions and 45 deletions

View File

@@ -474,12 +474,12 @@ void GameApp::SetCurrentState(GameState * state)
void GameApp::Pause()
{
stopMusic();
pauseMusic();
}
void GameApp::Resume()
{
playMusic();
resumeMusic();
}
void GameApp::DoTransition(int trans, int tostate, float dur, bool animonly)
@@ -555,6 +555,24 @@ void GameApp::playMusic(string filename, bool loop)
}
}
void GameApp::pauseMusic()
{
if (music && currentMusicFile != "")
{
JSoundSystem::GetInstance()->PauseMusic(music);
}
}
void GameApp::resumeMusic()
{
if (music && currentMusicFile != "")
{
JSoundSystem::GetInstance()->ResumeMusic(music);
}
}
void GameApp::stopMusic()
{
if (music && currentMusicFile != "")