diff options
author | Johannes Schickel | 2008-04-20 22:24:24 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-04-20 22:24:24 +0000 |
commit | 87f10ebe40d2c18742751f827d011cbf135c6f21 (patch) | |
tree | 76ac4a016ef4e1535506525c7131bcb9ca734fda /engines/kyra | |
parent | dfdb73367e3576f23a80d43fdfde6b7f7dde2bc8 (diff) | |
download | scummvm-rg350-87f10ebe40d2c18742751f827d011cbf135c6f21.tar.gz scummvm-rg350-87f10ebe40d2c18742751f827d011cbf135c6f21.tar.bz2 scummvm-rg350-87f10ebe40d2c18742751f827d011cbf135c6f21.zip |
Committed patch removing Audio::Mixer::SoundType alias in Kyra::SoundDigital.
svn-id: r31632
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/kyra_v3.cpp | 10 | ||||
-rw-r--r-- | engines/kyra/sound.h | 8 | ||||
-rw-r--r-- | engines/kyra/sound_digital.cpp | 9 |
3 files changed, 9 insertions, 18 deletions
diff --git a/engines/kyra/kyra_v3.cpp b/engines/kyra/kyra_v3.cpp index f6250693c5..61c3bfb6f2 100644 --- a/engines/kyra/kyra_v3.cpp +++ b/engines/kyra/kyra_v3.cpp @@ -36,6 +36,8 @@ #include "common/system.h" #include "common/config-manager.h" +#include "sound/mixer.h" + namespace Kyra { KyraEngine_v3::KyraEngine_v3(OSystem *system, const GameFlags &flags) : KyraEngine(system, flags) { _soundDigital = 0; @@ -335,7 +337,7 @@ void KyraEngine_v3::playMenuAudioFile() { if (_soundDigital->isPlaying(_musicSoundChannel)) return; - _musicSoundChannel = _soundDigital->playSound(_menuAudioFile, 0xFF, SoundDigital::kSoundTypeMusic); + _musicSoundChannel = _soundDigital->playSound(_menuAudioFile, 0xFF, Audio::Mixer::kMusicSoundType); } void KyraEngine_v3::playMusicTrack(int track, int force) { @@ -356,7 +358,7 @@ void KyraEngine_v3::playMusicTrack(int track, int force) { if (_musicSoundChannel == -1) { assert(track < _soundListSize && track >= 0); - _musicSoundChannel = _soundDigital->playSound(_soundList[track], 0xFF, SoundDigital::kSoundTypeMusic); + _musicSoundChannel = _soundDigital->playSound(_soundList[track], 0xFF, Audio::Mixer::kMusicSoundType); } _curMusicTrack = track; @@ -415,7 +417,7 @@ void KyraEngine_v3::playSoundEffect(int item, int volume) { snprintf(filename, 16, "%s.AUD", _sfxFileList[_sfxFileMap[item*2+0]]); uint8 priority = _sfxFileMap[item*2+1]; - _soundDigital->playSound(filename, priority, SoundDigital::kSoundTypeSfx, volume); + _soundDigital->playSound(filename, priority, Audio::Mixer::kSFXSoundType, volume); } } @@ -429,7 +431,7 @@ void KyraEngine_v3::snd_playVoiceFile(int file) { char filename[16]; snprintf(filename, 16, "%u.AUD", (uint)file); - _voiceSoundChannel = _soundDigital->playSound(filename, 0xFE, SoundDigital::kSoundTypeSpeech, 255); + _voiceSoundChannel = _soundDigital->playSound(filename, 0xFE, Audio::Mixer::kSpeechSoundType, 255); } bool KyraEngine_v3::snd_voiceIsPlaying() { diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index d61c095ac9..85648f6b7e 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -504,12 +504,6 @@ public: bool init() { return true; } - enum kSoundTypes { - kSoundTypeMusic, - kSoundTypeSfx, - kSoundTypeSpeech - }; - /** * Plays a sound. * @@ -522,7 +516,7 @@ public: * * @return channel playing the sound */ - int playSound(const char *filename, uint8 priority, kSoundTypes type, int volume = 255, bool loop = false, int channel = -1); + int playSound(const char *filename, uint8 priority, Audio::Mixer::SoundType type, int volume = 255, bool loop = false, int channel = -1); /** * Checks if a given channel is playing a sound. diff --git a/engines/kyra/sound_digital.cpp b/engines/kyra/sound_digital.cpp index a7f50a6e23..24a33e5539 100644 --- a/engines/kyra/sound_digital.cpp +++ b/engines/kyra/sound_digital.cpp @@ -329,7 +329,7 @@ SoundDigital::~SoundDigital() { stopSound(i); } -int SoundDigital::playSound(const char *filename, uint8 priority, kSoundTypes type, int volume, bool loop, int channel) { +int SoundDigital::playSound(const char *filename, uint8 priority, Audio::Mixer::SoundType type, int volume, bool loop, int channel) { Sound *use = 0; if (channel != -1 && channel < ARRAYSIZE(_sounds)) { stopSound(channel); @@ -383,12 +383,7 @@ int SoundDigital::playSound(const char *filename, uint8 priority, kSoundTypes ty volume = 255; volume = (volume * Audio::Mixer::kMaxChannelVolume) / 255; - if (type == kSoundTypeMusic) - _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &use->handle, use->stream, -1, volume); - else if (type == kSoundTypeSfx) - _mixer->playInputStream(Audio::Mixer::kSFXSoundType, &use->handle, use->stream, -1, volume); - else if (type == kSoundTypeSpeech) - _mixer->playInputStream(Audio::Mixer::kSpeechSoundType, &use->handle, use->stream, -1, volume); + _mixer->playInputStream(type, &use->handle, use->stream, -1, volume); return use - _sounds; } |