[Scummvm-cvs-logs] CVS: scummvm/sound mixer.cpp,1.169,1.170 mixer.h,1.82,1.83

Max Horn fingolfin at users.sourceforge.net
Sat Nov 27 09:20:55 CET 2004


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

Modified Files:
	mixer.cpp mixer.h 
Log Message:
Removed the old setupPremix version, it is not needed anymore. Also fixed some doxygen comments (they were being assigned to the wrong things)

Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.169
retrieving revision 1.170
diff -u -d -r1.169 -r1.170
--- mixer.cpp	27 Nov 2004 15:58:17 -0000	1.169
+++ mixer.cpp	27 Nov 2004 16:26:54 -0000	1.170
@@ -100,36 +100,6 @@
 
 
 #pragma mark -
-#pragma mark --- Procedural stream ---
-#pragma mark -
-
-
-class ProcInputStream : public AudioStream {
-public:
-	typedef void (*InputProc)(void *refCon, int16 *data, uint len);
-
-private:
-	const int _rate;
-	const bool _isStereo;
-	InputProc _proc;
-	void *_refCon;
-
-public:
-	ProcInputStream(int rate, bool stereo, InputProc proc, void *refCon)
-		: _rate(rate), _isStereo(stereo), _proc(proc), _refCon(refCon) { }
-	int readBuffer(int16 *buffer, const int numSamples) {
-		memset(buffer, 0, 2 * numSamples);	// FIXME
-		(_proc)(_refCon, buffer, _isStereo ? (numSamples / 2) : numSamples);
-		return numSamples;
-	}
-	bool isStereo() const { return _isStereo; }
-	bool endOfData() const { return false; }
-	
-	int getRate() const { return _rate; }
-};
-
-
-#pragma mark -
 #pragma mark --- SoundMixer ---
 #pragma mark -
 
@@ -172,22 +142,6 @@
 	return _paused;
 }
 
-void SoundMixer::setupPremix(PremixProc *proc, void *param) {
-	Common::StackLock lock(_mutex);
-
-	delete _premixChannel;
-	_premixChannel = 0;
-	
-	if (proc == 0)
-		return;
-
-	// Create an input stream
-	AudioStream *input = new ProcInputStream(_outputRate, true, proc, param);
-
-	// Create the channel
-	_premixChannel = new Channel(this, 0, input, true, false);
-}
-
 void SoundMixer::setupPremix(AudioStream *stream) {
 	Common::StackLock lock(_mutex);
 

Index: mixer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.h,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- mixer.h	27 Nov 2004 15:58:17 -0000	1.82
+++ mixer.h	27 Nov 2004 16:26:54 -0000	1.83
@@ -53,13 +53,26 @@
 	};
 
 	enum {
-		FLAG_UNSIGNED = 1 << 0,         /** unsigned samples (default: signed) */
-		FLAG_16BITS = 1 << 1,           /** sound is 16 bits wide (default: 8bit) */
-		FLAG_LITTLE_ENDIAN = 1 << 2,    /** sample is little endian (default: big endian) */
-		FLAG_STEREO = 1 << 3,           /** sound is in stereo (default: mono) */
-		FLAG_REVERSE_STEREO = 1 << 4,   /** reverse the left and right stereo channel */
-		FLAG_AUTOFREE = 1 << 5,         /** sound buffer is freed automagically at the end of playing */
-		FLAG_LOOP = 1 << 6              /** loop the audio */
+		/** unsigned samples (default: signed) */
+		FLAG_UNSIGNED = 1 << 0,
+
+		/** sound is 16 bits wide (default: 8bit) */
+		FLAG_16BITS = 1 << 1,
+
+		/** sample is little endian (default: big endian) */
+		FLAG_LITTLE_ENDIAN = 1 << 2,
+
+		/** sound is in stereo (default: mono) */
+		FLAG_STEREO = 1 << 3,
+
+		/** reverse the left and right stereo channel */
+		FLAG_REVERSE_STEREO = 1 << 4,
+
+		/** sound buffer is freed automagically at the end of playing */
+		FLAG_AUTOFREE = 1 << 5,
+
+		/** loop the audio */
+		FLAG_LOOP = 1 << 6
 	};
 
 private:
@@ -98,20 +111,6 @@
 
 
 	/**
-	 * Set the premix procedure. This is mainly used for the adlib music, but
-	 * is not limited to it. The premix proc is invoked by the mixer whenever
-	 * it needs to generate any data, before any other mixing takes place. The
-	 * premixer than has a chance to fill the mix buffer with data (usually
-	 * music samples). It should generate the specified number of 16bit stereo
-	 * samples (i.e. len * 4 bytes). The endianness of these samples shall be
-	 * the native endianness.
-	 *
-	 * @deprecated Instead of this, use the other setupPremix method which
-	 *             takes an AudioStream.
-	 */
-	void setupPremix(PremixProc *proc, void *param);
-
-	/**
 	 * Set the premix stream. This is mainly used for the adlib music, but
 	 * is not limited to it. The premix stream is invoked by the mixer whenever
 	 * it needs to generate any data, before any other mixing takes place.





More information about the Scummvm-git-logs mailing list