[Scummvm-cvs-logs] CVS: scummvm/scumm input.cpp,2.27,2.28 player_mod.cpp,2.20,2.21 player_mod.h,2.18,2.19 player_nes.h,2.2,2.3 player_v2.h,2.34,2.35 player_v2a.h,2.13,2.14 player_v3a.h,1.23,1.24 script_v8.cpp,2.290,2.291 scumm.cpp,1.501,1.502 sound.cpp,1.457,1.458

Max Horn fingolfin at users.sourceforge.net
Tue May 10 16:50:59 CEST 2005


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

Modified Files:
	input.cpp player_mod.cpp player_mod.h player_nes.h player_v2.h 
	player_v2a.h player_v3a.h script_v8.cpp scumm.cpp sound.cpp 
Log Message:
Moved class SoundMixer to Audio::Mixer (didn't call the namespace 'Sound' because we already have many classes with that name)

Index: input.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/input.cpp,v
retrieving revision 2.27
retrieving revision 2.28
diff -u -d -r2.27 -r2.28
--- input.cpp	20 Apr 2005 23:33:31 -0000	2.27
+++ input.cpp	10 May 2005 23:48:38 -0000	2.28
@@ -448,8 +448,8 @@
 		vol = runDialog(dlg);
 
 		vol *= 16;
-		if (vol > SoundMixer::kMaxMixerVolume)
-			vol = SoundMixer::kMaxMixerVolume;
+		if (vol > Audio::Mixer::kMaxMixerVolume)
+			vol = Audio::Mixer::kMaxMixerVolume;
 
 		ConfMan.set("music_volume", vol);
 		setupVolumes();

Index: player_mod.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_mod.cpp,v
retrieving revision 2.20
retrieving revision 2.21
diff -u -d -r2.20 -r2.21
--- player_mod.cpp	1 Jan 2005 16:09:14 -0000	2.20
+++ player_mod.cpp	10 May 2005 23:48:38 -0000	2.21
@@ -91,7 +91,7 @@
 	_channels[i].vol = vol;
 	_channels[i].pan = pan;
 	_channels[i].freq = rate;
-	_channels[i].input = makeLinearInputStream(rate, SoundMixer::FLAG_AUTOFREE | (loopStart != loopEnd ? SoundMixer::FLAG_LOOP : 0), (const byte*)data, size, loopStart, loopEnd - loopStart);
+	_channels[i].input = makeLinearInputStream(rate, Audio::Mixer::FLAG_AUTOFREE | (loopStart != loopEnd ? Audio::Mixer::FLAG_LOOP : 0), (const byte*)data, size, loopStart, loopEnd - loopStart);
 	_channels[i].converter = makeRateConverter(rate, _mixer->getOutputRate(), false, false);
 }
 

Index: player_mod.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_mod.h,v
retrieving revision 2.18
retrieving revision 2.19
diff -u -d -r2.18 -r2.19
--- player_mod.h	1 Jan 2005 16:09:14 -0000	2.18
+++ player_mod.h	10 May 2005 23:48:38 -0000	2.19
@@ -26,7 +26,6 @@
 #include "scumm/scumm.h"
 #include "sound/audiostream.h"
 
-class AudioStream;
 class RateConverter;
 
 namespace Scumm {
@@ -74,7 +73,7 @@
 		AudioStream *input;
 	};
 
-	SoundMixer *_mixer;
+	Audio::Mixer *_mixer;
 
 	uint32 _mixamt;
 	uint32 _mixpos;

Index: player_nes.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_nes.h,v
retrieving revision 2.2
retrieving revision 2.3
diff -u -d -r2.2 -r2.3
--- player_nes.h	7 Apr 2005 21:13:01 -0000	2.2
+++ player_nes.h	10 May 2005 23:48:38 -0000	2.3
@@ -27,7 +27,9 @@
 #include "scumm/music.h"
 #include "sound/audiostream.h"
 
