From 7ab1e368e880e17d3ea904fe74153219e9531d1d Mon Sep 17 00:00:00 2001 From: Sylvain Dupont Date: Mon, 25 Oct 2010 22:15:47 +0000 Subject: TOON: Implemented Ambient SFX For example used in arcade playing sounds, lullaby music, toilet game win sound effects... svn-id: r53834 --- engines/toon/audio.h | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) (limited to 'engines/toon/audio.h') diff --git a/engines/toon/audio.h b/engines/toon/audio.h index 535e909565..32295fdadd 100644 --- a/engines/toon/audio.h +++ b/engines/toon/audio.h @@ -109,6 +109,16 @@ protected: ToonEngine *_vm; }; +struct AudioAmbientSFX { + int32 _id; + int32 _volume; + int32 _lastTimer; + int32 _delay; + int32 _mode; + int32 _channel; + bool _enabled; +}; + class AudioManager { public: void removeInstance(AudioStreamInstance *inst); // called by destructor @@ -120,16 +130,22 @@ public: void playMusic(Common::String dir, Common::String music); void playVoice(int32 id, bool genericVoice); - void playSFX(int32 id, int volume, bool genericSFX); + int32 playSFX(int32 id, int volume, bool genericSFX); void stopCurrentVoice(); void setMusicVolume(int32 volume); void stopMusic(); void muteVoice(bool mute); void muteMusic(bool mute); void muteSfx(bool mute); - bool isVoiceMuted() { return voiceMuted; } - bool isMusicMuted() { return musicMuted; } - bool isSfxMuted() { return sfxMuted; } + bool isVoiceMuted() { return _voiceMuted; } + bool isMusicMuted() { return _musicMuted; } + bool isSfxMuted() { return _sfxMuted; } + + void startAmbientSFX(int32 id, int32 delay, int32 mode, int32 volume); + void killAmbientSFX(int32 id); + void killAllAmbientSFX(); + void updateAmbientSFX(); + void setAmbientSFXVolume(int32 id, int volume); void closeAudioPack(int32 id); bool loadAudioPack(int32 id, Common::String indexFile, Common::String packFile); @@ -148,9 +164,11 @@ public: Audio::Mixer *_mixer; protected: - bool voiceMuted; - bool musicMuted; - bool sfxMuted; + bool _voiceMuted; + bool _musicMuted; + bool _sfxMuted; + + AudioAmbientSFX _ambientSFXs[4]; }; } // End of namespace Toon -- cgit v1.2.3