From 7fbb3e05597e88d0421af2f720ec7d136605836e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 21 Dec 2003 01:17:03 +0000 Subject: Cleaned up SoundMixer::newStream() a bit (I plan to replace all usages of this by playInputStream(), this cleanup eases this a bit) svn-id: r11803 --- sound/mixer.cpp | 14 ++++---------- sound/mixer.h | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'sound') diff --git a/sound/mixer.cpp b/sound/mixer.cpp index a539cfc510..6f43a4c5f9 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -94,7 +94,7 @@ public: 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 @@ void SoundMixer::setupPremix(PremixProc *proc, void *param) { _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 @@ void Channel::mix(int16 *data, uint len) { } 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); diff --git a/sound/mixer.h b/sound/mixer.h index eda2df16ad..1f70419c81 100644 --- a/sound/mixer.h +++ b/sound/mixer.h @@ -111,7 +111,7 @@ public: /** 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); -- cgit v1.2.3