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 --- queen/queen.cpp | 4 ++-- queen/sound.cpp | 12 ++++++------ queen/sound.h | 16 ++++++++-------- 3 files changed, 16 insertions(+), 16 deletions(-) (limited to 'queen') diff --git a/queen/queen.cpp b/queen/queen.cpp index a1d1ecae67..07bdf58a0f 100644 --- a/queen/queen.cpp +++ b/queen/queen.cpp @@ -419,9 +419,9 @@ int QueenEngine::init(GameDetector &detector) { if (!_mixer->isReady()) warning("Sound initialisation failed"); - _mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); // Set mixer music volume to maximum, since music volume is regulated by MusicPlayer's MIDI messages - _mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, SoundMixer::kMaxMixerVolume); + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, Audio::Mixer::kMaxMixerVolume); int midiDriver = MidiDriver::detectMusicDriver(MDT_NATIVE | MDT_ADLIB | MDT_PREFER_NATIVE); MidiDriver *driver = MidiDriver::createMidi(midiDriver); diff --git a/queen/sound.cpp b/queen/sound.cpp index 7e8b8bc306..3181d15843 100644 --- a/queen/sound.cpp +++ b/queen/sound.cpp @@ -36,14 +36,14 @@ namespace Queen { -Sound::Sound(SoundMixer *mixer, QueenEngine *vm) : +Sound::Sound(Audio::Mixer *mixer, QueenEngine *vm) : _mixer(mixer), _vm(vm), _sfxToggle(true), _speechToggle(true), _musicToggle(true), _lastOverride(0) { } Sound::~Sound() { } -Sound *Sound::giveSound(SoundMixer *mixer, QueenEngine *vm, uint8 compression) { +Sound *Sound::giveSound(Audio::Mixer *mixer, QueenEngine *vm, uint8 compression) { if (!mixer->isReady()) return new SilentSound(mixer, vm); @@ -187,7 +187,7 @@ void Sound::loadState(uint32 ver, byte *&ptr) { } void SBSound::playSound(byte *sound, uint32 size, bool isSpeech) { - byte flags = SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE; + byte flags = Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE; _mixer->playRaw(isSpeech ? &_speechHandle : &_sfxHandle, sound, size, 11025, flags); } @@ -201,7 +201,7 @@ void SBSound::sfxPlay(const char *name, bool isSpeech) { void MP3Sound::sfxPlay(const char *name, bool isSpeech) { uint32 size; Common::File *f = _vm->resource()->giveCompressedSound(name, &size); - _mixer->playInputStream(SoundMixer::kSFXSoundType, isSpeech ? &_speechHandle : &_sfxHandle, makeMP3Stream(f, size)); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, isSpeech ? &_speechHandle : &_sfxHandle, makeMP3Stream(f, size)); } #endif @@ -209,7 +209,7 @@ void MP3Sound::sfxPlay(const char *name, bool isSpeech) { void OGGSound::sfxPlay(const char *name, bool isSpeech) { uint32 size; Common::File *f = _vm->resource()->giveCompressedSound(name, &size); - _mixer->playInputStream(SoundMixer::kSFXSoundType, isSpeech ? &_speechHandle : &_sfxHandle, makeVorbisStream(f, size)); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, isSpeech ? &_speechHandle : &_sfxHandle, makeVorbisStream(f, size)); } #endif @@ -217,7 +217,7 @@ void OGGSound::sfxPlay(const char *name, bool isSpeech) { void FLACSound::sfxPlay(const char *name, bool isSpeech) { uint32 size; Common::File *f = _vm->resource()->giveCompressedSound(name, &size); - _mixer->playInputStream(SoundMixer::kSFXSoundType, isSpeech ? &_speechHandle : &_sfxHandle, makeFlacStream(f, size)); + _mixer->playInputStream(Audio::Mixer::kSFXSoundType, isSpeech ? &_speechHandle : &_sfxHandle, makeFlacStream(f, size)); } #endif diff --git a/queen/sound.h b/queen/sound.h index 6aaee1d2bf..34e860a567 100644 --- a/queen/sound.h +++ b/queen/sound.h @@ -51,10 +51,10 @@ class QueenEngine; class Sound { public: - Sound(SoundMixer *mixer, QueenEngine *vm); + Sound(Audio::Mixer *mixer, QueenEngine *vm); virtual ~Sound(); virtual void sfxPlay(const char *name, bool isSpeech) = 0; - static Sound *giveSound(SoundMixer *mixer, QueenEngine *vm, uint8 compression); + static Sound *giveSound(Audio::Mixer *mixer, QueenEngine *vm, uint8 compression); void playSfx(uint16 sfx, bool isSpeech); void playSfx(const char *base, bool isSpeech); void playSong(int16 songNum); @@ -103,7 +103,7 @@ public: protected: void waitFinished(bool isSpeech); - SoundMixer *_mixer; + Audio::Mixer *_mixer; QueenEngine *_vm; bool _sfxToggle; @@ -118,13 +118,13 @@ protected: class SilentSound : public Sound { public: - SilentSound(SoundMixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {}; + SilentSound(Audio::Mixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {}; void sfxPlay(const char *name, bool isSpeech) { } }; class SBSound : public Sound { public: - SBSound(SoundMixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {}; + SBSound(Audio::Mixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {}; void sfxPlay(const char *name, bool isSpeech); protected: void playSound(byte *sound, uint32 size, bool isSpeech); @@ -133,7 +133,7 @@ protected: #ifdef USE_MAD class MP3Sound : public Sound { public: - MP3Sound(SoundMixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {}; + MP3Sound(Audio::Mixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {}; void sfxPlay(const char *name, bool isSpeech); }; #endif @@ -141,7 +141,7 @@ public: #ifdef USE_VORBIS class OGGSound : public Sound { public: - OGGSound(SoundMixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {}; + OGGSound(Audio::Mixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {}; void sfxPlay(const char *name, bool isSpeech); }; #endif @@ -149,7 +149,7 @@ public: #ifdef USE_FLAC class FLACSound : public Sound { public: - FLACSound(SoundMixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {}; + FLACSound(Audio::Mixer *mixer, QueenEngine *vm) : Sound(mixer, vm) {}; void sfxPlay(const char *name, bool isSpeech); }; #endif // #ifdef USE_FLAC -- cgit v1.2.3