Modularized Linuxmoto port.
svn-id: r50474
This commit is contained in:
parent
494755cc36
commit
fd77e4b09c
13 changed files with 238 additions and 121 deletions
|
@ -35,7 +35,8 @@
|
|||
|
||||
SdlMixerManager::SdlMixerManager()
|
||||
:
|
||||
_mixer(0) {
|
||||
_mixer(0),
|
||||
_audioSuspended(false) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -120,4 +121,20 @@ void SdlMixerManager::sdlCallback(void *this_, byte *samples, int len) {
|
|||
manager->callbackHandler(samples, len);
|
||||
}
|
||||
|
||||
void SdlMixerManager::suspendAudio() {
|
||||
SDL_CloseAudio();
|
||||
_audioSuspended = true;
|
||||
}
|
||||
|
||||
int SdlMixerManager::resumeAudio() {
|
||||
if (!_audioSuspended)
|
||||
return -2;
|
||||
if (SDL_OpenAudio(&_obtainedRate, NULL) < 0){
|
||||
return -1;
|
||||
}
|
||||
SDL_PauseAudio(0);
|
||||
_audioSuspended = false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue