diff options
author | Paul Gilbert | 2011-05-18 20:32:40 +1000 |
---|---|---|
committer | Paul Gilbert | 2011-05-24 21:27:18 +1000 |
commit | 52fbf6709aaa84574d96b98aedc99b1c611da1e6 (patch) | |
tree | ef830f4dae7e1081c8942642fb8d3936b8053c75 /engines/tsage/sound.h | |
parent | b3fb2b5db8aa73703dc86fdcd06be0d7d0c1b0b6 (diff) | |
download | scummvm-rg350-52fbf6709aaa84574d96b98aedc99b1c611da1e6.tar.gz scummvm-rg350-52fbf6709aaa84574d96b98aedc99b1c611da1e6.tar.bz2 scummvm-rg350-52fbf6709aaa84574d96b98aedc99b1c611da1e6.zip |
TSAGE: Further sound driver installation logic
Diffstat (limited to 'engines/tsage/sound.h')
-rw-r--r-- | engines/tsage/sound.h | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/engines/tsage/sound.h b/engines/tsage/sound.h index 22132bc6ca..591d0e1e07 100644 --- a/engines/tsage/sound.h +++ b/engines/tsage/sound.h @@ -53,14 +53,21 @@ public: Common::String longDescription; }; +struct GroupData { + uint32 groupMask; + byte v1; + byte v2; + const byte *pData; +}; + class SoundDriver { public: Common::String _shortDescription, _longDescription; int _driverNum; int _minVersion, _maxVersion; - uint32 *_groupMaskList; // The following fields were originally held in separate arrays in the SoundManager class uint32 _groupMask; + const GroupData *_groupOffset; public: SoundDriver(); @@ -69,9 +76,32 @@ public: virtual bool open() { return true; } virtual void close() {} - virtual uint32 *getGroupMaskList() const { return _groupMaskList; } + virtual const GroupData *getGroupData() = 0; virtual void setVolume(int volume) {} virtual void installPatchBank(const byte *data) {} + virtual void poll() {} +}; + +struct VoiceStructEntry { + int _field0; + int _field1; + SoundDriver *_driver; + int _field4; + int _field6; + int _field8; + int _field9; + int _fieldA; + int _fieldC; + int _fieldD; +}; + +class VoiceStruct { +public: + int _field0; + int _field1; + int _field2; + + Common::Array<VoiceStructEntry> _entries; }; class SoundManager : public SaveListener { @@ -94,14 +124,16 @@ public: int _field89[SOUND_ARR_SIZE]; uint16 _groupList[SOUND_ARR_SIZE]; int _fieldE9[SOUND_ARR_SIZE]; - Sound *_voiceStructPtrs[SOUND_ARR_SIZE]; + VoiceStruct *_voiceStructPtrs[SOUND_ARR_SIZE]; + bool _needToRethink; public: SoundManager(); ~SoundManager(); - void dispatch() {} + void dispatch(); virtual void listenerSynchronize(Serializer &s); virtual void postInit(); + void syncSounds(); static void saveNotifier(bool postFlag); void saveNotifierProc(bool postFlag); @@ -161,6 +193,8 @@ public: static void _sfDoAddToPlayList(Sound *sound); static bool _sfDoRemoveFromPlayList(Sound *sound); static void _sfDoUpdateVolume(Sound *sound); + static void _sfSoundServer(); + static void _sfProcessFading(); }; class Sound: public EventHandler { @@ -170,7 +204,7 @@ private: void orientAfterRestore(); public: int _field0; - int _field6; + bool _stopFlag; int _soundNum; int _groupNum; int _soundPriority; @@ -246,7 +280,7 @@ class ASound: public EventHandler { public: Sound _sound; Action *_action; - bool _cueFlag; + int _cueValue; ASound(); virtual void synchronize(Serializer &s); @@ -280,9 +314,14 @@ public: }; class AdlibSoundDriver: public SoundDriver { +private: + GroupData _groupData; public: + AdlibSoundDriver(); + virtual void setVolume(int volume) {} virtual void installPatchBank(const byte *data) {} + virtual const GroupData *getGroupData() { return &_groupData; } }; } // End of namespace tSage |