diff options
| author | Alejandro Marzini | 2010-06-29 01:08:36 +0000 | 
|---|---|---|
| committer | Alejandro Marzini | 2010-06-29 01:08:36 +0000 | 
| commit | fd77e4b09c8ca80c8e449ad7266afaa494f98500 (patch) | |
| tree | 232ce052cfecd5f4d32d15dabc6fc2d2e46e7a43 /backends/mixer/sdl | |
| parent | 494755cc36d4bd6bac46c63b6624fe5a294c493a (diff) | |
| download | scummvm-rg350-fd77e4b09c8ca80c8e449ad7266afaa494f98500.tar.gz scummvm-rg350-fd77e4b09c8ca80c8e449ad7266afaa494f98500.tar.bz2 scummvm-rg350-fd77e4b09c8ca80c8e449ad7266afaa494f98500.zip  | |
Modularized Linuxmoto port.
svn-id: r50474
Diffstat (limited to 'backends/mixer/sdl')
| -rw-r--r-- | backends/mixer/sdl/sdl-mixer.cpp | 19 | ||||
| -rw-r--r-- | backends/mixer/sdl/sdl-mixer.h | 5 | 
2 files changed, 23 insertions, 1 deletions
diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp index aa87fcb345..2317a03335 100644 --- a/backends/mixer/sdl/sdl-mixer.cpp +++ b/backends/mixer/sdl/sdl-mixer.cpp @@ -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 diff --git a/backends/mixer/sdl/sdl-mixer.h b/backends/mixer/sdl/sdl-mixer.h index e4e8263f38..f58260fef2 100644 --- a/backends/mixer/sdl/sdl-mixer.h +++ b/backends/mixer/sdl/sdl-mixer.h @@ -43,9 +43,14 @@ public:  	Audio::Mixer *getMixer() { return (Audio::Mixer *)_mixer; } +	// Used by LinuxMoto Port +	virtual void suspendAudio(); +	virtual int resumeAudio(); +  protected:  	Audio::MixerImpl *_mixer;  	SDL_AudioSpec _obtainedRate; +	bool _audioSuspended;  	virtual SDL_AudioSpec getAudioSpec();  	virtual void startAudio();  | 
