From 1a615346abab8f234c3dbd1c55e78b179bca9d87 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 10 May 2005 23:48:48 +0000 Subject: Moved class SoundMixer to Audio::Mixer (didn't call the namespace 'Sound' because we already have many classes with that name) svn-id: r18039 --- simon/simon.cpp | 4 ++-- simon/sound.cpp | 44 ++++++++++++++++++++++---------------------- simon/sound.h | 4 ++-- 3 files changed, 26 insertions(+), 26 deletions(-) (limited to 'simon') diff --git a/simon/simon.cpp b/simon/simon.cpp index 31ddcf820d..ccb8ddfc6d 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -673,7 +673,7 @@ int SimonEngine::init(GameDetector &detector) { warning("Sound initialization failed. " "Features of the game that depend on sound synchronization will most likely break"); set_volume(ConfMan.getInt("sfx_volume")); - _mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, ConfMan.getInt("music_volume")); + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); _system->beginGFXTransaction(); initCommonGFX(detector); @@ -4254,7 +4254,7 @@ void SimonEngine::dx_unlock_attached() { } void SimonEngine::set_volume(int volume) { - _mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, volume); + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, volume); } byte SimonEngine::getByte() { diff --git a/simon/sound.cpp b/simon/sound.cpp index ca95d19f2f..d34371874d 100644 --- a/simon/sound.cpp +++ b/simon/sound.cpp @@ -40,35 +40,35 @@ class BaseSound { protected: File *_file; uint32 *_offsets; - SoundMixer *_mixer; + Audio::Mixer *_mixer; bool _freeOffsets; public: - BaseSound(SoundMixer *mixer, File *file, uint32 base = 0, bool bigendian = false); - BaseSound(SoundMixer *mixer, File *file, uint32 *offsets, bool bigendian = false); + BaseSound(Audio::Mixer *mixer, File *file, uint32 base = 0, bool bigendian = false); + BaseSound(Audio::Mixer *mixer, File *file, uint32 *offsets, bool bigendian = false); virtual ~BaseSound(); virtual void playSound(uint sound, SoundHandle *handle, byte flags) = 0; }; class WavSound : public BaseSound { public: - WavSound(SoundMixer *mixer, File *file, uint32 base = 0, bool bigendian = false) : BaseSound(mixer, file, base, bigendian) {}; - WavSound(SoundMixer *mixer, File *file, uint32 *offsets) : BaseSound(mixer, file, offsets) {}; + WavSound(Audio::Mixer *mixer, File *file, uint32 base = 0, bool bigendian = false) : BaseSound(mixer, file, base, bigendian) {}; + WavSound(Audio::Mixer *mixer, File *file, uint32 *offsets) : BaseSound(mixer, file, offsets) {}; void playSound(uint sound, SoundHandle *handle, byte flags); }; class VocSound : public BaseSound { public: - VocSound(SoundMixer *mixer, File *file, uint32 base = 0, bool bigendian = false) : BaseSound(mixer, file, base, bigendian) {}; + VocSound(Audio::Mixer *mixer, File *file, uint32 base = 0, bool bigendian = false) : BaseSound(mixer, file, base, bigendian) {}; void playSound(uint sound, SoundHandle *handle, byte flags); }; class RawSound : public BaseSound { public: - RawSound(SoundMixer *mixer, File *file, uint32 base = 0, bool bigendian = false) : BaseSound(mixer, file, base, bigendian) {}; + RawSound(Audio::Mixer *mixer, File *file, uint32 base = 0, bool bigendian = false) : BaseSound(mixer, file, base, bigendian) {}; void playSound(uint sound, SoundHandle *handle, byte flags); }; -BaseSound::BaseSound(SoundMixer *mixer, File *file, uint32 base, bool bigendian) { +BaseSound::BaseSound(Audio::Mixer *mixer, File *file, uint32 base, bool bigendian) { _mixer = mixer; _file = file; @@ -106,7 +106,7 @@ BaseSound::BaseSound(SoundMixer *mixer, File *file, uint32 base, bool bigendian) _offsets[res] = _file->pos(); } -BaseSound::BaseSound(SoundMixer *mixer, File *file, uint32 *offsets, bool bigendian) { +BaseSound::BaseSound(Audio::Mixer *mixer, File *file, uint32 *offsets, bool bigendian) { _mixer = mixer; _file = file; _offsets = offsets; @@ -131,7 +131,7 @@ void WavSound::playSound(uint sound, SoundHandle *handle, byte flags) { error("playWav(%d): can't read WAVE header", sound); } - _mixer->playInputStream(SoundMixer::kSFXSoundType, handle, stream); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, stream); } void VocSound::playSound(uint sound, SoundHandle *handle, byte flags) { @@ -143,7 +143,7 @@ void VocSound::playSound(uint sound, SoundHandle *handle, byte flags) { int size, samples_per_sec; byte *buffer = loadVOCFromStream(*_file, size, samples_per_sec); - _mixer->playRaw(handle, buffer, size, samples_per_sec, flags | SoundMixer::FLAG_AUTOFREE); + _mixer->playRaw(handle, buffer, size, samples_per_sec, flags | Audio::Mixer::FLAG_AUTOFREE); } void RawSound::playSound(uint sound, SoundHandle *handle, byte flags) { @@ -156,13 +156,13 @@ void RawSound::playSound(uint sound, SoundHandle *handle, byte flags) { byte *buffer = (byte *)malloc(size); _file->read(buffer, size); - _mixer->playRaw(handle, buffer, size, 22050, flags | SoundMixer::FLAG_AUTOFREE); + _mixer->playRaw(handle, buffer, size, 22050, flags | Audio::Mixer::FLAG_AUTOFREE); } #ifdef USE_MAD class MP3Sound : public BaseSound { public: - MP3Sound(SoundMixer *mixer, File *file, uint32 base = 0) : BaseSound(mixer, file, base) {}; + MP3Sound(Audio::Mixer *mixer, File *file, uint32 base = 0) : BaseSound(mixer, file, base) {}; void playSound(uint sound, SoundHandle *handle, byte flags); }; @@ -179,14 +179,14 @@ void MP3Sound::playSound(uint sound, SoundHandle *handle, byte flags) uint32 size = _offsets[sound + i] - _offsets[sound]; - _mixer->playInputStream(SoundMixer::kSFXSoundType, handle, makeMP3Stream(_file, size)); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, makeMP3Stream(_file, size)); } #endif #ifdef USE_VORBIS class VorbisSound : public BaseSound { public: - VorbisSound(SoundMixer *mixer, File *file, uint32 base = 0) : BaseSound(mixer, file, base) {}; + VorbisSound(Audio::Mixer *mixer, File *file, uint32 base = 0) : BaseSound(mixer, file, base) {}; void playSound(uint sound, SoundHandle *handle, byte flags); }; @@ -203,14 +203,14 @@ void VorbisSound::playSound(uint sound, SoundHandle *handle, byte flags) uint32 size = _offsets[sound + i] - _offsets[sound]; - _mixer->playInputStream(SoundMixer::kSFXSoundType, handle, makeVorbisStream(_file, size)); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, makeVorbisStream(_file, size)); } #endif #ifdef USE_FLAC class FlacSound : public BaseSound { public: - FlacSound(SoundMixer *mixer, File *file, uint32 base = 0) : BaseSound(mixer, file, base) {}; + FlacSound(Audio::Mixer *mixer, File *file, uint32 base = 0) : BaseSound(mixer, file, base) {}; void playSound(uint sound, SoundHandle *handle, byte flags); }; @@ -227,11 +227,11 @@ void FlacSound::playSound(uint sound, SoundHandle *handle, byte flags) uint32 size = _offsets[sound + i] - _offsets[sound]; - _mixer->playInputStream(SoundMixer::kSFXSoundType, handle, makeFlacStream(_file, size)); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, makeFlacStream(_file, size)); } #endif -Sound::Sound(const byte game, const GameSpecificSettings *gss, SoundMixer *mixer) +Sound::Sound(const byte game, const GameSpecificSettings *gss, Audio::Mixer *mixer) : _game(game), _mixer(mixer) { _voice = 0; _effects = 0; @@ -444,7 +444,7 @@ void Sound::playVoice(uint sound) { return; _mixer->stopHandle(_voiceHandle); - _voice->playSound(sound, &_voiceHandle, (_game == GAME_SIMON1CD32) ? 0 : SoundMixer::FLAG_UNSIGNED); + _voice->playSound(sound, &_voiceHandle, (_game == GAME_SIMON1CD32) ? 0 : Audio::Mixer::FLAG_UNSIGNED); } void Sound::playEffects(uint sound) { @@ -454,7 +454,7 @@ void Sound::playEffects(uint sound) { if (_effectsPaused) return; - _effects->playSound(sound, &_effectsHandle, (_game == GAME_SIMON1CD32) ? 0 : SoundMixer::FLAG_UNSIGNED); + _effects->playSound(sound, &_effectsHandle, (_game == GAME_SIMON1CD32) ? 0 : Audio::Mixer::FLAG_UNSIGNED); } void Sound::playAmbient(uint sound) { @@ -470,7 +470,7 @@ void Sound::playAmbient(uint sound) { return; _mixer->stopHandle(_ambientHandle); - _effects->playSound(sound, &_ambientHandle, SoundMixer::FLAG_LOOP|SoundMixer::FLAG_UNSIGNED); + _effects->playSound(sound, &_ambientHandle, Audio::Mixer::FLAG_LOOP|Audio::Mixer::FLAG_UNSIGNED); } bool Sound::hasVoice() const { diff --git a/simon/sound.h b/simon/sound.h index c95dd1d321..75efe46cb5 100644 --- a/simon/sound.h +++ b/simon/sound.h @@ -32,7 +32,7 @@ class Sound { private: byte _game; - SoundMixer *_mixer; + Audio::Mixer *_mixer; BaseSound *_voice; BaseSound *_effects; @@ -53,7 +53,7 @@ private: uint _ambientPlaying; public: - Sound(const byte game, const GameSpecificSettings *gss, SoundMixer *mixer); + Sound(const byte game, const GameSpecificSettings *gss, Audio::Mixer *mixer); ~Sound(); void readSfxFile(const char *filename); -- cgit v1.2.3