[Scummvm-cvs-logs] CVS: scummvm/sound audiocd.h,1.10,1.11 audiostream.cpp,1.72,1.73 flac.cpp,1.8,1.9 mididrv.h,1.45,1.46 mixer.cpp,1.191,1.192 mixer.h,1.104,1.105 mp3.cpp,1.19,1.20 rate.cpp,1.37,1.38 voc.cpp,1.25,1.26 vorbis.cpp,1.23,1.24 wave.cpp,1.5,1.6

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


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

Modified Files:
	audiocd.h audiostream.cpp flac.cpp mididrv.h mixer.cpp mixer.h 
	mp3.cpp rate.cpp voc.cpp vorbis.cpp wave.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: audiocd.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/audiocd.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- audiocd.h	20 Apr 2005 11:13:56 -0000	1.10
+++ audiocd.h	10 May 2005 23:48:45 -0000	1.11
@@ -30,7 +30,7 @@
 class DigitalTrackInfo {
 public:
 	virtual bool error() = 0;
-	virtual void play(SoundMixer *mixer, SoundHandle *handle, int startFrame, int duration) = 0;
+	virtual void play(Audio::Mixer *mixer, SoundHandle *handle, int startFrame, int duration) = 0;
 	virtual ~DigitalTrackInfo() { }
 };
 

