diff options
author | Filippos Karapetis | 2015-12-27 21:20:22 +0200 |
---|---|---|
committer | Filippos Karapetis | 2015-12-27 21:20:22 +0200 |
commit | f382321fb3da513f1075cb24998fdf1d5ce8ff39 (patch) | |
tree | e582e9db9235afe00a19e24f3d64229f406d4bed /engines/lab | |
parent | c5f5fbc208d473d87d42edd64113728bf26153b1 (diff) | |
download | scummvm-rg350-f382321fb3da513f1075cb24998fdf1d5ce8ff39.tar.gz scummvm-rg350-f382321fb3da513f1075cb24998fdf1d5ce8ff39.tar.bz2 scummvm-rg350-f382321fb3da513f1075cb24998fdf1d5ce8ff39.zip |
LAB: Reorder a function
Diffstat (limited to 'engines/lab')
-rw-r--r-- | engines/lab/music.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/engines/lab/music.cpp b/engines/lab/music.cpp index e6ad392029..391200ce09 100644 --- a/engines/lab/music.cpp +++ b/engines/lab/music.cpp @@ -62,6 +62,22 @@ byte Music::getSoundFlags() { return soundFlags; } +void Music::changeMusic(const Common::String filename, bool storeCurPos, bool seektoStoredPos) { + if (storeCurPos) + _storedPos = _musicFile->pos(); + + _musicPaused = false; + stopSoundEffect(); + freeMusic(); + _musicFile = _vm->_resource->openDataFile(filename); + if (seektoStoredPos) + _musicFile->seek(_storedPos); + + Audio::SeekableAudioStream *audioStream = Audio::makeRawStream(_musicFile, SAMPLESPEED, getSoundFlags()); + Audio::LoopingAudioStream *loopingAudioStream = new Audio::LoopingAudioStream(audioStream, 0); + _vm->_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, loopingAudioStream); +} + void Music::playSoundEffect(uint16 sampleSpeed, uint32 length, bool loop, Common::File *dataFile) { pauseBackMusic(); stopSoundEffect(); @@ -130,22 +146,6 @@ void Music::checkRoomMusic() { _curRoomMusic = _vm->_roomNum; } -void Music::changeMusic(const Common::String filename, bool storeCurPos, bool seektoStoredPos) { - if (storeCurPos) - _storedPos = _musicFile->pos(); - - _musicPaused = false; - stopSoundEffect(); - freeMusic(); - _musicFile = _vm->_resource->openDataFile(filename); - if (seektoStoredPos) - _musicFile->seek(_storedPos); - - Audio::SeekableAudioStream *audioStream = Audio::makeRawStream(_musicFile, SAMPLESPEED, getSoundFlags()); - Audio::LoopingAudioStream *loopingAudioStream = new Audio::LoopingAudioStream(audioStream, 0); - _vm->_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, loopingAudioStream); -} - bool Music::loadSoundEffect(const Common::String filename, bool loop, bool waitTillFinished) { Common::File *file = _vm->_resource->openDataFile(filename, MKTAG('D', 'I', 'F', 'F')); stopSoundEffect(); |