diff options
author | johndoe123 | 2018-05-26 05:41:53 +1000 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | 617e9439cfa51cdb7221a388762e0661ccd5f5ad (patch) | |
tree | a02f43d5f38dee625e20584dbba72235d50b12b9 /engines/illusions/sound.h | |
parent | aee54f4bca73b35371e9bc13f718209b38bfa731 (diff) | |
download | scummvm-rg350-617e9439cfa51cdb7221a388762e0661ccd5f5ad.tar.gz scummvm-rg350-617e9439cfa51cdb7221a388762e0661ccd5f5ad.tar.bz2 scummvm-rg350-617e9439cfa51cdb7221a388762e0661ccd5f5ad.zip |
ILLUSIONS: DUCKMAN: Implement MIDI music fading
(cherry picked from commit 056b303)
Diffstat (limited to 'engines/illusions/sound.h')
-rw-r--r-- | engines/illusions/sound.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/illusions/sound.h b/engines/illusions/sound.h index 2669102b69..027228ef0b 100644 --- a/engines/illusions/sound.h +++ b/engines/illusions/sound.h @@ -112,6 +112,18 @@ protected: bool _looping; }; +struct MidiMusicFader { + bool _active; + uint _flags; + int16 _currVolume; + int16 _startVolume; + int16 _finalVolume; + int16 _startTime; + int16 _duration; + uint32 _notifyThreadId; + MidiMusicFader() : _active(false), _currVolume(255) {} +}; + class SoundMan { public: SoundMan(IllusionsEngine *vm); @@ -123,6 +135,7 @@ public: void playMidiMusic(uint32 musicId); void stopMidiMusic(); + void fadeMidiMusic(int16 finalVolume, int16 duration, uint32 notifyThreadId); void clearMidiMusicQueue(); uint16 getMusicVolume(); @@ -158,8 +171,10 @@ protected: VoicePlayer *_voicePlayer; SoundList _sounds; Common::Array<uint32> _midiMusicQueue; + MidiMusicFader _midiMusicFader; Sound *getSound(uint32 soundEffectId); void updateMidi(); + void updateMidiMusicFader(); uint16 calcAdjustedVolume(const Common::String &volumeConfigKey, uint16 volume); }; |