diff options
author | James Brown | 2002-10-20 13:17:43 +0000 |
---|---|---|
committer | James Brown | 2002-10-20 13:17:43 +0000 |
commit | 628eea3de4a7f87cd2d14faeb579b306c39e892a (patch) | |
tree | 6958ddbf8efe792dcaf9a917870cba39741f27c3 /scumm | |
parent | c7ef00571b789d6ea332ae4a8a2f59f55fd64d11 (diff) | |
download | scummvm-rg350-628eea3de4a7f87cd2d14faeb579b306c39e892a.tar.gz scummvm-rg350-628eea3de4a7f87cd2d14faeb579b306c39e892a.tar.bz2 scummvm-rg350-628eea3de4a7f87cd2d14faeb579b306c39e892a.zip |
Patch 625904: CD Looping
svn-id: r5199
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/sound.cpp | 17 | ||||
-rw-r--r-- | scumm/sound.h | 4 |
2 files changed, 19 insertions, 2 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp index d5fd792e98..fc5fcca168 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -1349,6 +1349,10 @@ int Sound::playMP3CDTrack(int track, int num_loops, int start, int delay) { _scumm->_mixer->stop(_mp3_index); _mp3_index = _scumm->_mixer->playMP3CDTrack(NULL, _mp3_tracks[index], duration); _mp3_cd_playing = true; + _mp3_cd_track = track; + _mp3_cd_num_loops = num_loops; + _mp3_cd_start = start; + _mp3_cd_delay = delay; return 0; } @@ -1356,6 +1360,10 @@ int Sound::stopMP3CD() { if (_mp3_cd_playing == true) { _scumm->_mixer->stop(_mp3_index); _mp3_cd_playing = false; + _mp3_cd_track = 0; + _mp3_cd_num_loops = 0; + _mp3_cd_start = 0; + _mp3_cd_delay = 0; return 0; } return -1; @@ -1376,8 +1384,13 @@ int Sound::updateMP3CD() { return -1; } - if (_scumm->_mixer->_channels[_mp3_index]->soundFinished()) - stopMP3CD(); + if (_scumm->_mixer->_channels[_mp3_index]->soundFinished()) { + if (_mp3_cd_num_loops == -1 || --_mp3_cd_num_loops > 0) + playMP3CDTrack(_mp3_cd_track, _mp3_cd_num_loops, _mp3_cd_start, _mp3_cd_delay); + else + stopMP3CD(); + } + return 0; } #endif diff --git a/scumm/sound.h b/scumm/sound.h index faa7c5e947..2f4ddec5c8 100644 --- a/scumm/sound.h +++ b/scumm/sound.h @@ -78,6 +78,10 @@ enum { long _mp3_size[CACHE_TRACKS]; File *_mp3_tracks[CACHE_TRACKS]; int _mp3_index; + int _mp3_cd_track; + int _mp3_cd_start; + int _mp3_cd_delay; + int _mp3_cd_num_loops; bool _mp3_cd_playing; #endif |