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
+10 -28
View File
@@ -253,11 +253,20 @@
NSNotificationCenter *dnc = [NSNotificationCenter defaultCenter];
[dnc removeObserver: self name: @"intializeGame" object: nil];
[dnc removeObserver: self name: @"readyToStartGame" object: nil];
[dnc addObserver: glViewController selector:@selector(pauseGame) name: UIApplicationWillResignActiveNotification object: nil];
[dnc addObserver: glViewController selector:@selector(resumeGame) name: UIApplicationDidBecomeActiveNotification object: nil];
[dnc addObserver: glViewController selector:@selector(resumeGame) name:UIApplicationWillEnterForegroundNotification object: nil];
[dnc addObserver: glViewController selector:@selector(destroyGame) name:UIApplicationWillTerminateNotification object: nil];
}
- (void)dealloc
{
NSNotificationCenter *dnc = [NSNotificationCenter defaultCenter];
[dnc removeObserver: glViewController name: UIApplicationDidBecomeActiveNotification object: nil];
[dnc removeObserver: glViewController name: UIApplicationDidEnterBackgroundNotification object: nil];
[dnc removeObserver: glViewController name: UIApplicationWillTerminateNotification object: nil];
[dnc removeObserver: glViewController name: UIApplicationWillResignActiveNotification object: nil];
[window release];
[glViewController release];
[hostReach release];
@@ -312,36 +321,9 @@
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
if ( [self.glViewController.view respondsToSelector: @selector(stopAnimation)])
[self.glViewController.view stopAnimation];
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
if ( [self.glViewController.view respondsToSelector: @selector(stopAnimation)])
[self.glViewController.view startAnimation];
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
if ( [self.glViewController.view respondsToSelector: @selector(stopAnimation)])
[self.glViewController.view startAnimation];
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
if ( [self.glViewController.view respondsToSelector: @selector(stopAnimation)])
[self.glViewController.view stopAnimation];
}
- (void)applicationWillTerminate:(UIApplication *)application
{
if ( [self.glViewController.view respondsToSelector: @selector(stopAnimation)])
[self.glViewController.view stopAnimation];
[self.glViewController.view destroyGame];
}
- (void)initializeKeyboard: (id) initialState