[Scummvm-cvs-logs] CVS: scummvm/sword2 sound.cpp,1.57,1.58 sound.h,1.18,1.19

Max Horn fingolfin at users.sourceforge.net
Sat Mar 12 10:56:44 CET 2005


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

Modified Files:
	sound.cpp sound.h 
Log Message:
PlayingSoundHandle -> SoundHandle; also, turned the handle activity check into a mixer method

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sound.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- sound.cpp	9 Mar 2005 18:12:52 -0000	1.57
+++ sound.cpp	12 Mar 2005 18:56:08 -0000	1.58
@@ -156,7 +156,7 @@
 			break;
 		case FX_SPOT2:
 			// Once the FX has finished remove it from the queue.
-			if (!_fxQueue[i].handle.isActive()) {
+			if (!_vm->_mixer->isSoundHandleActive(_fxQueue[i].handle)) {
 				_vm->_resman->closeResource(_fxQueue[i].resource);
 				_fxQueue[i].resource = 0;
 			}
@@ -250,11 +250,11 @@
 	return playFx(&fx->handle, fx->data, fx->len, fx->volume, fx->pan, (fx->type == FX_LOOP), SoundMixer::kSFXSoundType);
 }
 
-int32 Sound::playFx(PlayingSoundHandle *handle, byte *data, uint32 len, uint8 vol, int8 pan, bool loop, SoundMixer::SoundType soundType) {
+int32 Sound::playFx(SoundHandle *handle, byte *data, uint32 len, uint8 vol, int8 pan, bool loop, SoundMixer::SoundType soundType) {
 	if (_fxMuted)
 		return RD_OK;
 
-	if (handle->isActive())
+	if (_vm->_mixer->isSoundHandleActive(*handle))
 		return RDERR_FXALREADYOPEN;
 
 	Common::MemoryReadStream stream(data, len);
@@ -287,8 +287,7 @@
 	if (!_fxQueue[i].resource)
 		return RDERR_FXNOTOPEN;
 
-	if (_fxQueue[i].handle.isActive())
-		_vm->_mixer->stopHandle(_fxQueue[i].handle);
+	_vm->_mixer->stopHandle(_fxQueue[i].handle);
 
 	_vm->_resman->closeResource(_fxQueue[i].resource);
 	_fxQueue[i].resource = 0;

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sound.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- sound.h	27 Feb 2005 16:11:17 -0000	1.18
+++ sound.h	12 Mar 2005 18:56:09 -0000	1.19
@@ -172,7 +172,7 @@
 	Common::Mutex _mutex;
 
 	struct FxQueueEntry {
-		PlayingSoundHandle handle;	// sound handle
+		SoundHandle handle;	// sound handle
 		uint32 resource;		// resource id of sample
 		byte *data;			// pointer to WAV data
 		uint32 len;			// WAV data length
@@ -198,7 +198,7 @@
 
 	int32 _loopingMusicId;
 
-	PlayingSoundHandle _soundHandleSpeech;
+	SoundHandle _soundHandleSpeech;
 
 	MusicInputStream *_music[MAXMUS];
 	//File _musicFile[MAXMUS];
@@ -253,7 +253,7 @@
 
 	void queueFx(int32 res, int32 type, int32 delay, int32 volume, int32 pan);
 	int32 playFx(FxQueueEntry *fx);
-	int32 playFx(PlayingSoundHandle *handle, byte *data, uint32 len, uint8 vol, int8 pan, bool loop, SoundMixer::SoundType soundType);
+	int32 playFx(SoundHandle *handle, byte *data, uint32 len, uint8 vol, int8 pan, bool loop, SoundMixer::SoundType soundType);
 	int32 stopFx(int32 i);
 	int32 setFxIdVolumePan(int32 id, int vol, int pan = 255);
 





More information about the Scummvm-git-logs mailing list