[Scummvm-cvs-logs] CVS: scummvm/sound mixer.cpp,1.182,1.183 mixer.h,1.94,1.95

kirben kirben at users.sourceforge.net
Sun Jan 30 03:06:48 CET 2005


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11258/sound

Modified Files:
	mixer.cpp mixer.h 
Log Message:

Check sound queue for music in HE games.
Avoid extra sound channel.


Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -d -r1.182 -r1.183
--- mixer.cpp	28 Jan 2005 22:05:49 -0000	1.182
+++ mixer.cpp	30 Jan 2005 11:03:45 -0000	1.183
@@ -333,6 +333,14 @@
 		_channels[index]->setBalance(balance);
 }
 
+uint32 SoundMixer::getSoundElapsedTimeOfSoundID(int id) {
+	Common::StackLock lock(_mutex);
+	for (int i = 0; i != NUM_CHANNELS; i++)
+		if (_channels[i] && _channels[i]->getId() == id)
+			return _channels[i]->getElapsedTime();
+	return 0;
+}
+
 uint32 SoundMixer::getSoundElapsedTime(PlayingSoundHandle handle) {
 	Common::StackLock lock(_mutex);
 

Index: mixer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.h,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -d -r1.94 -r1.95
--- mixer.h	28 Jan 2005 22:05:49 -0000	1.94
+++ mixer.h	30 Jan 2005 11:03:45 -0000	1.95
@@ -233,6 +233,11 @@
 	void setChannelBalance(PlayingSoundHandle handle, int8 balance);
 
 	/**
+	 * Get approximation of for how long the Sound ID has been playing.
+	 */
+	uint32 getSoundElapsedTimeOfSoundID(int id);
+
+	/**
 	 * Get approximation of for how long the channel has been playing.
 	 */
 	uint32 getSoundElapsedTime(PlayingSoundHandle handle);





More information about the Scummvm-git-logs mailing list