diff options
author | Johannes Schickel | 2011-10-29 00:42:18 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-10-29 01:00:18 +0200 |
commit | 17883b913715f90c21f6831c1c0314bd46e2b55b (patch) | |
tree | ae35a80b9c0699be277a78d85b3dbb99485adff9 | |
parent | 5be3ac9fcc7e057e74bb8eff9c0d234f887a0a50 (diff) | |
download | scummvm-rg350-17883b913715f90c21f6831c1c0314bd46e2b55b.tar.gz scummvm-rg350-17883b913715f90c21f6831c1c0314bd46e2b55b.tar.bz2 scummvm-rg350-17883b913715f90c21f6831c1c0314bd46e2b55b.zip |
KYRA: Make more methods of Sound const.
-rw-r--r-- | engines/kyra/sound.cpp | 10 | ||||
-rw-r--r-- | engines/kyra/sound.h | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/engines/kyra/sound.cpp b/engines/kyra/sound.cpp index 77fd8e2346..e58e0c6359 100644 --- a/engines/kyra/sound.cpp +++ b/engines/kyra/sound.cpp @@ -59,7 +59,7 @@ bool Sound::isPlaying() const { return false; } -bool Sound::voiceFileIsPresent(const char *file) { +bool Sound::voiceFileIsPresent(const char *file) const { for (int i = 0; _supportedCodecs[i].fileext; ++i) { Common::String f = file; f += _supportedCodecs[i].fileext; @@ -70,7 +70,7 @@ bool Sound::voiceFileIsPresent(const char *file) { return false; } -bool Sound::isVoicePresent(const char *file) { +bool Sound::isVoicePresent(const char *file) const { char filenamebuffer[25]; for (int i = 0; _supportedCodecs[i].fileext; ++i) { @@ -96,7 +96,7 @@ int32 Sound::voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volum return playTime; } -Audio::SeekableAudioStream *Sound::getVoiceStream(const char *file) { +Audio::SeekableAudioStream *Sound::getVoiceStream(const char *file) const { char filenamebuffer[25]; Audio::SeekableAudioStream *audioStream = 0; @@ -152,7 +152,7 @@ void Sound::voiceStop(const Audio::SoundHandle *handle) { } } -bool Sound::voiceIsPlaying(const Audio::SoundHandle *handle) { +bool Sound::voiceIsPlaying(const Audio::SoundHandle *handle) const { if (!handle) { for (int h = 0; h < kNumChannelHandles; ++h) { if (_mixer->isSoundHandleActive(_soundChannels[h])) @@ -165,7 +165,7 @@ bool Sound::voiceIsPlaying(const Audio::SoundHandle *handle) { return false; } -bool Sound::allVoiceChannelsPlaying() { +bool Sound::allVoiceChannelsPlaying() const { for (int i = 0; i < kNumChannelHandles; ++i) if (!_mixer->isSoundHandleActive(_soundChannels[i])) return false; diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index 36e7058182..fb1f58d154 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -163,7 +163,7 @@ public: void enableSFX(bool enable) { _sfxEnabled = enable; } bool sfxEnabled() const { return _sfxEnabled; } - virtual bool voiceFileIsPresent(const char *file); + virtual bool voiceFileIsPresent(const char *file) const; /** * Checks whether a voice file with the given name is present @@ -171,7 +171,7 @@ public: * @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 +188,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 +197,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); } |