diff options
author | Max Horn | 2008-01-05 22:57:36 +0000 |
---|---|---|
committer | Max Horn | 2008-01-05 22:57:36 +0000 |
commit | 56ad5f493e5ead7915b687d1d25e73adee5ffbff (patch) | |
tree | 2ce8f4a3720e83a74dfb74355673f22b0cf5a6e6 /engines | |
parent | 7ebdffb0cd1bb7f8bcaa2359d8a94c7a109b5104 (diff) | |
download | scummvm-rg350-56ad5f493e5ead7915b687d1d25e73adee5ffbff.tar.gz scummvm-rg350-56ad5f493e5ead7915b687d1d25e73adee5ffbff.tar.bz2 scummvm-rg350-56ad5f493e5ead7915b687d1d25e73adee5ffbff.zip |
Play SOU data instantly, not slightly delayed -> allows us to get rid of Track::streamSou & Track::mixerStreamRunning (have not yet removed the latter to avoid introducing a new savegame version)
svn-id: r30268
Diffstat (limited to 'engines')
-rw-r--r-- | engines/scumm/imuse_digi/dimuse.cpp | 16 | ||||
-rw-r--r-- | engines/scumm/imuse_digi/dimuse.h | 3 | ||||
-rw-r--r-- | engines/scumm/imuse_digi/dimuse_track.cpp | 5 |
3 files changed, 6 insertions, 18 deletions
diff --git a/engines/scumm/imuse_digi/dimuse.cpp b/engines/scumm/imuse_digi/dimuse.cpp index 25091e5309..c79cc833ee 100644 --- a/engines/scumm/imuse_digi/dimuse.cpp +++ b/engines/scumm/imuse_digi/dimuse.cpp @@ -39,7 +39,7 @@ namespace Scumm { IMuseDigital::Track::Track() - : soundId(-1), used(false), stream(NULL), streamSou(NULL) { + : soundId(-1), used(false), stream(NULL) { } void IMuseDigital::timer_handler(void *refCon) { @@ -129,7 +129,7 @@ void IMuseDigital::saveOrLoad(Serializer *ser) { MKLINE(Track, used, sleByte, VER(31)), MKLINE(Track, toBeRemoved, sleByte, VER(31)), MKLINE(Track, souStreamUsed, sleByte, VER(31)), - MKLINE(Track, mixerStreamRunning, sleByte, VER(31)), + MKLINE(Track, mixerStreamRunning, sleByte, VER(31)), // FIXME: OBSOLETE, remove this! MKLINE(Track, soundPriority, sleInt32, VER(31)), MKLINE(Track, regionOffset, sleInt32, VER(31)), MK_OBSOLETE(Track, trackOffset, sleInt32, VER(31), VER(31)), @@ -336,16 +336,8 @@ void IMuseDigital::callback() { } while (feedSize != 0); } else { if (_mixer->isReady()) { - // FIXME: Can't we replace track->mixerStreamRunning by - // _mixer->isSoundHandleActive(track->mixChanHandle) ? - if (!track->mixerStreamRunning) { - track->mixerStreamRunning = true; - assert(track->streamSou); - _mixer->playInputStream(track->getType(), &track->mixChanHandle, track->streamSou, -1, track->getVol(), track->getPan()); - } else { - _mixer->setChannelVolume(track->mixChanHandle, track->getVol()); - _mixer->setChannelBalance(track->mixChanHandle, track->getPan()); - } + _mixer->setChannelVolume(track->mixChanHandle, track->getVol()); + _mixer->setChannelBalance(track->mixChanHandle, track->getPan()); } } } diff --git a/engines/scumm/imuse_digi/dimuse.h b/engines/scumm/imuse_digi/dimuse.h index c7029dac91..cc9a1ea981 100644 --- a/engines/scumm/imuse_digi/dimuse.h +++ b/engines/scumm/imuse_digi/dimuse.h @@ -83,7 +83,7 @@ private: char soundName[15]; // sound name but also filename of sound in bundle data bool used; // flag mean that track is used bool toBeRemoved; // flag mean that track need to be free - bool mixerStreamRunning; // flag mean sound mixer's stream is running + bool mixerStreamRunning; // flag mean sound mixer's stream is running OBSOLETE bool souStreamUsed; // flag mean that track use stream from sou file bool sndDataExtComp;// flag mean that sound data is compressed by scummvm tools int32 soundPriority;// priority level of played sound (0-127) @@ -100,7 +100,6 @@ private: ImuseDigiSndMgr::SoundDesc *soundDesc; // sound handle used by iMuse sound manager Audio::SoundHandle mixChanHandle; // sound mixer's channel handle Audio::AppendableAudioStream *stream; // sound mixer's audio stream handle for *.la1 and *.bun - Audio::AudioStream *streamSou; // sound mixer's audio stream handle for *.sou Track(); diff --git a/engines/scumm/imuse_digi/dimuse_track.cpp b/engines/scumm/imuse_digi/dimuse_track.cpp index 96841672a7..c428bb735f 100644 --- a/engines/scumm/imuse_digi/dimuse_track.cpp +++ b/engines/scumm/imuse_digi/dimuse_track.cpp @@ -110,8 +110,7 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, track->souStreamUsed = (input != 0); if (track->souStreamUsed) { - track->streamSou = input; - track->mixerStreamRunning = false; + _mixer->playInputStream(track->getType(), &track->mixChanHandle, input, -1, track->getVol(), track->getPan()); } else { strcpy(track->soundName, soundName); track->soundDesc = _sound->openSound(soundId, soundName, soundType, volGroupId, -1); @@ -157,7 +156,6 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, track->stream = Audio::makeAppendableAudioStream(freq, makeMixerFlags(track->mixerFlags)); _mixer->playInputStream(track->getType(), &track->mixChanHandle, track->stream, -1, track->getVol(), track->getPan(), false); - track->mixerStreamRunning = true; } track->used = true; @@ -319,7 +317,6 @@ IMuseDigital::Track *IMuseDigital::cloneToFadeOutTrack(Track *track, int fadeDel // Create an appendable output buffer fadeTrack->stream = Audio::makeAppendableAudioStream(_sound->getFreq(fadeTrack->soundDesc), makeMixerFlags(fadeTrack->mixerFlags)); _mixer->playInputStream(track->getType(), &fadeTrack->mixChanHandle, fadeTrack->stream, -1, fadeTrack->getVol(), fadeTrack->getPan(), false); - fadeTrack->mixerStreamRunning = true; fadeTrack->used = true; return fadeTrack; |