[Scummvm-cvs-logs] CVS: scummvm/scumm imuse_digi.cpp,1.106,1.107 imuse_digi.h,1.28,1.29
Max Horn
fingolfin at users.sourceforge.net
Sat Dec 27 13:25:01 CET 2003
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv24658
Modified Files:
imuse_digi.cpp imuse_digi.h
Log Message:
fix volume problems (I think...)
Index: imuse_digi.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi.cpp,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- imuse_digi.cpp 27 Dec 2003 20:52:20 -0000 1.106
+++ imuse_digi.cpp 27 Dec 2003 21:14:57 -0000 1.107
@@ -699,7 +699,7 @@
if (_channel[l].used) {
assert(_channel[l].stream);
- if (!_channel[l].handle.isActive()) {
+ if (!_channel[l].handle.isActive() && _channel[l].started) {
debug(5, "IMuseDigital::callback(): stopped sound: %d", _channel[l].idSound);
delete _channel[l].stream;
_channel[l].stream = 0;
@@ -733,11 +733,13 @@
if (_scumm->_mixer->isReady()) {
int pan = (_channel[l].pan != 64) ? 2 * _channel[l].pan - 127 : 0;
- // FIXME: For whatever reasons, vol gets set to extremly low values, which
- // results in the affected sounds not really being audible (e.g. volume
- // 8 out of 255 is *really* quiet).
-// _scumm->_mixer->setChannelVolume(_channel[l].handle, _channel[l].vol / 1000);
- _scumm->_mixer->setChannelPan(_channel[l].handle, pan);
+ if (!_channel[l].started) {
+ _channel[l].started = true;
+ _scumm->_mixer->playInputStream(&_channel[l].handle, _channel[l].stream, true, _channel[l].vol / 1000, _channel[l].pan, -1, false);
+ } else {
+ _scumm->_mixer->setChannelVolume(_channel[l].handle, _channel[l].vol / 1000);
+ _scumm->_mixer->setChannelPan(_channel[l].handle, pan);
+ }
}
}
}
@@ -935,8 +937,7 @@
// Create an AudioInputStream and hook it to the mixer.
_channel[l].stream = makeLinearInputStream(freq, mixerFlags | SoundMixer::FLAG_AUTOFREE, data, size, 0, 0);
- _scumm->_mixer->playInputStream(&_channel[l].handle, _channel[l].stream, true, _channel[l].vol / 1000, _channel[l].pan, -1, false);
-
+ _channel[l].started = false;
_channel[l].used = true;
return;
}
Index: imuse_digi.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- imuse_digi.h 27 Dec 2003 20:52:20 -0000 1.28
+++ imuse_digi.h 27 Dec 2003 21:14:57 -0000 1.29
@@ -79,6 +79,7 @@
int idSound;
bool used;
+ bool started;
PlayingSoundHandle handle;
AudioInputStream *stream;
More information about the Scummvm-git-logs
mailing list