-class SoundMixer;
+namespace Audio {
+	class Mixer;
+}
 
 namespace Scumm {
 
@@ -69,7 +71,7 @@
 	void do_mix(int16 *buf, uint len);
 
 	ScummEngine *_vm;
-	SoundMixer *_mixer;
+	Audio::Mixer *_mixer;
 	int _sample_rate;
 	int _samples_per_frame;
 	int _current_sample;

Index: player_v2.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2.h,v
retrieving revision 2.34
retrieving revision 2.35
diff -u -d -r2.34 -r2.35
--- player_v2.h	28 Jan 2005 22:05:43 -0000	2.34
+++ player_v2.h	10 May 2005 23:48:38 -0000	2.35
@@ -28,7 +28,9 @@
 #include "scumm/music.h"
 #include "sound/audiostream.h"
 
-class SoundMixer;
+namespace Audio {
+	class Mixer;
+}
 
 namespace Scumm {
 
@@ -96,7 +98,7 @@
 
 protected:
 	bool _isV3Game;
-	SoundMixer *_mixer;
+	Audio::Mixer *_mixer;
 	ScummEngine *_vm;
 
 	bool _pcjr;

Index: player_v2a.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v2a.h,v
retrieving revision 2.13
retrieving revision 2.14
diff -u -d -r2.13 -r2.14
--- player_v2a.h	7 Apr 2005 07:29:19 -0000	2.13
+++ player_v2a.h	10 May 2005 23:48:38 -0000	2.14
@@ -27,7 +27,7 @@
 #include "scumm/music.h"
 #include "scumm/player_mod.h"
 
-class SoundMixer;
+class Mixer;
 
 namespace Scumm {
 

Index: player_v3a.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/player_v3a.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- player_v3a.h	7 Apr 2005 07:29:19 -0000	1.23
+++ player_v3a.h	10 May 2005 23:48:38 -0000	1.24
@@ -27,7 +27,7 @@
 #include "scumm/music.h"
 #include "scumm/player_mod.h"
 
-class SoundMixer;
+class Mixer;
 
 namespace Scumm {
 

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.290
retrieving revision 2.291
diff -u -d -r2.290 -r2.291
--- script_v8.cpp	17 Apr 2005 22:40:45 -0000	2.290
+++ script_v8.cpp	10 May 2005 23:48:38 -0000	2.291
@@ -1384,13 +1384,13 @@
 		}
 		break;
 	case 0xDD:		// getGroupSfxVol
-		push(_mixer->getVolumeForSoundType(SoundMixer::kSFXSoundType) / 2);
+		push(_mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType) / 2);
 		break;
 	case 0xDE:		// getGroupVoiceVol
-		push(_mixer->getVolumeForSoundType(SoundMixer::kSpeechSoundType) / 2);
+		push(_mixer->getVolumeForSoundType(Audio::Mixer::kSpeechSoundType) / 2);
 		break;
 	case 0xDF:		// getGroupMusicVol
-		push(_mixer->getVolumeForSoundType(SoundMixer::kMusicSoundType) / 2);
+		push(_mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType) / 2);
 		break;
 	case 0xE0:		// readRegistryValue
 		{

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.501
retrieving revision 1.502
diff -u -d -r1.501 -r1.502
--- scumm.cpp	10 May 2005 22:56:11 -0000	1.501
+++ scumm.cpp	10 May 2005 23:48:38 -0000	1.502
@@ -1879,9 +1879,9 @@
 		_musicEngine->setMusicVolume(soundVolumeMusic);
 	}
 
-	_mixer->setVolumeForSoundType(SoundMixer::kSFXSoundType, soundVolumeSfx);
-	_mixer->setVolumeForSoundType(SoundMixer::kMusicSoundType, soundVolumeMusic);
-	_mixer->setVolumeForSoundType(SoundMixer::kSpeechSoundType, soundVolumeSpeech);
+	_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSfx);
+	_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic);
+	_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech);
 }
 
 

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.457
retrieving revision 1.458
diff -u -d -r1.457 -r1.458
--- sound.cpp	10 May 2005 22:56:11 -0000	1.457
+++ sound.cpp	10 May 2005 23:48:40 -0000	1.458
@@ -223,7 +223,7 @@
 	char *sound;
 	int size = -1;
 	int rate;
