diff options
author | Paweł Kołodziejski | 2008-01-14 17:26:49 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2008-01-14 17:26:49 +0000 |
commit | f15b41596b39deb141a2550d82727659128e11af (patch) | |
tree | 263f7d9d1336758e00b7674bf2ff81c52c980c40 /engines/scumm/imuse_digi/dimuse_track.cpp | |
parent | d167ad4066ce1e8365e04de24cd09202a1e99e37 (diff) | |
download | scummvm-rg350-f15b41596b39deb141a2550d82727659128e11af.tar.gz scummvm-rg350-f15b41596b39deb141a2550d82727659128e11af.tar.bz2 scummvm-rg350-f15b41596b39deb141a2550d82727659128e11af.zip |
implement special case for playing music with beginning offset where other one stopped
svn-id: r30483
Diffstat (limited to 'engines/scumm/imuse_digi/dimuse_track.cpp')
-rw-r--r-- | engines/scumm/imuse_digi/dimuse_track.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp index 7421244662..d1e20c5f9c 100644 --- a/engines/scumm/imuse_digi/dimuse_track.cpp +++ b/engines/scumm/imuse_digi/dimuse_track.cpp @@ -80,7 +80,7 @@ int IMuseDigital::allocSlot(int priority) { return trackId; } -void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, int volGroupId, Audio::AudioStream *input, int hookId, int volume, int priority) { +void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, int volGroupId, Audio::AudioStream *input, int hookId, int volume, int priority, Track *otherTrack) { Common::StackLock lock(_mutex, "IMuseDigital::startSound()"); debug(5, "IMuseDigital::startSound(%d)", soundId); @@ -153,6 +153,13 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, track->mixerFlags |= kFlagLittleEndian; #endif + if (otherTrack && otherTrack->used && !otherTrack->toBeRemoved) { + track->curRegion = otherTrack->curRegion; + track->regionOffset = otherTrack->regionOffset; + track->dataOffset = otherTrack->dataOffset; + track->dataMod12Bit = otherTrack->dataMod12Bit; + } + track->stream = Audio::makeAppendableAudioStream(freq, makeMixerFlags(track->mixerFlags)); _mixer->playInputStream(track->getType(), &track->mixChanHandle, track->stream, -1, track->getVol(), track->getPan()); } @@ -267,6 +274,20 @@ void IMuseDigital::setFade(int soundId, int destVolume, int delay60HzTicks) { } } +void IMuseDigital::fadeOutMusicAndStartNew(int fadeDelay, const char *filename, int soundId) { + Common::StackLock lock(_mutex, "IMuseDigital::fadeOutMusicAndStartNew()"); + debug(5, "IMuseDigital::fadeOutMusicAndStartNew"); + + for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { + Track *track = _track[l]; + if (track->used && !track->toBeRemoved && (track->volGroupId == IMUSE_VOLGRP_MUSIC)) { + startMusicWithOtherPos(filename, soundId, 0, 127, track); + cloneToFadeOutTrack(track, fadeDelay); + flushTrack(track); + } + } +} + void IMuseDigital::fadeOutMusic(int fadeDelay) { Common::StackLock lock(_mutex, "IMuseDigital::fadeOutMusic()"); debug(5, "IMuseDigital::fadeOutMusic"); @@ -276,6 +297,7 @@ void IMuseDigital::fadeOutMusic(int fadeDelay) { if (track->used && !track->toBeRemoved && (track->volGroupId == IMUSE_VOLGRP_MUSIC)) { cloneToFadeOutTrack(track, fadeDelay); flushTrack(track); + break; } } } |