aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/sound.h
diff options
context:
space:
mode:
authorNipun Garg2019-07-26 06:38:04 +0530
committerEugene Sandulenko2019-09-03 17:17:29 +0200
commit2bb60c69cd2a0bde98e3039e5b788fc2bced07b2 (patch)
treeef5a049ff7feefdcc875ee24efd60c6d1384e824 /engines/hdb/sound.h
parent3aa373ab2baaeb96d0113bf3d4ff5923f645f8d1 (diff)
downloadscummvm-rg350-2bb60c69cd2a0bde98e3039e5b788fc2bced07b2.tar.gz
scummvm-rg350-2bb60c69cd2a0bde98e3039e5b788fc2bced07b2.tar.bz2
scummvm-rg350-2bb60c69cd2a0bde98e3039e5b788fc2bced07b2.zip
HDB: Add Music/Song data and functions
Diffstat (limited to 'engines/hdb/sound.h')
-rw-r--r--engines/hdb/sound.h36
1 files changed, 31 insertions, 5 deletions
diff --git a/engines/hdb/sound.h b/engines/hdb/sound.h
index 464663af35..1ed279df96 100644
--- a/engines/hdb/sound.h
+++ b/engines/hdb/sound.h
@@ -1436,6 +1436,28 @@ struct SoundCache {
SoundCache() : loaded(0), size(0), name(nullptr), luaName(nullptr), ext(0) {}
};
+struct Song {
+ bool playing;
+ SoundType song;
+ const char *sndMusic;
+ Audio::SoundHandle *handle;
+
+ bool fadingOut;
+ int fadeOutVol;
+ int fadeOutRamp;
+
+ bool fadingIn;
+ int fadeInVol;
+ int fadeInRamp;
+
+ Song() : playing(false), song(SONG_NONE), sndMusic(nullptr), handle(new Audio::SoundHandle()),
+ fadingOut(false), fadeOutVol(0), fadeOutRamp(0),
+ fadingIn(false), fadeInVol(0), fadeInRamp(0) {}
+ ~Song() {
+ delete handle;
+ }
+};
+
class Sound {
public:
@@ -1446,12 +1468,9 @@ public:
bool init();
void save(Common::OutSaveFile *out);
void loadSaveFile(Common::InSaveFile *in);
- void setMusicVolume(int value) {
- //debug(9, "STUB: Add Music System Variables");
- }
+ void setMusicVolume(int value);
int getMusicVolume() {
- //debug(9, "STUB: Add Music System Variables");
- return 1;
+ return _musicVolume;
}
void setSFXVolume(int value) {
_sfxVolume = value;
@@ -1476,6 +1495,8 @@ public:
bool fadeInMusic(SoundType song, int ramp);
void fadeOutMusic(int ramp);
void stopMusic();
+ bool beginMusic(SoundType song, bool fadeIn, int ramp);
+ void updateMusic();
bool songPlaying(SoundType song);
bool stopChannel(int channel);
int registerSound(const char *name);
@@ -1503,6 +1524,11 @@ public:
int _voicesOn;
byte _voicePlayed[NUM_VOICES];
+ // Music System Variables
+
+ Song _song1, _song2;
+ int _musicVolume;
+
// Sound Caching System Variables
SoundCache _soundCache[kMaxSounds];