diff options
author | Max Horn | 2003-06-22 11:47:03 +0000 |
---|---|---|
committer | Max Horn | 2003-06-22 11:47:03 +0000 |
commit | 4ead10e4d5352e2fd0311ee09a5a99195d5fd97e (patch) | |
tree | 8126babb045a994797cd951ccd326ceaf2b4d7e2 /scumm/smush | |
parent | 9d9336492c23a56c5cbb26836f1452838b9a27b7 (diff) | |
download | scummvm-rg350-4ead10e4d5352e2fd0311ee09a5a99195d5fd97e.tar.gz scummvm-rg350-4ead10e4d5352e2fd0311ee09a5a99195d5fd97e.tar.bz2 scummvm-rg350-4ead10e4d5352e2fd0311ee09a5a99195d5fd97e.zip |
Change names of the stream API in the mixer; added endStream method (stop() halts stream immediately; endStream() lets it first finish playing)
svn-id: r8603
Diffstat (limited to 'scumm/smush')
-rw-r--r-- | scumm/smush/smush_mixer.cpp | 6 | ||||
-rw-r--r-- | scumm/smush/smush_player.cpp | 11 |
2 files changed, 12 insertions, 5 deletions
diff --git a/scumm/smush/smush_mixer.cpp b/scumm/smush/smush_mixer.cpp index 9f74b5252d..3de25e95d1 100644 --- a/scumm/smush/smush_mixer.cpp +++ b/scumm/smush/smush_mixer.cpp @@ -109,6 +109,8 @@ bool SmushMixer::handleFrame() { delete _channels[i].chan; _channels[i].id = -1; _channels[i].chan = NULL; + if (_channels[i].mixer_index != -1) + _mixer->endStream(_channels[i].mixer_index); } else { int32 rate; bool stereo, is_short; @@ -135,9 +137,9 @@ bool SmushMixer::handleFrame() { if (_silentMixer == false) { if (_channels[i].mixer_index == -1) { - _channels[i].mixer_index = _mixer->playStream(data, size, rate, flags, 2000000); + _channels[i].mixer_index = _mixer->newStream(data, size, rate, flags, 2000000); } else { - _mixer->append(_channels[i].mixer_index, data, size); + _mixer->appendStream(_channels[i].mixer_index, data, size); } } free(data); diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index d27a92f1c6..c3e9c829c7 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -223,7 +223,7 @@ SmushPlayer::SmushPlayer(Scumm *scumm, int speed, bool subtitles) { _storeFrame = false; _width = 0; _height = 0; - _IACTchannel = -1, + _IACTchannel = -1; _IACTpos = 0; _soundFrequency = 22050; _speed = speed; @@ -283,6 +283,11 @@ void SmushPlayer::deinit() { delete _base; _base = NULL; } + + if (_IACTchannel != -1) { + _scumm->_mixer->stop(_IACTchannel); + _IACTchannel = -1; + } _scumm->_insaneState = false; _scumm->abortCutscene(); @@ -451,10 +456,10 @@ void SmushPlayer::handleImuseAction(Chunk &b) { } while (--count); if (_IACTchannel == -1) { - _IACTchannel = _scumm->_mixer->playStream(output_data, 0x1000, 22050, + _IACTchannel = _scumm->_mixer->newStream(output_data, 0x1000, 22050, SoundMixer::FLAG_STEREO | SoundMixer::FLAG_16BITS, 200000); } else { - _scumm->_mixer->append(_IACTchannel, output_data, 0x1000); + _scumm->_mixer->appendStream(_IACTchannel, output_data, 0x1000); } bsize -= len; |