diff options
Diffstat (limited to 'engines/scumm/imuse_digi')
-rw-r--r-- | engines/scumm/imuse_digi/dimuse.cpp | 20 | ||||
-rw-r--r-- | engines/scumm/imuse_digi/dimuse.h | 3 | ||||
-rw-r--r-- | engines/scumm/imuse_digi/dimuse_script.cpp | 8 | ||||
-rw-r--r-- | engines/scumm/imuse_digi/dimuse_track.cpp | 4 |
4 files changed, 18 insertions, 17 deletions
diff --git a/engines/scumm/imuse_digi/dimuse.cpp b/engines/scumm/imuse_digi/dimuse.cpp index 537faad92a..8d1dab64a7 100644 --- a/engines/scumm/imuse_digi/dimuse.cpp +++ b/engines/scumm/imuse_digi/dimuse.cpp @@ -44,8 +44,8 @@ void IMuseDigital::timer_handler(void *refCon) { imuseDigital->callback(); } -IMuseDigital::IMuseDigital(ScummEngine_v7 *scumm, int fps) - : _vm(scumm) { +IMuseDigital::IMuseDigital(ScummEngine_v7 *scumm, Audio::Mixer *mixer, int fps) + : _vm(scumm), _mixer(mixer) { _pause = false; _sound = new ImuseDigiSndMgr(_vm); assert(_sound); @@ -200,7 +200,7 @@ void IMuseDigital::saveOrLoad(Serializer *ser) { if (track->volGroupId == 3) type = Audio::Mixer::kMusicSoundType; - _vm->_mixer->playInputStream(type, &track->handle, track->stream, -1, vol, pan, false); + _mixer->playInputStream(type, &track->handle, track->stream, -1, vol, pan, false); } } } @@ -318,9 +318,9 @@ void IMuseDigital::callback() { if (result > mixer_size) result = mixer_size; - if (_vm->_mixer->isReady()) { - _vm->_mixer->setChannelVolume(track->handle, vol); - _vm->_mixer->setChannelBalance(track->handle, pan); + if (_mixer->isReady()) { + _mixer->setChannelVolume(track->handle, vol); + _mixer->setChannelBalance(track->handle, pan); track->stream->append(data, result); track->regionOffset += result; } @@ -335,13 +335,13 @@ void IMuseDigital::callback() { assert(mixer_size >= 0); } while (mixer_size != 0); } else if (track->stream2) { - if (_vm->_mixer->isReady()) { + if (_mixer->isReady()) { if (!track->started) { track->started = true; - _vm->_mixer->playInputStream(type, &track->handle, track->stream2, -1, vol, pan, false); + _mixer->playInputStream(type, &track->handle, track->stream2, -1, vol, pan, false); } else { - _vm->_mixer->setChannelVolume(track->handle, vol); - _vm->_mixer->setChannelBalance(track->handle, pan); + _mixer->setChannelVolume(track->handle, vol); + _mixer->setChannelBalance(track->handle, pan); } } } diff --git a/engines/scumm/imuse_digi/dimuse.h b/engines/scumm/imuse_digi/dimuse.h index 0a3ed5b2f5..fe8120c758 100644 --- a/engines/scumm/imuse_digi/dimuse.h +++ b/engines/scumm/imuse_digi/dimuse.h @@ -90,6 +90,7 @@ private: Common::Mutex _mutex; ScummEngine_v7 *_vm; + Audio::Mixer *_mixer; ImuseDigiSndMgr *_sound; char *_audioNames; @@ -131,7 +132,7 @@ private: void playDigMusic(const char *songName, const imuseDigTable *table, int atribPos, bool sequence); public: - IMuseDigital(ScummEngine_v7 *scumm, int fps); + IMuseDigital(ScummEngine_v7 *scumm, Audio::Mixer *mixer, int fps); virtual ~IMuseDigital(); void setAudioNames(int32 num, char *names); diff --git a/engines/scumm/imuse_digi/dimuse_script.cpp b/engines/scumm/imuse_digi/dimuse_script.cpp index b55855262d..0c131775ea 100644 --- a/engines/scumm/imuse_digi/dimuse_script.cpp +++ b/engines/scumm/imuse_digi/dimuse_script.cpp @@ -172,9 +172,9 @@ void IMuseDigital::flushTracks() { track->stream->finish(); } if (track->stream->endOfStream() - || _vm->_mixer->isPaused() // hack for paused Mixer + || _mixer->isPaused() // hack for paused Mixer || _vm->_insaneRunning) { // INSANE hack for sync timer mode - _vm->_mixer->stopHandle(track->handle); + _mixer->stopHandle(track->handle); delete track->stream; track->stream = NULL; _sound->closeSound(track->soundHandle); @@ -182,7 +182,7 @@ void IMuseDigital::flushTracks() { track->used = false; } } else if (track->stream2) { - _vm->_mixer->stopHandle(track->handle); + _mixer->stopHandle(track->handle); delete track->stream2; track->stream2 = NULL; track->used = false; @@ -285,7 +285,7 @@ int IMuseDigital::getSoundStatus(int sound) const { for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { Track *track = _track[l]; if (track->soundId == sound) { - if ((track->stream2 && _vm->_mixer->isSoundHandleActive(track->handle)) || + if ((track->stream2 && _mixer->isSoundHandleActive(track->handle)) || (track->stream && track->used && !track->readyToRemove)) { return 1; } diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp index eb17887a0b..37ae22f47f 100644 --- a/engines/scumm/imuse_digi/dimuse_track.cpp +++ b/engines/scumm/imuse_digi/dimuse_track.cpp @@ -179,7 +179,7 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, int32 streamBufferSize = track->iteration; track->stream2 = NULL; track->stream = Audio::makeAppendableAudioStream(freq, track->mixerFlags, streamBufferSize); - _vm->_mixer->playInputStream(type, &track->handle, track->stream, -1, vol, pan, false); + _mixer->playInputStream(type, &track->handle, track->stream, -1, vol, pan, false); track->started = true; } @@ -358,7 +358,7 @@ IMuseDigital::Track *IMuseDigital::cloneToFadeOutTrack(Track *track, int fadeDel // setup 1 second stream wrapped buffer int32 streamBufferSize = fadeTrack->iteration; fadeTrack->stream = Audio::makeAppendableAudioStream(_sound->getFreq(fadeTrack->soundHandle), fadeTrack->mixerFlags, streamBufferSize); - _vm->_mixer->playInputStream(type, &fadeTrack->handle, fadeTrack->stream, -1, fadeTrack->vol / 1000, fadeTrack->pan, false); + _mixer->playInputStream(type, &fadeTrack->handle, fadeTrack->stream, -1, fadeTrack->vol / 1000, fadeTrack->pan, false); fadeTrack->started = true; fadeTrack->used = true; |