mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
KYRA: Make more methods of Sound const.
This commit is contained in:
parent
5be3ac9fcc
commit
17883b9137
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user