added function to interrupt voice

svn-id: r5869
This commit is contained in:
Oliver Kiehl 2002-12-07 17:35:34 +00:00
parent ba0abd27d7
commit 0ecd439fe1
2 changed files with 8 additions and 1 deletions

View File

@ -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();

View File

@ -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);