aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-06-21 21:17:08 +0000
committerMax Horn2003-06-21 21:17:08 +0000
commit7c332d7fdb8ae0356ab21368c4903aea4b9b8640 (patch)
tree2276c452371b804477d3d2083e4d9d80accfca47 /scumm
parent1733bafbda15665dad525eb1d0be8ae4a71efd21 (diff)
downloadscummvm-rg350-7c332d7fdb8ae0356ab21368c4903aea4b9b8640.tar.gz
scummvm-rg350-7c332d7fdb8ae0356ab21368c4903aea4b9b8640.tar.bz2
scummvm-rg350-7c332d7fdb8ae0356ab21368c4903aea4b9b8640.zip
modified & cleaned up the playStream/append code a bit; but this API really could stand some refinement
svn-id: r8592
Diffstat (limited to 'scumm')
-rw-r--r--scumm/imuse_digi.cpp9
-rw-r--r--scumm/smush/smush_mixer.cpp4
-rw-r--r--scumm/smush/smush_player.cpp5
-rw-r--r--scumm/sound.cpp10
4 files changed, 14 insertions, 14 deletions
diff --git a/scumm/imuse_digi.cpp b/scumm/imuse_digi.cpp
index fec6a1f2f1..f2bab909da 100644
--- a/scumm/imuse_digi.cpp
+++ b/scumm/imuse_digi.cpp
@@ -821,13 +821,14 @@ void IMuseDigital::handler() {
if (_scumm->_silentDigitalImuse == false) {
if (_channel[l]._initialized == false) {
- _scumm->_mixer->playStream(NULL, l, buf, mixer_size,
+ _scumm->_mixer->playStream(l, buf, mixer_size,
_channel[l]._freq, _channel[l]._mixerFlags, 3, 100000);
_channel[l]._initialized = true;
} else {
- _scumm->_mixer->append(l, buf, mixer_size, _channel[l]._freq, _channel[l]._mixerFlags);
+ _scumm->_mixer->append(l, buf, mixer_size);
}
}
+ free(buf);
}
}
}
@@ -860,7 +861,7 @@ void IMuseDigital::startSound(int sound) {
_channel[l]._bits = 8;
_channel[l]._channels = 2;
_channel[l]._mixerSize = (22050 / 5) * 2;
- _channel[l]._mixerFlags = SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO | SoundMixer::FLAG_UNSIGNED;
+ _channel[l]._mixerFlags = SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO | SoundMixer::FLAG_UNSIGNED;
byte * t_ptr= readCreativeVocFile(ptr, size, _channel[l]._freq, _channel[l]._numLoops);
if (_channel[l]._freq == 22222) {
@@ -960,7 +961,7 @@ void IMuseDigital::startSound(int sound) {
}
}
_channel[l]._mixerSize = (22050 / 5) * 2;
- _channel[l]._mixerFlags = SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO;
+ _channel[l]._mixerFlags = SoundMixer::FLAG_STEREO | SoundMixer::FLAG_REVERSE_STEREO;
if (_channel[l]._bits == 12) {
_channel[l]._mixerSize *= 2;
_channel[l]._mixerFlags |= SoundMixer::FLAG_16BITS;
diff --git a/scumm/smush/smush_mixer.cpp b/scumm/smush/smush_mixer.cpp
index 78f6c02e51..96a0a00ef0 100644
--- a/scumm/smush/smush_mixer.cpp
+++ b/scumm/smush/smush_mixer.cpp
@@ -131,9 +131,9 @@ bool SmushMixer::handleFrame() {
if (_silentMixer == false) {
if (_channels[i].mixer_index == -1) {
- _channels[i].mixer_index = _mixer->playStream(NULL, -1, data, size, rate, flags);
+ _channels[i].mixer_index = _mixer->playStream(-1, data, size, rate, flags);
} else {
- _mixer->append(_channels[i].mixer_index, data, size, rate, flags);
+ _mixer->append(_channels[i].mixer_index, data, size);
}
}
free(data);
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index c9be3863f8..928dbc8f25 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -451,11 +451,10 @@ void SmushPlayer::handleImuseAction(Chunk &b) {
} while (--count);
if (_IACTchannel == -1) {
- _IACTchannel = _scumm->_mixer->playStream(NULL, -1, output_data, 0x1000, 22050,
+ _IACTchannel = _scumm->_mixer->playStream(-1, output_data, 0x1000, 22050,
SoundMixer::FLAG_STEREO | SoundMixer::FLAG_16BITS, -1, 200000);
} else {
- _scumm->_mixer->append(_IACTchannel, output_data, 0x1000, 22050,
- SoundMixer::FLAG_STEREO | SoundMixer::FLAG_16BITS);
+ _scumm->_mixer->append(_IACTchannel, output_data, 0x1000);
}
bsize -= len;
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index ae9331a6a3..61daedd78c 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -1170,18 +1170,18 @@ void Sound::bundleMusicHandler(Scumm *scumm) {
final_size = _outputMixerSize;
memcpy(buffer, ptr, _outputMixerSize);
} else {
- warning("Sound::bundleMusicHandler to do more playStream options...");
+ warning("Sound::bundleMusicHandler TODO: more playStream options...");
return;
}
_bundleMusicPosition += final_size;
if (_bundleMusicTrack == -1) {
- _bundleMusicTrack = _scumm->_mixer->playStream(NULL, _scumm->_mixer->_beginSlots - 1, buffer, final_size, rate,
- SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO, -1, 300000);
+ _bundleMusicTrack = _scumm->_mixer->playStream(_scumm->_mixer->_beginSlots - 1, buffer, final_size, rate,
+ SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO, -1, 300000);
} else {
- _scumm->_mixer->append(_bundleMusicTrack, buffer, final_size, rate,
- SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO);
+ _scumm->_mixer->append(_bundleMusicTrack, buffer, final_size);
}
+ free(buffer);
}
int Sound::playBundleSound(char *sound) {