Index: audiostream.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/audiostream.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- audiostream.cpp	10 May 2005 22:56:19 -0000	1.72
+++ audiostream.cpp	10 May 2005 23:48:45 -0000	1.73
@@ -186,11 +186,11 @@
 			return new LinearMemoryStream<STEREO, false, UNSIGNED, false>(rate, ptr, len, loopOffset, loopLen, autoFree)
 
 AudioStream *makeLinearInputStream(int rate, byte flags, const byte *ptr, uint32 len, uint loopOffset, uint loopLen) {
-	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 autoFree   = (flags & SoundMixer::FLAG_AUTOFREE) != 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;
+	const bool autoFree   = (flags & Audio::Mixer::FLAG_AUTOFREE) != 0;
 	
 	if (isStereo) {
 		if (isUnsigned) {

Index: flac.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/flac.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- flac.cpp	10 May 2005 22:56:19 -0000	1.8
+++ flac.cpp	10 May 2005 23:48:45 -0000	1.9
@@ -750,7 +750,7 @@
 	FlacTrackInfo(File *file);
 	~FlacTrackInfo();
 	bool error() { return _file == NULL; }
-	void play(SoundMixer *mixer, SoundHandle *handle, int startFrame, int duration);
+	void play(Audio::Mixer *mixer, SoundHandle *handle, int startFrame, int duration);
 };
 
 FlacTrackInfo::FlacTrackInfo(File *file) : _file(NULL), _firstStream(NULL)
@@ -764,7 +764,7 @@
 		delete tempStream;
 }
 
-void FlacTrackInfo::play(SoundMixer *mixer, SoundHandle *handle, int startFrame, int duration) {
+void FlacTrackInfo::play(Audio::Mixer *mixer, SoundHandle *handle, int startFrame, int duration) {
 	if (error()) {
 		debug(1, "FlacTrackInfo::play:  invalid state, method should not been called");
 	}
@@ -787,7 +787,7 @@
 			flac->setLastSample(0);
 
 		if (flac->seekAbsolute(static_cast<FLAC__uint64>(startFrame) * (info.sample_rate / 75))) {
-			mixer->playInputStream(SoundMixer::kMusicSoundType, handle, flac);
+			mixer->playInputStream(Audio::Mixer::kMusicSoundType, handle, flac);
 			return;
 		}
 		// startSample is beyond the existing Samples

Index: mididrv.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mididrv.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- mididrv.h	10 May 2005 23:17:37 -0000	1.45
+++ mididrv.h	10 May 2005 23:48:45 -0000	1.46
@@ -27,7 +27,9 @@
 #include "common/timer.h"
 
 class MidiChannel;
-class SoundMixer;
+namespace Audio {
+	class Mixer;
+}
 namespace Common { class String; }
 
 /** MIDI Driver Types */
@@ -190,19 +192,19 @@
 
 // Factory functions, for faster compile
 extern MidiDriver *MidiDriver_NULL_create();
-extern MidiDriver *MidiDriver_ADLIB_create(SoundMixer *mixer);
+extern MidiDriver *MidiDriver_ADLIB_create(Audio::Mixer *mixer);
 extern MidiDriver *MidiDriver_WIN_create();
 extern MidiDriver *MidiDriver_SEQ_create();
 extern MidiDriver *MidiDriver_QT_create();
 extern MidiDriver *MidiDriver_CORE_create();
 extern MidiDriver *MidiDriver_ETUDE_create();
 extern MidiDriver *MidiDriver_ALSA_create();
-extern MidiDriver *MidiDriver_YM2612_create(SoundMixer *mixer);
+extern MidiDriver *MidiDriver_YM2612_create(Audio::Mixer *mixer);
 #ifdef USE_FLUIDSYNTH
-extern MidiDriver *MidiDriver_FluidSynth_create(SoundMixer *mixer);
+extern MidiDriver *MidiDriver_FluidSynth_create(Audio::Mixer *mixer);
 #endif
 #ifdef USE_MT32EMU
-extern MidiDriver *MidiDriver_MT32_create(SoundMixer *mixer);
+extern MidiDriver *MidiDriver_MT32_create(Audio::Mixer *mixer);
 #endif
 extern MidiDriver *MidiDriver_YamahaPa1_create();
 extern MidiDriver *MidiDriver_Zodiac_create();

Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -d -r1.191 -r1.192
--- mixer.cpp	8 May 2005 21:49:50 -0000	1.191
+++ mixer.cpp	10 May 2005 23:48:45 -0000	1.192
@@ -34,6 +34,8 @@
 #include "sound/vorbis.h"
 
 
+namespace Audio {
+
 #pragma mark -
 #pragma mark --- Channel classes ---
 #pragma mark -
@@ -44,10 +46,10 @@
  */
 class Channel {
 public:
-	const SoundMixer::SoundType	_type;
+	const Mixer::SoundType	_type;
 	SoundHandle _handle;
 private:
-	SoundMixer *_mixer;
+	Mixer *_mixer;
 	bool _autofreeStream;
 	bool _permanent;
 	byte _volume;
@@ -64,8 +66,8 @@
 
 public:
 
-	Channel(SoundMixer *mixer, SoundMixer::SoundType type, int id = -1);
-	Channel(SoundMixer *mixer, SoundMixer::SoundType type, AudioStream *input, bool autofreeStream, bool reverseStereo = false, int id = -1, bool permanent = false);
+	Channel(Mixer *mixer, Mixer::SoundType type, int id = -1);
+	Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *input, bool autofreeStream, bool reverseStereo = false, int id = -1, bool permanent = false);
 	virtual ~Channel();
 
 	void mix(int16 *data, uint len);
@@ -96,11 +98,11 @@
 
 
 #pragma mark -
-#pragma mark --- SoundMixer ---
+#pragma mark --- Mixer ---
 #pragma mark -
 
 
-SoundMixer::SoundMixer() {
+Mixer::Mixer() {
 	_syst = &OSystem::instance();
 
 	_handleSeed = 0;
@@ -125,7 +127,7 @@
 	debug(1, "Output sample rate: %d Hz", _outputRate);
 }
 
-SoundMixer::~SoundMixer() {
+Mixer::~Mixer() {
 	_syst->clearSoundCallback();
 	stopAll(true);
 
@@ -133,11 +135,11 @@
 	_premixChannel = 0;
 }
 
-bool SoundMixer::isPaused() {
+bool Mixer::isPaused() {
 	return _paused;
 }
 
-void SoundMixer::setupPremix(AudioStream *stream, SoundType type) {
+void Mixer::setupPremix(AudioStream *stream, SoundType type) {
 	Common::StackLock lock(_mutex);
 
 	delete _premixChannel;
@@ -150,7 +152,7 @@
 	_premixChannel = new Channel(this, type, stream, false);
 }
 
-void SoundMixer::insertChannel(SoundHandle *handle, Channel *chan) {
+void Mixer::insertChannel(SoundHandle *handle, Channel *chan) {
 
 	int index = -1;
 	for (int i = 0; i != NUM_CHANNELS; i++) {
@@ -160,7 +162,7 @@
 		}
 	}
 	if (index == -1) {
-		warning("SoundMixer::out of mixer slots");
+		warning("Mixer::out of mixer slots");
 		delete chan;
 		return;
 	}
@@ -173,7 +175,7 @@
 	}
 }
 
-void SoundMixer::playRaw(SoundHandle *handle, void *sound, uint32 size, uint rate, byte flags,
+void Mixer::playRaw(SoundHandle *handle, void *sound, uint32 size, uint rate, byte flags,
 			int id, byte volume, int8 balance, uint32 loopStart, uint32 loopEnd, SoundType type) {
 	Common::StackLock lock(_mutex);
 
@@ -181,7 +183,7 @@
 	if (id != -1) {
 		for (int i = 0; i != NUM_CHANNELS; i++)
 			if (_channels[i] != 0 && _channels[i]->getId() == id) {
-				if ((flags & SoundMixer::FLAG_AUTOFREE) != 0)
+				if ((flags & Mixer::FLAG_AUTOFREE) != 0)
 					free(sound);
 				return;
 			}
@@ -189,7 +191,7 @@
 
 	// Create the input stream
 	AudioStream *input;
-	if (flags & SoundMixer::FLAG_LOOP) {
+	if (flags & Mixer::FLAG_LOOP) {
 		if (loopEnd == 0) {
 			input = makeLinearInputStream(rate, flags, (byte *)sound, size, 0, size);
 		} else {
@@ -201,13 +203,13 @@
 	}
 
 	// Create the channel
-	Channel *chan = new Channel(this, type, input, true, (flags & SoundMixer::FLAG_REVERSE_STEREO) != 0, id);
+	Channel *chan = new Channel(this, type, input, true, (flags & Mixer::FLAG_REVERSE_STEREO) != 0, id);
 	chan->setVolume(volume);
 	chan->setBalance(balance);
 	insertChannel(handle, chan);
 }
 
-void SoundMixer::playInputStream(SoundType type, SoundHandle *handle, AudioStream *input,
+void Mixer::playInputStream(SoundType type, SoundHandle *handle, AudioStream *input,
 			int id, byte volume, int8 balance, bool autofreeStream, bool permanent) {
 	Common::StackLock lock(_mutex);
 
@@ -233,7 +235,7 @@
 	insertChannel(handle, chan);
 }
 
-void SoundMixer::mix(int16 *buf, uint len) {
+void Mixer::mix(int16 *buf, uint len) {
 	Common::StackLock lock(_mutex);
 
 	//  zero the buf
@@ -255,15 +257,15 @@
 	}
 }
 
-void SoundMixer::mixCallback(void *s, byte *samples, int len) {
+void Mixer::mixCallback(void *s, byte *samples, int len) {
 	assert(s);
 	assert(samples);
 	// Len is the number of bytes in the buffer; we divide it by
 	// four to get the number of samples (stereo 16 bit).
-	((SoundMixer *)s)->mix((int16 *)samples, len >> 2);
+	((Mixer *)s)->mix((int16 *)samples, len >> 2);
 }
 
-void SoundMixer::stopAll(bool force) {
+void Mixer::stopAll(bool force) {
 	Common::StackLock lock(_mutex);
 	for (int i = 0; i != NUM_CHANNELS; i++)
 		if (_channels[i] != 0) {
@@ -274,7 +276,7 @@
 		}
 }
 
-void SoundMixer::stopID(int id) {
+void Mixer::stopID(int id) {
 	Common::StackLock lock(_mutex);
 	for (int i = 0; i != NUM_CHANNELS; i++) {
 		if (_channels[i] != 0 && _channels[i]->getId() == id) {
@@ -284,7 +286,7 @@
 	}
 }
 
-void SoundMixer::stopHandle(SoundHandle handle) {
+void Mixer::stopHandle(SoundHandle handle) {
 	Common::StackLock lock(_mutex);
 
 	// Simply ignore stop requests for handles of sounds that already terminated
@@ -296,7 +298,7 @@
 	_channels[index] = 0;
 }
 
-void SoundMixer::setChannelVolume(SoundHandle handle, byte volume) {
+void Mixer::setChannelVolume(SoundHandle handle, byte volume) {
 	Common::StackLock lock(_mutex);
 
 	const int index = handle._val % NUM_CHANNELS;
@@ -306,7 +308,7 @@
 	_channels[index]->setVolume(volume);
 }
 
-void SoundMixer::setChannelBalance(SoundHandle handle, int8 balance) {
+void Mixer::setChannelBalance(SoundHandle handle, int8 balance) {
 	Common::StackLock lock(_mutex);
 
 	const int index = handle._val % NUM_CHANNELS;
@@ -316,7 +318,7 @@
 	_channels[index]->setBalance(balance);
 }
 
-uint32 SoundMixer::getSoundElapsedTimeOfSoundID(int id) {
+uint32 Mixer::getSoundElapsedTimeOfSoundID(int id) {
 	Common::StackLock lock(_mutex);
 	for (int i = 0; i != NUM_CHANNELS; i++)
 		if (_channels[i] && _channels[i]->getId() == id)
@@ -324,7 +326,7 @@
 	return 0;
 }
 
-uint32 SoundMixer::getSoundElapsedTime(SoundHandle handle) {
+uint32 Mixer::getSoundElapsedTime(SoundHandle handle) {
 	Common::StackLock lock(_mutex);
 
 	const int index = handle._val % NUM_CHANNELS;
@@ -334,11 +336,11 @@
 	return _channels[index]->getElapsedTime();
 }
 
-void SoundMixer::pauseAll(bool paused) {
+void Mixer::pauseAll(bool paused) {
 	_paused = paused;
 }
 
-void SoundMixer::pauseID(int id, bool paused) {
+void Mixer::pauseID(int id, bool paused) {
 	Common::StackLock lock(_mutex);
 	for (int i = 0; i != NUM_CHANNELS; i++) {
 		if (_channels[i] != 0 && _channels[i]->getId() == id) {
@@ -348,7 +350,7 @@
 	}
 }
 
-void SoundMixer::pauseHandle(SoundHandle handle, bool paused) {
+void Mixer::pauseHandle(SoundHandle handle, bool paused) {
 	Common::StackLock lock(_mutex);
 
 	// Simply ignore pause/unpause requests for handles of sound that alreayd terminated
@@ -359,7 +361,7 @@
 	_channels[index]->pause(paused);
 }
 
-bool SoundMixer::isSoundIDActive(int id) {
+bool Mixer::isSoundIDActive(int id) {
 	Common::StackLock lock(_mutex);
 	for (int i = 0; i != NUM_CHANNELS; i++)
 		if (_channels[i] && _channels[i]->getId() == id)
@@ -367,7 +369,7 @@
 	return false;
 }
 
-int SoundMixer::getSoundID(SoundHandle handle) {
+int Mixer::getSoundID(SoundHandle handle) {
 	Common::StackLock lock(_mutex);
 	const int index = handle._val % NUM_CHANNELS;
 	if (_channels[index] && _channels[index]->_handle._val == handle._val)
@@ -375,13 +377,13 @@
 	return 0;
 }
 
-bool SoundMixer::isSoundHandleActive(SoundHandle handle) {
+bool Mixer::isSoundHandleActive(SoundHandle handle) {
 	Common::StackLock lock(_mutex);
 	const int index = handle._val % NUM_CHANNELS;
 	return _channels[index] && _channels[index]->_handle._val == handle._val;
 }
 
-bool SoundMixer::hasActiveChannelOfType(SoundType type) {
+bool Mixer::hasActiveChannelOfType(SoundType type) {
 	Common::StackLock lock(_mutex);
 	for (int i = 0; i != NUM_CHANNELS; i++)
 		if (_channels[i] && _channels[i]->_type == type)
@@ -389,7 +391,7 @@
 	return false;
 }
 
-void SoundMixer::setVolumeForSoundType(SoundType type, int volume) {
+void Mixer::setVolumeForSoundType(SoundType type, int volume) {
 	assert(0 <= type && type < ARRAYSIZE(_volumeForSoundType));
 
 	// Check range
@@ -404,7 +406,7 @@
 	_volumeForSoundType[type] = volume;
 }
 
-int SoundMixer::getVolumeForSoundType(SoundType type) const {
+int Mixer::getVolumeForSoundType(SoundType type) const {
 	assert(0 <= type && type < ARRAYSIZE(_volumeForSoundType));
 	
 	return _volumeForSoundType[type];
@@ -416,17 +418,17 @@
 #pragma mark -
 
 
-Channel::Channel(SoundMixer *mixer, SoundMixer::SoundType type, int id)
+Channel::Channel(Mixer *mixer, Mixer::SoundType type, int id)
 	: _type(type), _mixer(mixer), _autofreeStream(true),
-	  _volume(SoundMixer::kMaxChannelVolume), _balance(0), _paused(false), _id(id), _samplesConsumed(0),
+	  _volume(Mixer::kMaxChannelVolume), _balance(0), _paused(false), _id(id), _samplesConsumed(0),
 	  _samplesDecoded(0), _mixerTimeStamp(0), _converter(0), _input(0) {
 	assert(mixer);
 }
 
-Channel::Channel(SoundMixer *mixer, SoundMixer::SoundType type, AudioStream *input,
+Channel::Channel(Mixer *mixer, Mixer::SoundType type, AudioStream *input,
 				bool autofreeStream, bool reverseStereo, int id, bool permanent)
 	: _type(type), _mixer(mixer), _autofreeStream(autofreeStream),
-	  _volume(SoundMixer::kMaxChannelVolume), _balance(0), _paused(false), _id(id), _samplesConsumed(0),
+	  _volume(Mixer::kMaxChannelVolume), _balance(0), _paused(false), _id(id), _samplesConsumed(0),
 	  _samplesDecoded(0), _mixerTimeStamp(0), _converter(0), _input(input), _permanent(permanent) {
 	assert(mixer);
 	assert(input);
@@ -465,14 +467,14 @@
 		st_volume_t vol_l, vol_r;
 
 		if (_balance == 0) {
-			vol_l = vol / SoundMixer::kMaxChannelVolume;
-			vol_r = vol / SoundMixer::kMaxChannelVolume;
+			vol_l = vol / Mixer::kMaxChannelVolume;
+			vol_r = vol / Mixer::kMaxChannelVolume;
 		} else if (_balance < 0) {
-			vol_l = vol / SoundMixer::kMaxChannelVolume;
-			vol_r = ((127 + _balance) * vol) / (SoundMixer::kMaxChannelVolume * 127);
+			vol_l = vol / Mixer::kMaxChannelVolume;
+			vol_r = ((127 + _balance) * vol) / (Mixer::kMaxChannelVolume * 127);
 		} else {
-			vol_l = ((127 - _balance) * vol) / (SoundMixer::kMaxChannelVolume * 127);
-			vol_r = vol / SoundMixer::kMaxChannelVolume;
+			vol_l = ((127 - _balance) * vol) / (Mixer::kMaxChannelVolume * 127);
+			vol_r = vol / Mixer::kMaxChannelVolume;
 		}
 
 		_samplesConsumed = _samplesDecoded;
@@ -507,3 +509,6 @@
 	// FIXME: This won't work very well if the sound is paused.
 	return 1000 * seconds + milliseconds + delta;
 }
+
+
+} // End of namespace Audio

Index: mixer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.h,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- mixer.h	10 May 2005 22:56:20 -0000	1.104
+++ mixer.h	10 May 2005 23:48:46 -0000	1.105
@@ -29,19 +29,23 @@
 
 
 class AudioStream;
-class Channel;
+namespace Audio {
+	class Channel;
+	class Mixer;
+}
 class OSystem;
 
 class SoundHandle {
-	friend class Channel;
-	friend class SoundMixer;
+	friend class Audio::Channel;
+	friend class Audio::Mixer;
 	uint32 _val;
 public:
 	inline SoundHandle() : _val(0xFFFFFFFF) {}
 };
 
+namespace Audio {
 
-class SoundMixer {
+class Mixer {
 public:
 	enum {
 		/** unsigned samples (default: signed) */
@@ -101,8 +105,8 @@
 	bool _mixerReady;
 
 public:
-	SoundMixer();
-	~SoundMixer();
+	Mixer();
+	~Mixer();
 
 
 
@@ -304,4 +308,7 @@
 	static void mixCallback(void *s, byte *samples, int len);
 };
 
+
+} // End of namespace Audio
+
 #endif

Index: mp3.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mp3.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- mp3.cpp	10 May 2005 22:56:20 -0000	1.19
+++ mp3.cpp	10 May 2005 23:48:46 -0000	1.20
@@ -288,7 +288,7 @@
 	MP3TrackInfo(File *file);
 	~MP3TrackInfo();
 	bool error() { return _error_flag; }
-	void play(SoundMixer *mixer, SoundHandle *handle, int startFrame, int duration);
+	void play(Audio::Mixer *mixer, SoundHandle *handle, int startFrame, int duration);
 };
 
 
@@ -363,7 +363,7 @@
 	delete file;
 }
 
-void MP3TrackInfo::play(SoundMixer *mixer, SoundHandle *handle, int startFrame, int duration) {
+void MP3TrackInfo::play(Audio::Mixer *mixer, SoundHandle *handle, int startFrame, int duration) {
 	unsigned int offset;
 	mad_timer_t durationTime;
 
@@ -383,7 +383,7 @@
 
 	// Play it
 	AudioStream *input = new MP3InputStream(_file, durationTime);
-	mixer->playInputStream(SoundMixer::kMusicSoundType, handle, input);
+	mixer->playInputStream(Audio::Mixer::kMusicSoundType, handle, input);
 }
 
 MP3TrackInfo::~MP3TrackInfo() {

Index: rate.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/rate.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- rate.cpp	10 Jan 2005 22:51:42 -0000	1.37
+++ rate.cpp	10 May 2005 23:48:46 -0000	1.38
@@ -168,10 +168,10 @@
 			}
 
 			// output left channel
-			clampedAdd(*obuf++, (out[0] * (int)vol_l) / SoundMixer::kMaxMixerVolume);
+			clampedAdd(*obuf++, (out[0] * (int)vol_l) / Audio::Mixer::kMaxMixerVolume);
 
 			// output right channel
-			clampedAdd(*obuf++, (out[1] * (int)vol_r) / SoundMixer::kMaxMixerVolume);
+			clampedAdd(*obuf++, (out[1] * (int)vol_r) / Audio::Mixer::kMaxMixerVolume);
 
 			// Increment output position
 			unsigned long tmp = opos_frac + opos_inc_frac;
@@ -238,10 +238,10 @@
 			}
 
 			// output left channel
-			clampedAdd(*obuf++, (tmp0 * (int)vol_l) / SoundMixer::kMaxMixerVolume);
+			clampedAdd(*obuf++, (tmp0 * (int)vol_l) / Audio::Mixer::kMaxMixerVolume);
 	
 			// output right channel
-			clampedAdd(*obuf++, (tmp1 * (int)vol_r) / SoundMixer::kMaxMixerVolume);
+			clampedAdd(*obuf++, (tmp1 * (int)vol_r) / Audio::Mixer::kMaxMixerVolume);
 		}
 		return (ST_SUCCESS);
 	}

Index: voc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/voc.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- voc.cpp	9 Jan 2005 15:49:43 -0000	1.25
+++ voc.cpp	10 May 2005 23:48:46 -0000	1.26
@@ -135,6 +135,6 @@
 	if (!data)
 		return 0;
 
-	return makeLinearInputStream(rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED, data, size, 0, 0);
+	return makeLinearInputStream(rate, Audio::Mixer::FLAG_AUTOFREE | Audio::Mixer::FLAG_UNSIGNED, data, size, 0, 0);
 }
 

Index: vorbis.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/vorbis.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- vorbis.cpp	10 May 2005 22:56:20 -0000	1.23
+++ vorbis.cpp	10 May 2005 23:48:46 -0000	1.24
@@ -52,7 +52,7 @@
 	~VorbisTrackInfo();
 	bool openTrack();
 	bool error() { return _error_flag; }
-	void play(SoundMixer *mixer, SoundHandle *handle, int startFrame, int duration);
+	void play(Audio::Mixer *mixer, SoundHandle *handle, int startFrame, int duration);
 };
 
 
@@ -168,7 +168,7 @@
 #define VORBIS_TREMOR
 #endif
 
-void VorbisTrackInfo::play(SoundMixer *mixer, SoundHandle *handle, int startFrame, int duration) {
+void VorbisTrackInfo::play(Audio::Mixer *mixer, SoundHandle *handle, int startFrame, int duration) {
 
 	bool err = openTrack();
 	assert(!err);
@@ -180,7 +180,7 @@
 #endif
 
 	AudioStream *input = makeVorbisStream(&_ov_file, duration * ov_info(&_ov_file, -1)->rate / 75);
-	mixer->playInputStream(SoundMixer::kMusicSoundType, handle, input);
+	mixer->playInputStream(Audio::Mixer::kMusicSoundType, handle, input);
 }
 
 DigitalTrackInfo *getVorbisTrack(int track) {

Index: wave.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/wave.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- wave.cpp	4 May 2005 01:57:03 -0000	1.5
+++ wave.cpp	10 May 2005 23:48:46 -0000	1.6
@@ -109,18 +109,18 @@
 
 	flags = 0;
 	if (bitsPerSample == 8)		// 8 bit data is unsigned
-		flags |= SoundMixer::FLAG_UNSIGNED;
+		flags |= Audio::Mixer::FLAG_UNSIGNED;
 	else if (bitsPerSample == 16)	// 16 bit data is signed little endian
-		flags |= (SoundMixer::FLAG_16BITS | SoundMixer::FLAG_LITTLE_ENDIAN);
+		flags |= (Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_LITTLE_ENDIAN);
 	else if (bitsPerSample == 4 && type == 17)	// IMA ADPCM compressed. We decompress it
-		flags |= (SoundMixer::FLAG_16BITS | SoundMixer::FLAG_LITTLE_ENDIAN);
+		flags |= (Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_LITTLE_ENDIAN);
 	else {
 		warning("getWavInfo: unsupported bitsPerSample %d", bitsPerSample);
 		return false;
 	}
 	
 	if (numChannels == 2)
-		flags |= SoundMixer::FLAG_STEREO;
+		flags |= Audio::Mixer::FLAG_STEREO;
 	else if (numChannels != 1) {
 		warning("getWavInfo: unsupported number of channels %d", numChannels);
 		return false;
@@ -166,7 +166,7 @@
 	byte *data = (byte *)malloc(size);
 	assert(data);
 	stream.read(data, size);
-	flags |= SoundMixer::FLAG_AUTOFREE;
+	flags |= Audio::Mixer::FLAG_AUTOFREE;
 
 	return makeLinearInputStream(rate, flags, data, size, 0, 0);
 }





More information about the Scummvm-git-logs mailing list