diff options
author | Strangerke | 2014-11-02 12:00:50 +0100 |
---|---|---|
committer | Paul Gilbert | 2014-12-12 22:20:16 -0500 |
commit | 335acfac892ab071d791db46161d5ca4c8868109 (patch) | |
tree | d52af8d878a972ed21a6e00d8496ff3f1962f882 /engines/access | |
parent | c03845258843a7b0d1db792ea42a986bf79c917a (diff) | |
download | scummvm-rg350-335acfac892ab071d791db46161d5ca4c8868109.tar.gz scummvm-rg350-335acfac892ab071d791db46161d5ca4c8868109.tar.bz2 scummvm-rg350-335acfac892ab071d791db46161d5ca4c8868109.zip |
ACCESS: Implement newMusic()
Diffstat (limited to 'engines/access')
-rw-r--r-- | engines/access/sound.cpp | 18 | ||||
-rw-r--r-- | engines/access/sound.h | 1 |
2 files changed, 18 insertions, 1 deletions
diff --git a/engines/access/sound.cpp b/engines/access/sound.cpp index 90818ed5d3..072261dbf2 100644 --- a/engines/access/sound.cpp +++ b/engines/access/sound.cpp @@ -30,6 +30,7 @@ namespace Access { SoundManager::SoundManager(AccessEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) { _music = nullptr; + _tempMusic = nullptr; _musicRepeat = false; _playingSound = false; _isVoice = false; @@ -37,6 +38,8 @@ SoundManager::SoundManager(AccessEngine *vm, Audio::Mixer *mixer) : SoundManager::~SoundManager() { clearSounds(); + delete _music; + delete _tempMusic; } void SoundManager::clearSounds() { @@ -95,7 +98,20 @@ void SoundManager::freeSounds() { } void SoundManager::newMusic(int musicId, int mode) { - warning("TODO: newMusic"); + if (mode == 1) { + stopSong(); + freeMusic(); + _music = _tempMusic; + _tempMusic = nullptr; + _musicRepeat = true; + if (_music) + midiPlay(); + } else { + _musicRepeat = (mode == 2); + _tempMusic = _music; + stopSong(); + _music = loadSound(97, musicId); + } } void SoundManager::freeMusic() { diff --git a/engines/access/sound.h b/engines/access/sound.h index cc02229b3b..5c130661a7 100644 --- a/engines/access/sound.h +++ b/engines/access/sound.h @@ -46,6 +46,7 @@ public: Common::Array<Resource *> _soundTable; Common::Array<int> _soundPriority; Resource *_music; + Resource *_tempMusic; bool _musicRepeat; bool _playingSound; bool _isVoice; |