From c51b1266c07d3fbd1d5236a6e5d1dbc1a685203b Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 27 Nov 2004 17:09:05 +0000 Subject: Removed the (highly SCUMM specific) 'appendable stream' API from SoundMixer; SCUMM now uses the appendable stream directly svn-id: r15919 --- scumm/smush/smush_mixer.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'scumm/smush/smush_mixer.cpp') diff --git a/scumm/smush/smush_mixer.cpp b/scumm/smush/smush_mixer.cpp index 3c0471e178..f7309cb87e 100644 --- a/scumm/smush/smush_mixer.cpp +++ b/scumm/smush/smush_mixer.cpp @@ -93,7 +93,8 @@ bool SmushMixer::handleFrame() { delete _channels[i].chan; _channels[i].id = -1; _channels[i].chan = NULL; - _mixer->endStream(_channels[i].handle); + _channels[i].stream->finish(); + _channels[i].stream = 0; } else { int32 rate, vol, pan; bool stereo, is_16bit; @@ -119,11 +120,13 @@ bool SmushMixer::handleFrame() { } if (_mixer->isReady()) { - if (!_channels[i].handle.isActive()) - _mixer->newStream(&_channels[i].handle, rate, flags, 500000); + if (!_channels[i].handle.isActive()) { + _channels[i].stream = makeAppendableAudioStream(rate, flags, 500000); + _mixer->playInputStream(&_channels[i].handle, _channels[i].stream, false); + } _mixer->setChannelVolume(_channels[i].handle, vol); _mixer->setChannelBalance(_channels[i].handle, pan); - _mixer->appendStream(_channels[i].handle, data, size); + _channels[i].stream->append((byte *)data, size); } free(data); } @@ -139,7 +142,8 @@ bool SmushMixer::stop() { delete _channels[i].chan; _channels[i].id = -1; _channels[i].chan = NULL; - _mixer->endStream(_channels[i].handle); + _channels[i].stream->finish(); + _channels[i].stream = 0; } } return true; -- cgit v1.2.3