diff options
author | athrxx | 2011-11-06 00:55:37 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-12-26 16:18:09 +0100 |
commit | 4098feff57239102a7519e5b7bc1ef8f41465dc2 (patch) | |
tree | de53d0dac0c935f3178e8dcc498b87a99552f388 | |
parent | f2a1ff3f7842757d369db23652b39ed3f2a22144 (diff) | |
download | scummvm-rg350-4098feff57239102a7519e5b7bc1ef8f41465dc2.tar.gz scummvm-rg350-4098feff57239102a7519e5b7bc1ef8f41465dc2.tar.bz2 scummvm-rg350-4098feff57239102a7519e5b7bc1ef8f41465dc2.zip |
KYRA: (AdLib Driver) - allow sound trigger query
-rw-r--r-- | engines/kyra/sound.h | 10 | ||||
-rw-r--r-- | engines/kyra/sound_adlib.cpp | 9 | ||||
-rw-r--r-- | engines/kyra/sound_adlib.h | 3 |
3 files changed, 22 insertions, 0 deletions
diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index 88454e4878..63cec48d00 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -217,6 +217,16 @@ public: * Stops playback of the current voice. */ void voiceStop(const Audio::SoundHandle *handle = 0); + + /** + * Receive notifications from a song at certain points. + */ + virtual int checkTrigger() { return 0; } + + /** + * Reset sound trigger. + */ + virtual void resetTrigger() {} protected: const char *fileListEntry(int file) const { return (_soundDataList != 0 && file >= 0 && file < _soundDataList->fileListLen) ? _soundDataList->fileList[file] : ""; } int fileListLen() const { return _soundDataList->fileListLen; } diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp index 9e47367138..d3b72cb833 100644 --- a/engines/kyra/sound_adlib.cpp +++ b/engines/kyra/sound_adlib.cpp @@ -66,6 +66,7 @@ public: bool isChannelPlaying(int channel) const; void stopAllChannels(); int getSoundTrigger() const { return _soundTrigger; } + void resetSoundTrigger() { _soundTrigger = 0; } void callback(); @@ -2345,6 +2346,14 @@ void SoundAdLibPC::beginFadeOut() { play(1, 0xff); } +int SoundAdLibPC::checkTrigger() { + return _driver->getSoundTrigger(); +} + +void SoundAdLibPC::resetTrigger() { + _driver->resetSoundTrigger(); +} + void SoundAdLibPC::loadSoundFile(uint file) { internalLoadFile(fileListEntry(file)); } diff --git a/engines/kyra/sound_adlib.h b/engines/kyra/sound_adlib.h index 06ec9515ff..8492f3b99a 100644 --- a/engines/kyra/sound_adlib.h +++ b/engines/kyra/sound_adlib.h @@ -79,6 +79,9 @@ public: virtual void playSoundEffect(uint8 track, uint8 volume = 0xff); virtual void beginFadeOut(); + + virtual int checkTrigger(); + virtual void resetTrigger(); private: void internalLoadFile(Common::String file); |