From fe8c2b89b1266f64cfd7e4b5123d4c0bcb831163 Mon Sep 17 00:00:00 2001 From: Paweł Kołodziejski Date: Mon, 21 Jan 2008 00:10:14 +0000 Subject: for debug logs for dimuse svn-id: r30594 --- engines/scumm/imuse_digi/dimuse_script.cpp | 27 +++++++++++++++------------ engines/scumm/imuse_digi/dimuse_track.cpp | 24 ++++++++++++++++-------- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/engines/scumm/imuse_digi/dimuse_script.cpp b/engines/scumm/imuse_digi/dimuse_script.cpp index 8a05f31110..e4943e803e 100644 --- a/engines/scumm/imuse_digi/dimuse_script.cpp +++ b/engines/scumm/imuse_digi/dimuse_script.cpp @@ -152,15 +152,15 @@ void IMuseDigital::parseScriptCmds(int cmd, int b, int c, int d, int e, int f, i } break; case 0x2000: // ImuseSetGroupSfxVolume - debug(3, "ImuseSetGroupSFXVolume (%d)", b); + debug(5, "ImuseSetGroupSFXVolume (%d)", b); // setGroupSfxVolume(b); break; case 0x2001: // ImuseSetGroupVoiceVolume - debug(3, "ImuseSetGroupVoiceVolume (%d)", b); + debug(5, "ImuseSetGroupVoiceVolume (%d)", b); // setGroupVoiceVolume(b); break; case 0x2002: // ImuseSetGroupMusicVolume - debug(3, "ImuseSetGroupMusicVolume (%d)", b); + debug(5, "ImuseSetGroupMusicVolume (%d)", b); // setGroupMusicVolume(b); break; default: @@ -209,6 +209,7 @@ void IMuseDigital::refreshScripts() { debug(6, "refreshScripts()"); if (_stopingSequence) { + debug(5, "refreshScripts() Force restore music state"); parseScriptCmds(0x1001, 0, 0, 0, 0, 0, 0, 0); _stopingSequence = false; } @@ -222,7 +223,7 @@ void IMuseDigital::refreshScripts() { } if (!found && _curMusicState) { - debug(5, "refreshScripts() Start Sequence"); + debug(5, "refreshScripts() Restore music state"); parseScriptCmds(0x1001, 0, 0, 0, 0, 0, 0, 0); } } @@ -233,7 +234,7 @@ void IMuseDigital::startVoice(int soundId, Audio::AudioStream *input) { } void IMuseDigital::startVoice(int soundId, const char *soundName) { - debug(5, "startVoiceBundle(%s)", soundName); + debug(5, "startVoiceBundle(%s, %d)", soundName, soundId); startSound(soundId, soundName, IMUSE_BUNDLE, IMUSE_VOLGRP_VOICE, NULL, 0, 127, 127, NULL); } @@ -243,12 +244,12 @@ void IMuseDigital::startMusic(int soundId, int volume) { } void IMuseDigital::startMusic(const char *soundName, int soundId, int hookId, int volume) { - debug(5, "startMusicBundle(%s)", soundName); + debug(5, "startMusicBundle(%s, soundId:%d, hookId:%d)", soundName, soundId, hookId); startSound(soundId, soundName, IMUSE_BUNDLE, IMUSE_VOLGRP_MUSIC, NULL, hookId, volume, 126, NULL); } void IMuseDigital::startMusicWithOtherPos(const char *soundName, int soundId, int hookId, int volume, Track *otherTrack) { - debug(5, "startMusicWithOtherPos(%s)", soundName); + debug(5, "startMusicWithOtherPos(%s, soundId:%d, hookId:%d, oldSoundId:%d)", soundName, soundId, hookId, otherTrack->soundId); startSound(soundId, soundName, IMUSE_BUNDLE, IMUSE_VOLGRP_MUSIC, NULL, hookId, volume, 126, otherTrack); } @@ -326,6 +327,7 @@ void IMuseDigital::stopSound(int soundId) { for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { Track *track = _track[l]; if (track->used && !track->toBeRemoved && (track->soundId == soundId)) { + debug(5, "IMuseDigital::stopSound(%d) - stopping sound", soundId); flushTrack(track); } } @@ -343,7 +345,7 @@ int32 IMuseDigital::getCurMusicPosInMs() { } int32 msPos = getPosInMs(soundId); - debug(5, "IMuseDigital::getCurMusicPosInMs(%d) = %d", soundId, msPos); + debug(6, "IMuseDigital::getCurMusicPosInMs(%d) = %d", soundId, msPos); return msPos; } @@ -352,7 +354,7 @@ int32 IMuseDigital::getCurVoiceLipSyncWidth() { int32 msPos = getPosInMs(kTalkSoundID) + 50; int32 width = 0, height = 0; - debug(5, "IMuseDigital::getCurVoiceLipSyncWidth(%d)", kTalkSoundID); + debug(6, "IMuseDigital::getCurVoiceLipSyncWidth(%d)", kTalkSoundID); getLipSync(kTalkSoundID, 0, msPos, width, height); return width; } @@ -362,7 +364,7 @@ int32 IMuseDigital::getCurVoiceLipSyncHeight() { int32 msPos = getPosInMs(kTalkSoundID) + 50; int32 width = 0, height = 0; - debug(5, "IMuseDigital::getCurVoiceLipSyncHeight(%d)", kTalkSoundID); + debug(6, "IMuseDigital::getCurVoiceLipSyncHeight(%d)", kTalkSoundID); getLipSync(kTalkSoundID, 0, msPos, width, height); return height; } @@ -381,7 +383,7 @@ int32 IMuseDigital::getCurMusicLipSyncWidth(int syncId) { int32 msPos = getPosInMs(soundId) + 50; int32 width = 0, height = 0; - debug(5, "IMuseDigital::getCurVoiceLipSyncWidth(%d, %d)", soundId, msPos); + debug(6, "IMuseDigital::getCurVoiceLipSyncWidth(%d, %d)", soundId, msPos); getLipSync(soundId, syncId, msPos, width, height); return width; } @@ -400,7 +402,7 @@ int32 IMuseDigital::getCurMusicLipSyncHeight(int syncId) { int32 msPos = getPosInMs(soundId) + 50; int32 width = 0, height = 0; - debug(5, "IMuseDigital::getCurVoiceLipSyncHeight(%d, %d)", soundId, msPos); + debug(6, "IMuseDigital::getCurVoiceLipSyncHeight(%d, %d)", soundId, msPos); getLipSync(soundId, syncId, msPos, width, height); return height; } @@ -417,6 +419,7 @@ void IMuseDigital::stopAllSounds() { // from IMuseDigital::callback either. _mixer->stopHandle(track->mixChanHandle); if (track->soundDesc) { + debug(5, "IMuseDigital::stopAllSounds - stopping sound(%d)", track->soundId); _sound->closeSound(track->soundDesc); } diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp index 05fa2eaddf..8232ea1087 100644 --- a/engines/scumm/imuse_digi/dimuse_track.cpp +++ b/engines/scumm/imuse_digi/dimuse_track.cpp @@ -90,7 +90,7 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, warning("IMuseDigital::startSound() Can't start sound - no free slots"); return; } - debug(5, "IMuseDigital::startSound(%d)(trackId:%d)", soundId, l); + debug(5, "IMuseDigital::startSound(%d, trackId:%d)", soundId, l); Track *track = _track[l]; @@ -182,6 +182,7 @@ void IMuseDigital::setPriority(int soundId, int priority) { for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { Track *track = _track[l]; if (track->used && !track->toBeRemoved && (track->soundId == soundId)) { + debug(5, "IMuseDigital::setPriority(%d) - setting", soundId); track->soundPriority = priority; } } @@ -194,6 +195,7 @@ void IMuseDigital::setVolume(int soundId, int volume) { for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { Track *track = _track[l]; if (track->used && !track->toBeRemoved && (track->soundId == soundId)) { + debug(5, "IMuseDigital::setVolume(%d) - setting", soundId); track->vol = volume * 1000; } } @@ -232,6 +234,7 @@ void IMuseDigital::setPan(int soundId, int pan) { for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { Track *track = _track[l]; if (track->used && !track->toBeRemoved && (track->soundId == soundId)) { + debug(5, "IMuseDigital::setPan(%d) - setting", soundId); track->pan = pan; } } @@ -248,6 +251,7 @@ void IMuseDigital::selectVolumeGroup(int soundId, int volGroupId) { for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { Track *track = _track[l]; if (track->used && !track->toBeRemoved && (track->soundId == soundId)) { + debug(5, "IMuseDigital::setVolumeGroup(%d) - setting", soundId); track->volGroupId = volGroupId; } } @@ -260,6 +264,7 @@ void IMuseDigital::setFade(int soundId, int destVolume, int delay60HzTicks) { for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { Track *track = _track[l]; if (track->used && !track->toBeRemoved && (track->soundId == soundId)) { + debug(5, "IMuseDigital::setFade(%d) - setting", soundId); track->volFadeDelay = delay60HzTicks; track->volFadeDest = destVolume * 1000; track->volFadeStep = (track->volFadeDest - track->vol) * 60 * (1000 / _callbackFps) / (1000 * delay60HzTicks); @@ -270,11 +275,12 @@ 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"); + debug(5, "IMuseDigital::fadeOutMusicAndStartNew(fade:%d, file:%s, sound:%d)", fadeDelay, filename, soundId); for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { Track *track = _track[l]; if (track->used && !track->toBeRemoved && (track->volGroupId == IMUSE_VOLGRP_MUSIC)) { + debug(5, "IMuseDigital::fadeOutMusicAndStartNew(sound:%d) - starting", soundId); startMusicWithOtherPos(filename, soundId, 0, 127, track); cloneToFadeOutTrack(track, fadeDelay); flushTrack(track); @@ -285,11 +291,12 @@ void IMuseDigital::fadeOutMusicAndStartNew(int fadeDelay, const char *filename, void IMuseDigital::fadeOutMusic(int fadeDelay) { Common::StackLock lock(_mutex, "IMuseDigital::fadeOutMusic()"); - debug(5, "IMuseDigital::fadeOutMusic"); + debug(5, "IMuseDigital::fadeOutMusic(fade:%d)", fadeDelay); for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { Track *track = _track[l]; if (track->used && !track->toBeRemoved && (track->volGroupId == IMUSE_VOLGRP_MUSIC)) { + debug(5, "IMuseDigital::fadeOutMusic(fade:%d, soound:%d)", fadeDelay, track->soundId); cloneToFadeOutTrack(track, fadeDelay); flushTrack(track); break; @@ -299,11 +306,12 @@ void IMuseDigital::fadeOutMusic(int fadeDelay) { void IMuseDigital::setHookIdForMusic(int hookId) { Common::StackLock lock(_mutex, "IMuseDigital::setHookIdForMusic()"); - debug(5, "IMuseDigital::setHookIdForMusic"); + debug(5, "IMuseDigital::setHookIdForMusic(hookId:%d)", hookId); for (int l = 0; l < MAX_DIGITAL_TRACKS; l++) { Track *track = _track[l]; if (track->used && !track->toBeRemoved && (track->volGroupId == IMUSE_VOLGRP_MUSIC)) { + debug(5, "IMuseDigital::setHookIdForMusic - setting for sound:%d", hookId); track->curHookId = hookId; break; } @@ -312,7 +320,7 @@ void IMuseDigital::setHookIdForMusic(int hookId) { void IMuseDigital::setTrigger(TriggerParams *trigger) { Common::StackLock lock(_mutex, "IMuseDigital::setTrigger()"); - debug(5, "IMuseDigital::setTrigger"); + debug(5, "IMuseDigital::setTrigger(%s)", trigger->filename); memcpy(&_triggerParams, trigger, sizeof(TriggerParams)); _triggerUsed = true; @@ -322,7 +330,7 @@ Track *IMuseDigital::cloneToFadeOutTrack(Track *track, int fadeDelay) { assert(track); Track *fadeTrack; - debug(5, "cloneToFadeOutTrack(%d, %d) - begin of func", track->trackId, fadeDelay); + debug(5, "cloneToFadeOutTrack(soundId:%d, fade:%d) - begin of func", track->trackId, fadeDelay); if (track->toBeRemoved) { error("cloneToFadeOutTrack: Tried to clone a track to be removed, please bug report"); @@ -333,7 +341,7 @@ Track *IMuseDigital::cloneToFadeOutTrack(Track *track, int fadeDelay) { fadeTrack = _track[track->trackId + MAX_DIGITAL_TRACKS]; if (fadeTrack->used) { - debug(5, "cloneToFadeOutTrack: No free fade track, force flush"); + debug(5, "cloneToFadeOutTrack: No free fade track, force flush fade soundId:%d", fadeTrack->soundId); flushTrack(fadeTrack); _mixer->stopHandle(fadeTrack->mixChanHandle); } @@ -363,7 +371,7 @@ Track *IMuseDigital::cloneToFadeOutTrack(Track *track, int fadeDelay) { _mixer->playInputStream(track->getType(), &fadeTrack->mixChanHandle, fadeTrack->stream, -1, fadeTrack->getVol(), fadeTrack->getPan()); fadeTrack->used = true; - debug(5, "cloneToFadeOutTrack() - end of func, track %d, fadeTrackId %d", track->trackId, fadeTrack->trackId); + debug(5, "cloneToFadeOutTrack() - end of func, soundId %d, fade soundId %d", track->soundId, fadeTrack->soundId); return fadeTrack; } -- cgit v1.2.3