diff options
author | Paul Gilbert | 2016-05-04 20:30:52 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:38:19 -0400 |
commit | b79ed60a8eca775613ec0b36d345dd8fcb4e5f08 (patch) | |
tree | 9f53258bb5aeae1a1daf030202c259b4b745c8c7 /engines/titanic/sound/sound.h | |
parent | 4963c9f50b53cbd663c18387d8606ad4623cca34 (diff) | |
download | scummvm-rg350-b79ed60a8eca775613ec0b36d345dd8fcb4e5f08.tar.gz scummvm-rg350-b79ed60a8eca775613ec0b36d345dd8fcb4e5f08.tar.bz2 scummvm-rg350-b79ed60a8eca775613ec0b36d345dd8fcb4e5f08.zip |
TITANIC: Added loadSound, support methods, and CSoundItem class
Diffstat (limited to 'engines/titanic/sound/sound.h')
-rw-r--r-- | engines/titanic/sound/sound.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h index 488d4deb5e..19a8edfc21 100644 --- a/engines/titanic/sound/sound.h +++ b/engines/titanic/sound/sound.h @@ -25,15 +25,46 @@ #include "titanic/support/simple_file.h" #include "titanic/sound/sound_manager.h" +#include "titanic/core/list.h" #include "titanic/core/view_item.h" namespace Titanic { class CGameManager; +class CSoundItem : public ListItem { +public: + CString _name; + uint _soundHandle; + int _field1C; + int _field20; + int _field24; + int _field28; +public: + CSoundItem() : ListItem(), _soundHandle(0), _field1C(0), + _field20(0), _field24(0), _field28(0) {} + CSoundItem(const CString &name) : ListItem(), _name(name), + _soundHandle(0), _field1C(0), _field20(0), _field24(0), _field28(0) {} +}; + +class CSoundItemList : public List<CSoundItem> { +}; + class CSound { private: CGameManager *_gameManager; + CSoundItemList _sounds; +private: + /** + * Check whether any sounds are done and can be be removed + */ + void checkSounds(); + + /** + * Removes the oldest sound from the sounds list that isn't + * currently playing + */ + void removeOldest(); public: QSoundManager _soundManager; public: @@ -74,6 +105,13 @@ public: */ void preEnterView(CViewItem *newView, bool isNewRoom); + /** + * Load a sound + * @param name Name of sound resource + * @returns Sound handle Id + */ + uint loadSound(const CString &name); + bool fn1(int val); void fn2(int val); void fn3(int val, int val2, int val3); |