[Scummvm-cvs-logs] CVS: scummvm/sword2/driver animation.cpp,1.58,1.59 animation.h,1.34,1.35 d_sound.cpp,1.145,1.146

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


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

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

Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/animation.cpp,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -d -r1.58 -r1.59
--- animation.cpp	11 Mar 2005 15:30:27 -0000	1.58
+++ animation.cpp	12 Mar 2005 18:56:09 -0000	1.59
@@ -167,7 +167,7 @@
  */
 
 int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], int32 leadInRes, int32 leadOutRes) {
-	PlayingSoundHandle leadInHandle;
+	SoundHandle leadInHandle;
 
 	// This happens if the user quits during the "eye" smacker
 	if (_vm->_quit)
@@ -205,10 +205,10 @@
 	playDummy(filename, text, leadOut, leadOutLen);
 #endif
 
-	_vm->_mixer->stopHandle(leadInHandle);
+	_snd->stopHandle(leadInHandle);
 
 	// Wait for the lead-out to stop, if there is any.
-	while (_leadOutHandle.isActive()) {
+	while (_vm->_mixer->isSoundHandleActive(_leadOutHandle)) {
 		_vm->_screen->updateDisplay();
 		_vm->_system->delayMillis(30);
 	}
@@ -224,7 +224,7 @@
 
 void MoviePlayer::playMPEG(const char *filename, MovieTextObject *text[], byte *leadOut, uint32 leadOutLen) {
 	uint frameCounter = 0, textCounter = 0;
-	PlayingSoundHandle handle;
+	SoundHandle handle;
 	bool skipCutscene = false, textVisible = false;
 	uint32 flags = SoundMixer::FLAG_16BITS;
 	bool startNextText = false;
@@ -282,7 +282,7 @@
 				}
 			}
 
-			if (startNextText && !handle.isActive()) {
+			if (startNextText && !_snd->isSoundHandleActive(handle)) {
 				_snd->playRaw(&handle, text[textCounter]->speech, text[textCounter]->speechBufferSize, 22050, flags);
 				startNextText = false;
 			}
@@ -339,7 +339,7 @@
 	// If the speech is still playing, redraw the subtitles. At least in
 	// the English version this is most noticeable in the "carib" cutscene.
 
-	if (textVisible && handle.isActive())
+	if (textVisible && _snd->isSoundHandleActive(handle))
 		drawTextObject(anim, text[textCounter]);
 
 	if (text)
@@ -354,7 +354,7 @@
 	if (skipCutscene)
 		_snd->stopHandle(handle);
 
-	while (handle.isActive()) {
+	while (_snd->isSoundHandleActive(handle)) {
 		_vm->_screen->updateDisplay(false);
 		_sys->delayMillis(100);
 	}
@@ -441,7 +441,7 @@
 	tmpPal[255 * 4 + 2] = 255;
 	_vm->_screen->setPalette(0, 256, tmpPal, RDPAL_INSTANT);
 
-	PlayingSoundHandle handle;
+	SoundHandle handle;
 
 	bool skipCutscene = false;
 
@@ -493,7 +493,7 @@
 	// don't cut off the speech in mid-sentence, and - even more
 	// importantly - that we don't free the sound buffer while it's in use.
 
-	while (handle.isActive()) {
+	while (_snd->isSoundHandleActive(handle)) {
 		_vm->_screen->updateDisplay(false);
 		_sys->delayMillis(100);
 	}

Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/animation.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- animation.h	19 Feb 2005 14:02:14 -0000	1.34
+++ animation.h	12 Mar 2005 18:56:09 -0000	1.35
@@ -77,7 +77,7 @@
 
 	byte *_textSurface;
 
-	PlayingSoundHandle _leadOutHandle;
+	SoundHandle _leadOutHandle;
 
 	static struct MovieInfo _movies[];
 

Index: d_sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/d_sound.cpp,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- d_sound.cpp	9 Mar 2005 18:12:54 -0000	1.145
+++ d_sound.cpp	12 Mar 2005 18:56:09 -0000	1.146
@@ -642,7 +642,7 @@
 void Sound::muteSpeech(bool mute) {
 	_speechMuted = mute;
 
-	if (_soundHandleSpeech.isActive()) {
+	if (_vm->_mixer->isSoundHandleActive(_soundHandleSpeech)) {
 		uint volume = mute ? 0 : SoundMixer::kMaxChannelVolume;
 
 		_vm->_mixer->setChannelVolume(_soundHandleSpeech, volume);
@@ -672,7 +672,7 @@
  */
 
 int32 Sound::stopSpeech() {
-	if (_soundHandleSpeech.isActive()) {
+	if (_vm->_mixer->isSoundHandleActive(_soundHandleSpeech)) {
 		_vm->_mixer->stopHandle(_soundHandleSpeech);
 		return RD_OK;
 	}
@@ -685,7 +685,7 @@
  */
 
 int32 Sound::getSpeechStatus() {
-	return _soundHandleSpeech.isActive() ? RDSE_SAMPLEPLAYING : RDSE_SAMPLEFINISHED;
+	return _vm->_mixer->isSoundHandleActive(_soundHandleSpeech) ? RDSE_SAMPLEPLAYING : RDSE_SAMPLEFINISHED;
 }
 
 /**
@@ -693,7 +693,7 @@
  */
 
 int32 Sound::amISpeaking() {
-	if (!_speechMuted && !_speechPaused && _soundHandleSpeech.isActive())
+	if (!_speechMuted && !_speechPaused && _vm->_mixer->isSoundHandleActive(_soundHandleSpeech))
 		return RDSE_SPEAKING;
 
 	return RDSE_QUIET;
@@ -818,7 +818,7 @@
 		_fxQueue[i].pan = (pan * 127) / 16;
 	}
 
-	if (!_fxMuted && _fxQueue[i].handle.isActive()) {
+	if (!_fxMuted && _vm->_mixer->isSoundHandleActive(_fxQueue[i].handle)) {
 		_vm->_mixer->setChannelVolume(_fxQueue[i].handle, _fxQueue[i].volume);
 		if (pan != -1)
 			_vm->_mixer->setChannelBalance(_fxQueue[i].handle, _fxQueue[i].pan);





More information about the Scummvm-git-logs mailing list