aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2004-11-27 16:26:54 +0000
committerMax Horn2004-11-27 16:26:54 +0000
commit573e02bb4cd733c97caf850b805c25d6691ba718 (patch)
treed1293cec3304f15361ea25b9c47ba75edf20f784
parentd8406e26338a565313ee31ec8ce4814832744135 (diff)
downloadscummvm-rg350-573e02bb4cd733c97caf850b805c25d6691ba718.tar.gz
scummvm-rg350-573e02bb4cd733c97caf850b805c25d6691ba718.tar.bz2
scummvm-rg350-573e02bb4cd733c97caf850b805c25d6691ba718.zip
Removed the old setupPremix version, it is not needed anymore. Also fixed some doxygen comments (they were being assigned to the wrong things)
svn-id: r15918
-rw-r--r--sound/mixer.cpp46
-rw-r--r--sound/mixer.h41
2 files changed, 20 insertions, 67 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index b70f997126..cc6164ab0a 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -100,36 +100,6 @@ public:
#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 @@ bool SoundMixer::isPaused() {
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);
diff --git a/sound/mixer.h b/sound/mixer.h
index 725c1f7c4d..4f89d20666 100644
--- a/sound/mixer.h
+++ b/sound/mixer.h
@@ -53,13 +53,26 @@ public:
};
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 @@ public:
/**
- * 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.