diff options
author | Paweł Kołodziejski | 2004-05-28 20:46:50 +0000 |
---|---|---|
committer | Paweł Kołodziejski | 2004-05-28 20:46:50 +0000 |
commit | b559e5e58fa269168c8f25a87a5965ad757db7d2 (patch) | |
tree | 3bbde7117a811bb22f396af7079cf156acaa22b2 /scumm/imuse_digi | |
parent | ddc104d4efb6568405c58687172ac923b238576a (diff) | |
download | scummvm-rg350-b559e5e58fa269168c8f25a87a5965ad757db7d2.tar.gz scummvm-rg350-b559e5e58fa269168c8f25a87a5965ad757db7d2.tar.bz2 scummvm-rg350-b559e5e58fa269168c8f25a87a5965ad757db7d2.zip |
apply mixer vol/pan at first time
svn-id: r13897
Diffstat (limited to 'scumm/imuse_digi')
-rw-r--r-- | scumm/imuse_digi/dimuse.cpp | 5 | ||||
-rw-r--r-- | scumm/imuse_digi/dimuse_track.cpp | 15 |
2 files changed, 18 insertions, 2 deletions
diff --git a/scumm/imuse_digi/dimuse.cpp b/scumm/imuse_digi/dimuse.cpp index 944cd32592..27bbedc8d0 100644 --- a/scumm/imuse_digi/dimuse.cpp +++ b/scumm/imuse_digi/dimuse.cpp @@ -145,7 +145,7 @@ void IMuseDigital::saveOrLoad(Serializer *ser) { int freq = _sound->getFreq(track->soundHandle); track->stream2 = NULL; track->stream = makeAppendableAudioStream(freq, track->mixerFlags, streamBufferSize); - _vm->_mixer->playInputStream(&track->handle, track->stream, false, track->vol / 1000, track->pan, -1); + _vm->_mixer->playInputStream(&track->handle, track->stream, false, track->mixerVol, track->mixerPan, -1); } } } @@ -198,6 +198,9 @@ void IMuseDigital::callback() { if (track->volGroupId == 3) vol = (vol * _volMusic) / 128; + track->mixerVol = vol; + track->mixerPan = pan; + if (_vm->_mixer->isReady()) { if (track->stream2) { if (!track->started) { diff --git a/scumm/imuse_digi/dimuse_track.cpp b/scumm/imuse_digi/dimuse_track.cpp index c9dfad79bb..df9cd74c63 100644 --- a/scumm/imuse_digi/dimuse_track.cpp +++ b/scumm/imuse_digi/dimuse_track.cpp @@ -155,11 +155,24 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType, track->stream = NULL; track->started = false; } else { + int pan = (track->pan != 64) ? 2 * track->pan - 127 : 0; + int vol = track->vol / 1000; + + if (track->volGroupId == 1) + vol = (vol * _volVoice) / 128; + if (track->volGroupId == 2) + vol = (vol * _volSfx) / 128; + if (track->volGroupId == 3) + vol = (vol * _volMusic) / 128; + + track->mixerPan = pan; + track->mixerVol = vol; + // setup 1 second stream wrapped buffer int32 streamBufferSize = track->iteration; track->stream2 = NULL; track->stream = makeAppendableAudioStream(freq, track->mixerFlags, streamBufferSize); - _vm->_mixer->playInputStream(&track->handle, track->stream, false, track->vol / 1000, track->pan, -1); + _vm->_mixer->playInputStream(&track->handle, track->stream, false, track->mixerVol, track->mixerPan, -1); track->started = true; } |