aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorOliver Kiehl2002-12-07 17:35:34 +0000
committerOliver Kiehl2002-12-07 17:35:34 +0000
commit0ecd439fe1e719e568f0bab78558aa0314f617ed (patch)
tree14cca70a43d94415882dcc5a6bd5d54dade38905 /simon
parentba0abd27d73ef1048bfa3d86516dec86d129e378 (diff)
downloadscummvm-rg350-0ecd439fe1e719e568f0bab78558aa0314f617ed.tar.gz
scummvm-rg350-0ecd439fe1e719e568f0bab78558aa0314f617ed.tar.bz2
scummvm-rg350-0ecd439fe1e719e568f0bab78558aa0314f617ed.zip
added function to interrupt voice
svn-id: r5869
Diffstat (limited to 'simon')
-rw-r--r--simon/sound.cpp7
-rw-r--r--simon/sound.h2
2 files changed, 8 insertions, 1 deletions
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);