aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sound.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/kyra/sound.h')
-rw-r--r--engines/kyra/sound.h58
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;
};