I've spent a while now since my first post attempting to work out a way to do this. I've got my head much better around CocosDension and have got most bits working, except my pausing still :/
When I want to pause all sound effects when the Pause menu is displayed I do this:
-(void) pauseAllSounds {
for (int i = 0; i < [[[CDAudioManager sharedManager] soundEngine] sourceTotal]; i++) {
if ( [[[[CDAudioManager sharedManager] soundEngine] soundSourceForSound:i sourceGroupId:0] isPlaying] ) {
[[[[CDAudioManager sharedManager] soundEngine] soundSourceForSound:i sourceGroupId:0] pause];
}
}
}
The main problem I have with this specifically is that the isPlaying method seems to always only return false retrieving either AL_INITIAL or AL_STOPPED with alGetSourcei despite when a sound effect is clearly playing :/
My resume sound effects method should then do this:
-(void) resumeAllSounds {
for (int i = 0; i < [[[CDAudioManager sharedManager] soundEngine] sourceTotal]; i++) {
if ([[[CDAudioManager sharedManager] soundEngine] soundSourceForSound:i sourceGroupId:0].isPaused) {
[[[[CDAudioManager sharedManager] soundEngine] soundSourceForSound:i sourceGroupId:0] play];
}
}
}
(the isPaused method is one I added to CDSoundSource, it is identical to isPlaying except it checks for AL_PAUSED)
This obviously doesn't work as none of the sounds become paused in the first place :/.
All helps is really! appreciated.
Cheers