diff options
author | Alejandro Marzini | 2010-07-03 00:13:45 +0000 |
---|---|---|
committer | Alejandro Marzini | 2010-07-03 00:13:45 +0000 |
commit | fda9416cc8b64fa7371b7a9989def9cc318efc7e (patch) | |
tree | 2cdb4c6714e0cb8bbcd6ea03c5b467b6ade50e4b /backends/mixer/sdl | |
parent | f9c3a4547cbf1b1942402d618fa403a7fb1cb656 (diff) | |
download | scummvm-rg350-fda9416cc8b64fa7371b7a9989def9cc318efc7e.tar.gz scummvm-rg350-fda9416cc8b64fa7371b7a9989def9cc318efc7e.tar.bz2 scummvm-rg350-fda9416cc8b64fa7371b7a9989def9cc318efc7e.zip |
Cleanup and documentation.
svn-id: r50609
Diffstat (limited to 'backends/mixer/sdl')
-rw-r--r-- | backends/mixer/sdl/sdl-mixer.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/backends/mixer/sdl/sdl-mixer.h b/backends/mixer/sdl/sdl-mixer.h index f58260fef2..1b3a3543dc 100644 --- a/backends/mixer/sdl/sdl-mixer.h +++ b/backends/mixer/sdl/sdl-mixer.h @@ -34,28 +34,71 @@ #include "sound/mixer_intern.h" +/** + * SDL mixer manager. It wraps the actual implementation + * of the Audio:Mixer used by the engine, and setups + * the SDL audio subsystem and the callback for the + * audio mixer implementation. + */ class SdlMixerManager { public: SdlMixerManager(); virtual ~SdlMixerManager(); + /** + * Initialize and setups the mixer + */ virtual void init(); + /** + * Get the audio mixer implementation + */ Audio::Mixer *getMixer() { return (Audio::Mixer *)_mixer; } // Used by LinuxMoto Port + + /** + * Pauses the audio system + */ virtual void suspendAudio(); + + /** + * Resumes the audio system + */ virtual int resumeAudio(); protected: + /** The mixer implementation */ Audio::MixerImpl *_mixer; + + /** + * The obtained audio specification after opening the + * audio system. + */ SDL_AudioSpec _obtainedRate; + + /** State of the audio system */ bool _audioSuspended; + /** + * Returns the desired audio specification + */ virtual SDL_AudioSpec getAudioSpec(); + + /** + * Starts SDL audio + */ virtual void startAudio(); + /** + * Handles the audio callback + */ virtual void callbackHandler(byte *samples, int len); + + /** + * The mixer callback entry point. Static functions can't be overrided + * by subclasses, so it invokes the non-static function callbackHandler() + */ static void sdlCallback(void *this_, byte *samples, int len); }; |