diff options
author | Joost Peters | 2004-03-09 01:48:12 +0000 |
---|---|---|
committer | Joost Peters | 2004-03-09 01:48:12 +0000 |
commit | 99d57c2d9f3aaf627cbe6b4434a17b1755ca4873 (patch) | |
tree | e2f7f6133ee0017ff8871c994cde03cb6e2c61ae | |
parent | 1020f97ceab9f1a606abf0bf6a0160b4136fab46 (diff) | |
download | scummvm-rg350-99d57c2d9f3aaf627cbe6b4434a17b1755ca4873.tar.gz scummvm-rg350-99d57c2d9f3aaf627cbe6b4434a17b1755ca4873.tar.bz2 scummvm-rg350-99d57c2d9f3aaf627cbe6b4434a17b1755ca4873.zip |
Respond to volume-altering songs
svn-id: r13225
-rw-r--r-- | queen/music.cpp | 7 | ||||
-rw-r--r-- | queen/music.h | 4 | ||||
-rw-r--r-- | queen/sound.cpp | 1 |
3 files changed, 10 insertions, 2 deletions
diff --git a/queen/music.cpp b/queen/music.cpp index f9512318c3..b8e86f7543 100644 --- a/queen/music.cpp +++ b/queen/music.cpp @@ -318,7 +318,7 @@ static const byte mt32_to_gm[128] = { return (_musicDataSize - songOffset(songNum)); } - Music::Music(MidiDriver *driver, QueenEngine *vm) { + Music::Music(MidiDriver *driver, QueenEngine *vm) : _vToggle(false) { if (vm->resource()->isDemo()) { _musicData = vm->resource()->loadFile("AQ8.RL", 0, NULL); _musicDataSize = vm->resource()->fileSize("AQ8.RL"); @@ -341,4 +341,9 @@ static const byte mt32_to_gm[128] = { _player->playMusic(); } + void Music::toggleVChange() { + setVolume(_vToggle ? (volume() * 2) : (volume() / 2)); + _vToggle ^= true; + } + } // End of namespace Queen diff --git a/queen/music.h b/queen/music.h index 42d5429b6d..5076d5fba5 100644 --- a/queen/music.h +++ b/queen/music.h @@ -104,11 +104,13 @@ public: void queueTuneList(int16 tuneList) { _player->queueTuneList(tuneList); } void playMusic() { _player->playMusic(); } void stopSong() { _player->stopMusic(); } - + + void toggleVChange(); void setVolume(int vol) { _player->setVolume(vol); } int volume() { return _player->getVolume(); } protected: + bool _vToggle; byte *_musicData; uint32 _musicDataSize; MusicPlayer *_player; diff --git a/queen/sound.cpp b/queen/sound.cpp index 5443885f01..8d560a9af8 100644 --- a/queen/sound.cpp +++ b/queen/sound.cpp @@ -146,6 +146,7 @@ void Sound::playSong(int16 songNum) { break; // Alter song settings (such as volume) and exit case 2: + _vm->music()->toggleVChange(); default: return; break; |