aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/sound.h
diff options
context:
space:
mode:
authorNipun Garg2019-07-25 02:21:35 +0530
committerEugene Sandulenko2019-09-03 17:17:28 +0200
commit1a7fc846cf2b62c9a91615b207ba2c8e6e60111a (patch)
tree9b1526c04146da8fdba67c1f92dcf839c5542f16 /engines/hdb/sound.h
parenta50e1469b7530bab111b9dd68999cdffe4e827b9 (diff)
downloadscummvm-rg350-1a7fc846cf2b62c9a91615b207ba2c8e6e60111a.tar.gz
scummvm-rg350-1a7fc846cf2b62c9a91615b207ba2c8e6e60111a.tar.bz2
scummvm-rg350-1a7fc846cf2b62c9a91615b207ba2c8e6e60111a.zip
HDB: Add Sound Cache
Diffstat (limited to 'engines/hdb/sound.h')
-rw-r--r--engines/hdb/sound.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/engines/hdb/sound.h b/engines/hdb/sound.h
index a5a23fdd69..0dbb1cfc30 100644
--- a/engines/hdb/sound.h
+++ b/engines/hdb/sound.h
@@ -51,7 +51,7 @@ namespace HDB {
enum {
kMaxSNDChannels = 32,
- kSNDFrequency = 22050,
+ kMaxSounds = 5000,
kLaserChannel = kMaxSNDChannels - 1,
kMusicChannel = kMaxSNDChannels - 2,
kVoiceChannel = kMaxSNDChannels - 5
@@ -1408,9 +1408,24 @@ struct SoundLookUp {
const char *luaName; // name for Lua code to use
};
+struct SoundCache {
+ int loaded; // -1 = freeable; in memory, 0 = not cached, 1 = cached
+ int32 size; // size of sound
+ const char *name; // filename / MSD name
+ const char *luaName; // name used by Lua for i.d.
+ //void *data; // actual file data
+ //FSOUND_SAMPLE *sample; // used to play sound in FMOD
+
+ SoundCache() : loaded(0), size(0), name(nullptr), luaName(nullptr) {
+
+ }
+};
+
class Sound {
public:
+ Sound();
+
void test(); // FIXME. Remove
bool init();
@@ -1450,10 +1465,22 @@ public:
bool stopChannel(int channel);
int registerSound(const char *name);
bool freeSound(int index);
+ const char *getSNDLuaName(int index);
+ int getSNDIndex(const char *name);
+ int getNumSounds() {
+ return _numSounds;
+ }
SoundType whatSongIsPlaying();
void markSoundCacheFreeable();
+
+ // Sound Caching System Variables
+
+ SoundCache _soundCache[kMaxSounds];
+ int _numSounds;
+ int _sfxVolume;
+
};
} // End of Namespace