[Scummvm-cvs-logs] CVS: scummvm/scumm sound.cpp,1.36,1.37 sound.h,1.13,1.14

James Brown ender at users.sourceforge.net
Sun Oct 20 06:18:04 CEST 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv31840/scumm

Modified Files:
	sound.cpp sound.h 
Log Message:
Patch 625904: CD Looping


Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- sound.cpp	18 Oct 2002 11:45:57 -0000	1.36
+++ sound.cpp	20 Oct 2002 13:17:43 -0000	1.37
@@ -1349,6 +1349,10 @@
 		_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 @@
 	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 @@
 		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

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- sound.h	18 Oct 2002 11:45:57 -0000	1.13
+++ sound.h	20 Oct 2002 13:17:43 -0000	1.14
@@ -78,6 +78,10 @@
 	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
 





More information about the Scummvm-git-logs mailing list