[Scummvm-cvs-logs] CVS: scummvm/sound mixer.cpp,1.140,1.141 mixer.h,1.62,1.63

Max Horn fingolfin at users.sourceforge.net
Sat Dec 20 17:18:04 CET 2003


Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1:/tmp/cvs-serv26526/sound

Modified Files:
	mixer.cpp mixer.h 
Log Message:
Cleaned up SoundMixer::newStream() a bit (I plan to replace all usages of this by playInputStream(), this cleanup eases this a bit)

Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -d -r1.140 -r1.141
--- mixer.cpp	21 Dec 2003 00:44:31 -0000	1.140
+++ mixer.cpp	21 Dec 2003 01:17:03 -0000	1.141
@@ -94,7 +94,7 @@
 
 class ChannelStream : public Channel {
 public:
-	ChannelStream(SoundMixer *mixer, PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags, uint32 buffer_size, byte volume, int8 pan);
+	ChannelStream(SoundMixer *mixer, PlayingSoundHandle *handle, uint rate, byte flags, uint32 buffer_size, byte volume, int8 pan);
 	void append(void *sound, uint32 size);
 
 	void finish();
@@ -149,9 +149,9 @@
 	_premixProc = proc;
 }
 
-void SoundMixer::newStream(PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags, uint32 buffer_size, byte volume, int8 pan) {
+void SoundMixer::newStream(PlayingSoundHandle *handle, uint rate, byte flags, uint32 buffer_size, byte volume, int8 pan) {
 	Common::StackLock lock(_mutex);
-	insertChannel(handle, new ChannelStream(this, handle, sound, size, rate, flags, buffer_size, volume, pan));
+	insertChannel(handle, new ChannelStream(this, handle, rate, flags, buffer_size, volume, pan));
 }
 
 void SoundMixer::appendStream(PlayingSoundHandle handle, void *sound, uint32 size) {
@@ -496,16 +496,10 @@
 }
 
 ChannelStream::ChannelStream(SoundMixer *mixer, PlayingSoundHandle *handle,
-							void *sound, uint32 size, uint rate,
-							byte flags, uint32 buffer_size, byte volume, int8 pan)
+							uint rate, byte flags, uint32 buffer_size, byte volume, int8 pan)
 	: Channel(mixer, handle, true, volume, pan) {
-	assert(size <= buffer_size);
-
 	// Create the input stream
 	_input = makeWrappedInputStream(rate, flags, buffer_size);
-	
-	// Append the initial data
-	append(sound, size);
 
 	// Get a rate converter instance
 	_converter = makeRateConverter(_input->getRate(), mixer->getOutputRate(), _input->isStereo(), (flags & SoundMixer::FLAG_REVERSE_STEREO) != 0);

Index: mixer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.h,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- mixer.h	21 Dec 2003 00:44:31 -0000	1.62
+++ mixer.h	21 Dec 2003 01:17:03 -0000	1.63
@@ -111,7 +111,7 @@
 
 
 	/** Start a new stream. */
-	void newStream(PlayingSoundHandle *handle, void *sound, uint32 size, uint rate, byte flags, uint32 buffer_size, byte volume = 255, int8 pan = 0);
+	void newStream(PlayingSoundHandle *handle, uint rate, byte flags, uint32 buffer_size, byte volume = 255, int8 pan = 0);
 
 	/** Append to an existing stream. */
 	void appendStream(PlayingSoundHandle handle, void *sound, uint32 size);





More information about the Scummvm-git-logs mailing list