-	byte flags = SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE;
+	byte flags = Audio::Mixer::FLAG_UNSIGNED | Audio::Mixer::FLAG_AUTOFREE;
 
 	if (heChannel == -1) {
 		heChannel = 1;
@@ -337,7 +337,7 @@
 
 		if (heFlags & 1) {
 			// TODO
-			// flags |= SoundMixer::FLAG_LOOP;
+			// flags |= Audio::Mixer::FLAG_LOOP;
 		}
 
 		// Allocate a sound buffer, copy the data into it, and play
@@ -353,7 +353,7 @@
 
 		size = READ_BE_UINT32(ptr+4) - 8;
 		rate = 22050;
-		flags = SoundMixer::FLAG_AUTOFREE;
+		flags = Audio::Mixer::FLAG_AUTOFREE;
 
 		// Allocate a sound buffer, copy the data into it, and play
 		sound = (char *)malloc(size);
@@ -482,7 +482,7 @@
 				size -= waveSize;
 
 				if (loopEnd > 0)
-					flags |= SoundMixer::FLAG_LOOP;
+					flags |= Audio::Mixer::FLAG_LOOP;
 
 				_vm->_mixer->playRaw(NULL, sound, waveSize, rate, flags, soundID, 255, 0, loopStart, loopEnd);
 			}
@@ -546,7 +546,7 @@
 		sound = (char *)malloc(size);
 		int vol = ptr[24] * 4;
 		memcpy(sound, ptr + READ_BE_UINT16(ptr + 8), size);
-		_vm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, soundID, vol, 0);
+		_vm->_mixer->playRaw(NULL, sound, size, rate, Audio::Mixer::FLAG_AUTOFREE, soundID, vol, 0);
 	}
 	else {
 		
@@ -806,7 +806,7 @@
 			//_vm->_imuseDigital->stopSound(kTalkSoundID);
 			_vm->_imuseDigital->startVoice(kTalkSoundID, input);
 		} else {
-			_vm->_mixer->playInputStream(SoundMixer::kSFXSoundType, handle, input, id);
+			_vm->_mixer->playInputStream(Audio::Mixer::kSFXSoundType, handle, input, id);
 		}
 	}
 }
@@ -1189,7 +1189,7 @@
 }
 
 bool Sound::isSfxFinished() const {
-	return !_vm->_mixer->hasActiveChannelOfType(SoundMixer::kSFXSoundType);
+	return !_vm->_mixer->hasActiveChannelOfType(Audio::Mixer::kSFXSoundType);
 }
 
 // We use a real timer in an attempt to get better sync with CD tracks. This is
@@ -2436,10 +2436,10 @@
 			return new AppendableMemoryStream<STEREO, false, UNSIGNED, false>(rate, len)
 
 AppendableAudioStream *makeAppendableAudioStream(int rate, byte _flags, uint32 len) {
-	const bool isStereo = (_flags & SoundMixer::FLAG_STEREO) != 0;
-	const bool is16Bit = (_flags & SoundMixer::FLAG_16BITS) != 0;
-	const bool isUnsigned = (_flags & SoundMixer::FLAG_UNSIGNED) != 0;
-	const bool isLE       = (_flags & SoundMixer::FLAG_LITTLE_ENDIAN) != 0;
+	const bool isStereo = (_flags & Audio::Mixer::FLAG_STEREO) != 0;
+	const bool is16Bit = (_flags & Audio::Mixer::FLAG_16BITS) != 0;
+	const bool isUnsigned = (_flags & Audio::Mixer::FLAG_UNSIGNED) != 0;
+	const bool isLE       = (_flags & Audio::Mixer::FLAG_LITTLE_ENDIAN) != 0;
 	
 	if (isStereo) {
 		if (isUnsigned) {





More information about the Scummvm-git-logs mailing list