From 7cd2cb2b1700b85d48aed8898b08b49b9b46ebf8 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 12 Mar 2005 18:56:09 +0000 Subject: PlayingSoundHandle -> SoundHandle; also, turned the handle activity check into a mixer method svn-id: r17106 --- simon/sound.cpp | 26 +++++++++++++------------- simon/sound.h | 6 +++--- simon/vga.cpp | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'simon') diff --git a/simon/sound.cpp b/simon/sound.cpp index 4c2cb6a924..93dc9fddf9 100644 --- a/simon/sound.cpp +++ b/simon/sound.cpp @@ -45,25 +45,25 @@ public: BaseSound(SoundMixer *mixer, File *file, uint32 base = 0, bool bigendian = false); BaseSound(SoundMixer *mixer, File *file, uint32 *offsets, bool bigendian = false); virtual ~BaseSound(); - virtual void playSound(uint sound, PlayingSoundHandle *handle, byte flags) = 0; + 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) {}; - void playSound(uint sound, PlayingSoundHandle *handle, byte flags); + 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) {}; - void playSound(uint sound, PlayingSoundHandle *handle, byte flags); + 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) {}; - void playSound(uint sound, PlayingSoundHandle *handle, byte flags); + void playSound(uint sound, SoundHandle *handle, byte flags); }; BaseSound::BaseSound(SoundMixer *mixer, File *file, uint32 base, bool bigendian) { @@ -117,7 +117,7 @@ BaseSound::~BaseSound() { delete _file; } -void WavSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) { +void WavSound::playSound(uint sound, SoundHandle *handle, byte flags) { if (_offsets == NULL) return; @@ -132,7 +132,7 @@ void WavSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) { _mixer->playInputStream(SoundMixer::kSFXSoundType, handle, stream); } -void VocSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) { +void VocSound::playSound(uint sound, SoundHandle *handle, byte flags) { if (_offsets == NULL) return; @@ -144,7 +144,7 @@ void VocSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) { _mixer->playRaw(handle, buffer, size, samples_per_sec, flags | SoundMixer::FLAG_AUTOFREE); } -void RawSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) { +void RawSound::playSound(uint sound, SoundHandle *handle, byte flags) { if (_offsets == NULL) return; @@ -161,10 +161,10 @@ void RawSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) { class MP3Sound : public BaseSound { public: MP3Sound(SoundMixer *mixer, File *file, uint32 base = 0) : BaseSound(mixer, file, base) {}; - void playSound(uint sound, PlayingSoundHandle *handle, byte flags); + void playSound(uint sound, SoundHandle *handle, byte flags); }; -void MP3Sound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) +void MP3Sound::playSound(uint sound, SoundHandle *handle, byte flags) { if (_offsets == NULL) return; @@ -185,10 +185,10 @@ void MP3Sound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) class VorbisSound : public BaseSound { public: VorbisSound(SoundMixer *mixer, File *file, uint32 base = 0) : BaseSound(mixer, file, base) {}; - void playSound(uint sound, PlayingSoundHandle *handle, byte flags); + void playSound(uint sound, SoundHandle *handle, byte flags); }; -void VorbisSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) +void VorbisSound::playSound(uint sound, SoundHandle *handle, byte flags) { if (_offsets == NULL) return; @@ -209,10 +209,10 @@ void VorbisSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) class FlacSound : public BaseSound { public: FlacSound(SoundMixer *mixer, File *file, uint32 base = 0) : BaseSound(mixer, file, base) {}; - void playSound(uint sound, PlayingSoundHandle *handle, byte flags); + void playSound(uint sound, SoundHandle *handle, byte flags); }; -void FlacSound::playSound(uint sound, PlayingSoundHandle *handle, byte flags) +void FlacSound::playSound(uint sound, SoundHandle *handle, byte flags) { if (_offsets == NULL) return; diff --git a/simon/sound.h b/simon/sound.h index 228b4addea..28c988d1d3 100644 --- a/simon/sound.h +++ b/simon/sound.h @@ -45,9 +45,9 @@ private: uint16 _last_voice_file; public: - PlayingSoundHandle _voice_handle; - PlayingSoundHandle _effects_handle; - PlayingSoundHandle _ambient_handle; + SoundHandle _voice_handle; + SoundHandle _effects_handle; + SoundHandle _ambient_handle; bool _voice_file; uint _ambient_playing; diff --git a/simon/vga.cpp b/simon/vga.cpp index 5ff57296a4..3f2e44a6c4 100644 --- a/simon/vga.cpp +++ b/simon/vga.cpp @@ -1606,7 +1606,7 @@ void SimonEngine::vc_59() { vc_kill_sprite(file, start); } while (++start != end); } else { - if (!_sound->_voice_handle.isActive()) + if (!_mixer->isSoundHandleActive(_sound->_voice_handle)) vc_skip_next_instruction(); } } @@ -1789,7 +1789,7 @@ void SimonEngine::vc_63_palette_thing_2() { void SimonEngine::vc_64_skip_if_no_speech() { // Simon2 - if (!_sound->_voice_handle.isActive() || (_subtitles && _language != 20)) + if (!_mixer->isSoundHandleActive(_sound->_voice_handle) || (_subtitles && _language != 20)) vc_skip_next_instruction(); } -- cgit v1.2.3