From 0ecd439fe1e719e568f0bab78558aa0314f617ed Mon Sep 17 00:00:00 2001 From: Oliver Kiehl Date: Sat, 7 Dec 2002 17:35:34 +0000 Subject: added function to interrupt voice svn-id: r5869 --- simon/sound.cpp | 7 ++++++- simon/sound.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'simon') diff --git a/simon/sound.cpp b/simon/sound.cpp index 8eec4222b2..07ba874efd 100644 --- a/simon/sound.cpp +++ b/simon/sound.cpp @@ -117,7 +117,7 @@ void SimonSound::playVoice(uint sound) if (!_voice) return; - _voice->playSound(sound, &_voice_handle); + _voice_index = _voice->playSound(sound, &_voice_handle); } void SimonSound::playEffects(uint sound) @@ -155,6 +155,11 @@ bool SimonSound::hasVoice() return _voice != NULL; } +void SimonSound::stopVoice() +{ + _mixer->stop(_voice_index); +} + void SimonSound::stopAll() { _mixer->stopAll(); diff --git a/simon/sound.h b/simon/sound.h index 88f2e4afaa..3ad0564528 100644 --- a/simon/sound.h +++ b/simon/sound.h @@ -52,6 +52,7 @@ private: }; byte _game; + int _voice_index; int _ambient_index; SoundMixer *_mixer; @@ -78,6 +79,7 @@ public: void playAmbient(uint sound); bool hasVoice(); + void stopVoice(); void stopAll(); void effectsPause(bool b); void ambientPause(bool b); -- cgit v1.2.3