diff options
author | Matthew Hoops | 2011-12-12 15:25:28 -0500 |
---|---|---|
committer | Matthew Hoops | 2011-12-12 15:25:28 -0500 |
commit | 00279659b22cbd5db739d5351e83a9fc2a2ae408 (patch) | |
tree | 497f06f46820043cbdf1725652b8f0073223e24a /engines/kyra/sound.h | |
parent | d932df79bed5aac97e17c0920a5e75cb5ce733ee (diff) | |
parent | d1628feb761acc9f4607f64de3eb620fea53bcc9 (diff) | |
download | scummvm-rg350-00279659b22cbd5db739d5351e83a9fc2a2ae408.tar.gz scummvm-rg350-00279659b22cbd5db739d5351e83a9fc2a2ae408.tar.bz2 scummvm-rg350-00279659b22cbd5db739d5351e83a9fc2a2ae408.zip |
Merge remote branch 'upstream/master' into pegasus
Conflicts:
video/qt_decoder.cpp
Diffstat (limited to 'engines/kyra/sound.h')
-rw-r--r-- | engines/kyra/sound.h | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index c3c32331be..f3de56520e 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -58,7 +58,7 @@ public: }; virtual kType getMusicType() const = 0; - virtual kType getSfxType() const { return getMusicType(); } + virtual kType getSfxType() const; /** * Initializes the output device. @@ -83,7 +83,7 @@ public: * * @param list soundfile list */ - virtual void setSoundList(const AudioDataStruct *list) { _soundDataList = list; } + virtual void setSoundList(const AudioDataStruct *list); /** * Checks if a given sound file is present. @@ -91,7 +91,7 @@ public: * @param track track number * @return true if available, false otherwise */ - virtual bool hasSoundFile(uint file) const { return (fileListEntry(file) != 0); } + virtual bool hasSoundFile(uint file) const; /** * Load a specifc sound file for use of @@ -140,7 +140,7 @@ public: * * @return true if playing, false otherwise */ - virtual bool isPlaying() const { return false; } + virtual bool isPlaying() const; /** * Starts fading out the volume. @@ -163,15 +163,13 @@ public: void enableSFX(bool enable) { _sfxEnabled = enable; } bool sfxEnabled() const { return _sfxEnabled; } - virtual bool voiceFileIsPresent(const char *file); - /** * Checks whether a voice file with the given name is present * * @param file file name * @return true if available, false otherwise */ - bool isVoicePresent(const char *file); + bool isVoicePresent(const char *file) const; /** * Plays the specified voice file. @@ -188,7 +186,7 @@ public: */ virtual int32 voicePlay(const char *file, Audio::SoundHandle *handle = 0, uint8 volume = 255, bool isSfx = false); - Audio::SeekableAudioStream *getVoiceStream(const char *file); + Audio::SeekableAudioStream *getVoiceStream(const char *file) const; bool playVoiceStream(Audio::AudioStream *stream, Audio::SoundHandle *handle = 0, uint8 volume = 255, bool isSfx = false); @@ -197,21 +195,21 @@ public: * * @return true when playing, else false */ - bool voiceIsPlaying(const Audio::SoundHandle *handle = 0); + bool voiceIsPlaying(const Audio::SoundHandle *handle = 0) const; /** * Checks if all voice handles are used. * * @return false when a handle is free, else true */ - bool allVoiceChannelsPlaying(); + bool allVoiceChannelsPlaying() const; /** * Checks how long a voice has been playing * * @return time in milliseconds */ - uint32 voicePlayedTime(const Audio::SoundHandle &handle) { + uint32 voicePlayedTime(const Audio::SoundHandle &handle) const { return _mixer->getSoundElapsedTime(handle); } @@ -253,34 +251,34 @@ private: class MixedSoundDriver : public Sound { public: - MixedSoundDriver(KyraEngine_v1 *vm, Audio::Mixer *mixer, Sound *music, Sound *sfx) : Sound(vm, mixer), _music(music), _sfx(sfx) {} - ~MixedSoundDriver() { delete _music; delete _sfx; } + MixedSoundDriver(KyraEngine_v1 *vm, Audio::Mixer *mixer, Sound *music, Sound *sfx); + ~MixedSoundDriver(); - kType getMusicType() const { return _music->getMusicType(); } - kType getSfxType() const { return _sfx->getSfxType(); } + virtual kType getMusicType() const; + virtual kType getSfxType() const; - bool init() { return (_music->init() && _sfx->init()); } - void process() { _music->process(); _sfx->process(); } + virtual bool init(); + virtual void process(); - void updateVolumeSettings() { _music->updateVolumeSettings(); _sfx->updateVolumeSettings(); } + virtual void updateVolumeSettings(); - void setSoundList(const AudioDataStruct * list) { _music->setSoundList(list); _sfx->setSoundList(list); } - bool hasSoundFile(uint file) const { return _music->hasSoundFile(file) && _sfx->hasSoundFile(file); } - void loadSoundFile(uint file) { _music->loadSoundFile(file); _sfx->loadSoundFile(file); } - void loadSoundFile(Common::String file) { _music->loadSoundFile(file); _sfx->loadSoundFile(file); } + virtual void setSoundList(const AudioDataStruct *list); + virtual bool hasSoundFile(uint file) const; + virtual void loadSoundFile(uint file); + virtual void loadSoundFile(Common::String file); - void loadSfxFile(Common::String file) { _sfx->loadSoundFile(file); } + virtual void loadSfxFile(Common::String file); - void playTrack(uint8 track) { _music->playTrack(track); } - void haltTrack() { _music->haltTrack(); } - bool isPlaying() const { return _music->isPlaying() | _sfx->isPlaying(); } + virtual void playTrack(uint8 track); + virtual void haltTrack(); + virtual bool isPlaying() const; - void playSoundEffect(uint8 track) { _sfx->playSoundEffect(track); } + virtual void playSoundEffect(uint8 track); - void stopAllSoundEffects() { _sfx->stopAllSoundEffects(); } + virtual void stopAllSoundEffects(); - void beginFadeOut() { _music->beginFadeOut(); } - void pause(bool paused) { _music->pause(paused); _sfx->pause(paused); } + virtual void beginFadeOut(); + virtual void pause(bool paused); private: Sound *_music, *_sfx; }; |