aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2003-12-21 01:17:03 +0000
committerMax Horn2003-12-21 01:17:03 +0000
commit7fbb3e05597e88d0421af2f720ec7d136605836e (patch)
treeff31a330fff91117d54944c9f7a733ab8e641ab6 /sound
parent2bbaff0890b2f5920052257d7297daa72bb09606 (diff)
downloadscummvm-rg350-7fbb3e05597e88d0421af2f720ec7d136605836e.tar.gz
scummvm-rg350-7fbb3e05597e88d0421af2f720ec7d136605836e.tar.bz2
scummvm-rg350-7fbb3e05597e88d0421af2f720ec7d136605836e.zip
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
Diffstat (limited to 'sound')
-rw-r--r--sound/mixer.cpp14
-rw-r--r--sound/mixer.h2
2 files changed, 5 insertions, 11 deletions
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);