aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/sound.h
diff options
context:
space:
mode:
authorjohndoe1232014-04-26 00:08:37 +0200
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commitad2c0aaf3d81688f9c575eef64b571cb73249997 (patch)
tree188ab3b052b4340b8ee7b17c5dc550ae6dd4c4f9 /engines/illusions/sound.h
parent9885a050f2e9b718e3fb7bab224dcfdc18292231 (diff)
downloadscummvm-rg350-ad2c0aaf3d81688f9c575eef64b571cb73249997.tar.gz
scummvm-rg350-ad2c0aaf3d81688f9c575eef64b571cb73249997.tar.bz2
scummvm-rg350-ad2c0aaf3d81688f9c575eef64b571cb73249997.zip
ILLUSIONS: Add sound effects
- Fix priority bugs in Duckman - Add more script and sequence opcodes
Diffstat (limited to 'engines/illusions/sound.h')
-rw-r--r--engines/illusions/sound.h33
1 files changed, 29 insertions, 4 deletions
diff --git a/engines/illusions/sound.h b/engines/illusions/sound.h
index 9e2cd43fa1..d2d91ac3c8 100644
--- a/engines/illusions/sound.h
+++ b/engines/illusions/sound.h
@@ -35,13 +35,12 @@ class IllusionsEngine;
class MusicPlayer {
public:
- MusicPlayer(Audio::Mixer *mixer);
+ MusicPlayer();
~MusicPlayer();
void play(uint32 musicId, bool looping, int16 volume, int16 pan);
void stop();
bool isPlaying();
protected:
- Audio::Mixer *_mixer;
Audio::SoundHandle _soundHandle;
uint32 _musicId;
uint _flags;
@@ -49,7 +48,7 @@ protected:
class VoicePlayer {
public:
- VoicePlayer(Audio::Mixer *mixer);
+ VoicePlayer();
~VoicePlayer();
bool cue(const char *voiceName);
void stopCueing();
@@ -59,12 +58,29 @@ public:
bool isEnabled();
bool isCued();
protected:
- Audio::Mixer *_mixer;
Audio::SoundHandle _soundHandle;
Common::String _voiceName;
uint _voiceStatus;
};
+class Sound {
+public:
+ Sound(uint32 soundEffectId, uint32 soundGroupId, bool looping);
+ ~Sound();
+ void load();
+ void unload();
+ void play(int16 volume, int16 pan);
+ void stop();
+ bool isPlaying();
+public:
+ uint32 _soundEffectId;
+ uint32 _soundGroupId;
+protected:
+ Audio::RewindableAudioStream *_stream;
+ Audio::SoundHandle _soundHandle;
+ bool _looping;
+};
+
class SoundMan {
public:
SoundMan(IllusionsEngine *vm);
@@ -82,11 +98,20 @@ public:
bool isVoiceEnabled();
bool isVoiceCued();
+ void loadSound(uint32 soundEffectId, uint32 soundGroupId, bool looping);
+ void playSound(uint32 soundEffectId, int16 volume, int16 pan);
+ void stopSound(uint32 soundEffectId);
+ void unloadSounds(uint32 soundGroupId);
+
protected:
+ typedef Common::List<Sound*> SoundList;
+ typedef SoundList::iterator SoundListIterator;
IllusionsEngine *_vm;
uint32 _musicNotifyThreadId;
MusicPlayer *_musicPlayer;
VoicePlayer *_voicePlayer;
+ SoundList _sounds;
+ Sound *getSound(uint32 soundEffectId);
};
} // End of namespace Illusions