diff options
author | Paul Gilbert | 2016-08-07 09:49:10 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-08-07 09:49:10 -0400 |
commit | 3c9d72486633fab34694e00ae67dfdccd3c357d4 (patch) | |
tree | 678c0cfe51dd87c3c1d6a3c5896bcdd7504f293a /engines/titanic/sound | |
parent | 3864f316e0df25b82348b6443e2d1774567bc290 (diff) | |
download | scummvm-rg350-3c9d72486633fab34694e00ae67dfdccd3c357d4.tar.gz scummvm-rg350-3c9d72486633fab34694e00ae67dfdccd3c357d4.tar.bz2 scummvm-rg350-3c9d72486633fab34694e00ae67dfdccd3c357d4.zip |
TITANIC: Added sound methods to CGameObject
Diffstat (limited to 'engines/titanic/sound')
-rw-r--r-- | engines/titanic/sound/sound.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/sound/sound.h | 5 | ||||
-rw-r--r-- | engines/titanic/sound/sound_manager.cpp | 13 | ||||
-rw-r--r-- | engines/titanic/sound/sound_manager.h | 5 |
4 files changed, 27 insertions, 0 deletions
diff --git a/engines/titanic/sound/sound.cpp b/engines/titanic/sound/sound.cpp index e499bd5b78..9b894e5eca 100644 --- a/engines/titanic/sound/sound.cpp +++ b/engines/titanic/sound/sound.cpp @@ -204,4 +204,8 @@ void CSound::setCanFree(int handle) { _soundManager.setCanFree(handle); } +void CSound::updateMixer() { + _soundManager.waveMixPump(); +} + } // End of namespace Titanic diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h index 34ef234f2a..d11839be0f 100644 --- a/engines/titanic/sound/sound.h +++ b/engines/titanic/sound/sound.h @@ -177,6 +177,11 @@ public: * Flags that a sound can be freed if a timeout is set */ void setCanFree(int handle); + + /** + * Handles regularly updating the mixer + */ + void updateMixer(); }; } // End of namespace Titanic diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp index 2b5e137a5a..7a188524ad 100644 --- a/engines/titanic/sound/sound_manager.cpp +++ b/engines/titanic/sound/sound_manager.cpp @@ -32,6 +32,19 @@ CSoundManager::CSoundManager() : _musicPercent(75.0), _speechPercent(75.0), _masterPercent(75.0), _parrotPercent(75.0), _handleCtr(1) { } +uint CSoundManager::getModeVolume(int mode) { + switch (mode) { + case -1: + return _masterPercent; + case -2: + return _masterPercent * 30 / 100; + case -3: + return _masterPercent * 15 / 100; + default: + return 0; + } +} + /*------------------------------------------------------------------------*/ void QSoundManagerSounds::add(CWaveFile *waveFile, int iChannel, CEndTalkerFn endFn, TTtalker *talker) { diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h index 91e1167195..466607a1d5 100644 --- a/engines/titanic/sound/sound_manager.h +++ b/engines/titanic/sound/sound_manager.h @@ -202,6 +202,11 @@ public: * Returns the parrot volume percent */ int getParrotVolume() const { return _parrotPercent; } + + /** + * Gets the volume for a given mode? value + */ + uint getModeVolume(int mode); }; class QSoundManagerSound : public ListItem { |