diff options
author | Johannes Schickel | 2008-03-21 16:18:27 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-03-21 16:18:27 +0000 |
commit | a169619526c811f1718bbeb5ed980f68b9d2c8e7 (patch) | |
tree | e419518022095bd4b43ec0de8a4d5e23c88bfe2f /engines/kyra/sound.h | |
parent | 88069c943a6bd94da8d183f943200076d5638148 (diff) | |
download | scummvm-rg350-a169619526c811f1718bbeb5ed980f68b9d2c8e7.tar.gz scummvm-rg350-a169619526c811f1718bbeb5ed980f68b9d2c8e7.tar.bz2 scummvm-rg350-a169619526c811f1718bbeb5ed980f68b9d2c8e7.zip |
- Implemented opcode 97: o2_isAnySoundPlaying
- reworked sound channel handling in HoF
=> fixed some voice related bugs
svn-id: r31209
Diffstat (limited to 'engines/kyra/sound.h')
-rw-r--r-- | engines/kyra/sound.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/engines/kyra/sound.h b/engines/kyra/sound.h index 919cc3ceab..7c3bce38bc 100644 --- a/engines/kyra/sound.h +++ b/engines/kyra/sound.h @@ -52,7 +52,6 @@ #include "sound/softsynth/ym2612.h" #include "kyra/kyra.h" -#include "kyra/kyra_v2.h" namespace Audio { class AudioStream; @@ -149,6 +148,8 @@ public: void enableSFX(bool enable) { _sfxEnabled = enable; } bool sfxEnabled() const { return _sfxEnabled; } + virtual bool voiceFileIsPresent(const char *file); + /** * Plays the specified voice file. * @@ -160,28 +161,29 @@ public: * files * * @param file file to be played + * @param isSfx marks file as sfx instead of voice + * @return channel the voice file is played on */ - virtual void voicePlay(const char *file); + virtual bool voicePlay(const char *file, bool isSfx = false); /** * Checks if a voice is being played. * * @return true when playing, else false */ - bool voiceIsPlaying(); + bool voiceIsPlaying(const char *file = 0); /** * Stops playback of the current voice. */ - void voiceStop(); - + void voiceStop(const char *file = 0); protected: const char *fileListEntry(int file) const { return (_soundDataList != 0 && file >= 0 && file < _soundDataList->_fileListLen) ? _soundDataList->_fileList[file] : ""; } const void *cdaData() const { return _soundDataList != 0 ? _soundDataList->_cdaTracks : 0; } const int cdaTrackNum() const { return _soundDataList != 0 ? _soundDataList->_cdaNumTracks : 0; } enum { - kNumVocHandles = 4 + kNumChannelHandles = 4 }; int _musicEnabled; @@ -194,8 +196,12 @@ protected: private: const AudioDataStruct *_soundDataList; - Audio::AudioStream *_currentVocFile; - Audio::SoundHandle _vocHandles[kNumVocHandles]; + + struct SoundChannel { + Common::String file; + Audio::SoundHandle channelHandle; + }; + SoundChannel _soundChannels[kNumChannelHandles]; struct SpeechCodecs { const char *fileext; @@ -429,7 +435,7 @@ private: int _lastTrack; Audio::AudioStream *_currentSFX; - Audio::SoundHandle _sfxHandles[kNumVocHandles]; + Audio::SoundHandle _sfxHandles[kNumChannelHandles]; //SoundTowns_v2_TwnDriver *_driver; uint8 *_twnTrackData; |