[Scummvm-cvs-logs] CVS: scummvm/scumm imuse_digi.cpp,1.36,1.37 imuse_digi.h,1.7,1.8 sound.cpp,1.213,1.214 sound.h,1.43,1.44

Pawel Kolodziejski aquadran at users.sourceforge.net
Mon Sep 1 06:44:09 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv15606/scumm

Modified Files:
	imuse_digi.cpp imuse_digi.h sound.cpp sound.h 
Log Message:
added sound handle stuff to mixer streams

Index: imuse_digi.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- imuse_digi.cpp	31 Aug 2003 20:26:20 -0000	1.36
+++ imuse_digi.cpp	1 Sep 2003 13:43:21 -0000	1.37
@@ -699,7 +699,7 @@
 	: _scumm(scumm) {
 	memset(_channel, 0, sizeof(Channel) * MAX_DIGITAL_CHANNELS);
 	for (int l = 0; l < MAX_DIGITAL_CHANNELS; l++) {
-		_channel[l]._mixerChannel = -1;
+		_channel[l]._mixerChannel = 0;
 	}
 	_scumm->_timer->installProcedure(imus_digital_handler, 200000);
 	_pause = false;
@@ -709,10 +709,7 @@
 	_scumm->_timer->releaseProcedure(imus_digital_handler);
 
 	for (int l = 0; l < MAX_DIGITAL_CHANNELS; l++) {
-		if (_channel[l]._mixerChannel != -1) {
-			_scumm->_mixer->stop(_channel[l]._mixerChannel);
-			_channel[l]._mixerChannel = -1;
-		}
+		_scumm->_mixer->stop(_channel[l]._mixerChannel);
 	}
 }
 
@@ -725,10 +722,7 @@
 	for (l = 0; l < MAX_DIGITAL_CHANNELS;l ++) {
 		if (_channel[l]._used) {
 			if (_channel[l]._toBeRemoved) {
-				if (_channel[l]._mixerChannel != -1) {
-					_scumm->_mixer->endStream(_channel[l]._mixerChannel);
-					_channel[l]._mixerChannel = -1;
-				}
+				_scumm->_mixer->endStream(_channel[l]._mixerChannel);
 
 				free(_channel[l]._data);
 				_channel[l]._used = false;
@@ -772,7 +766,7 @@
 			int32 new_size = _channel[l]._mixerSize;
 			int32 mixer_size = new_size;
 
-			if (_channel[l]._mixerChannel == -1) {
+			if (_channel[l]._mixerChannel == 0) {
 				mixer_size *= 2;
 				new_size *= 2;
 			}
@@ -810,8 +804,8 @@
 			}
 
 			if (_scumm->_silentDigitalImuse == false) {
-				if (_channel[l]._mixerChannel == -1) {
-					_channel[l]._mixerChannel = _scumm->_mixer->newStream(buf, mixer_size,
+				if (_channel[l]._mixerChannel == 0) {
+					_scumm->_mixer->newStream(&_channel[l]._mixerChannel, buf, mixer_size,
 					                           _channel[l]._freq, _channel[l]._mixerFlags, 100000, 127, 0);
 				} else {
 					_scumm->_mixer->appendStream(_channel[l]._mixerChannel, buf, mixer_size);

Index: imuse_digi.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- imuse_digi.h	1 Aug 2003 12:18:40 -0000	1.7
+++ imuse_digi.h	1 Sep 2003 13:43:21 -0000	1.8
@@ -24,6 +24,7 @@
 #define IMUSE_DIGI_H
 
 #include "common/scummsys.h"
+#include "sound/mixer.h"
 
 #define MAX_DIGITAL_CHANNELS 8
 #define MAX_IMUSE_JUMPS 1
@@ -69,7 +70,7 @@
 		int _idSound;
 		int32 _mixerSize;
 		int _mixerFlags;
-		int _mixerChannel;
+		PlayingSoundHandle _mixerChannel;
 		bool _used;
 		bool _toBeRemoved;
 	};

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.213
retrieving revision 1.214
diff -u -d -r1.213 -r1.214
--- sound.cpp	31 Aug 2003 20:26:20 -0000	1.213
+++ sound.cpp	1 Sep 2003 13:43:21 -0000	1.214
@@ -1104,7 +1104,7 @@
 		_pauseBundleMusic = false;
 		_musicBundleToBeRemoved = false;
 		_musicBundleToBeChanged = false;
-		_bundleMusicTrack = -1;
+		_bundleMusicTrack = 0;
 		_numberSamplesBundleMusic = _bundle->getNumberOfMusicSamplesByName(song);
 		_nameBundleMusic = song;
 		_scumm->_timer->installProcedure(&music_handler, 1000000);
@@ -1137,10 +1137,7 @@
 	if (_musicBundleToBeRemoved) {
 		_scumm->_timer->releaseProcedure(&music_handler);
 		_nameBundleMusic = "";
-		if (_bundleMusicTrack != -1) {
-			_scumm->_mixer->stop(_bundleMusicTrack);
-			_bundleMusicTrack = -1;
-		}
+		_scumm->_mixer->stop(_bundleMusicTrack);
 		if (_musicBundleBufFinal) {
 			free(_musicBundleBufFinal);
 			_musicBundleBufFinal = NULL;
@@ -1248,8 +1245,8 @@
 	}
 
 	_bundleMusicPosition += final_size;
-	if (_bundleMusicTrack == -1) {
-		_bundleMusicTrack = _scumm->_mixer->newStream(buffer, final_size, rate,
+	if (_bundleMusicTrack == 0) {
+		_scumm->_mixer->newStream(&_bundleMusicTrack, buffer, final_size, rate,
 															SoundMixer::FLAG_16BITS | SoundMixer::FLAG_STEREO, 300000, 127, 0);
 	} else {
 		_scumm->_mixer->appendStream(_bundleMusicTrack, buffer, final_size);

Index: sound.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- sound.h	1 Aug 2003 12:18:40 -0000	1.43
+++ sound.h	1 Sep 2003 13:43:21 -0000	1.44
@@ -57,7 +57,7 @@
 	byte *_musicBundleBufFinal;
 	byte *_musicBundleBufOutput;
 	bool _pauseBundleMusic;
-	int32 _bundleMusicTrack;
+	PlayingSoundHandle _bundleMusicTrack;
 	bool _musicBundleToBeChanged;
 	bool _musicBundleToBeRemoved;
 	int32 _bundleMusicSampleBits;





More information about the Scummvm-git-logs mailing list