diff options
author | Max Horn | 2004-11-27 13:54:09 +0000 |
---|---|---|
committer | Max Horn | 2004-11-27 13:54:09 +0000 |
commit | 1a7ca2dc2a71fed65673b4e3934f2151cc8475d1 (patch) | |
tree | b1256be8e9864aeda86ccfd77fa67353d0029859 /sound | |
parent | 1733863e711b1a9ef234416a21369b6bf713ee6f (diff) | |
download | scummvm-rg350-1a7ca2dc2a71fed65673b4e3934f2151cc8475d1.tar.gz scummvm-rg350-1a7ca2dc2a71fed65673b4e3934f2151cc8475d1.tar.bz2 scummvm-rg350-1a7ca2dc2a71fed65673b4e3934f2151cc8475d1.zip |
AudioStream::read() has been removed quite some time ago, now making sure that change is reflected everywhere
svn-id: r15911
Diffstat (limited to 'sound')
-rw-r--r-- | sound/audiostream.cpp | 25 | ||||
-rw-r--r-- | sound/audiostream.h | 6 | ||||
-rw-r--r-- | sound/mixer.cpp | 6 | ||||
-rw-r--r-- | sound/mp3.cpp | 25 | ||||
-rw-r--r-- | sound/vorbis.cpp | 11 |
5 files changed, 0 insertions, 73 deletions
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp index 3f66ebfce9..81c051221f 100644 --- a/sound/audiostream.cpp +++ b/sound/audiostream.cpp @@ -149,16 +149,6 @@ public: } int readBuffer(int16 *buffer, const int numSamples); - int16 read() { - //assert(_ptr < _end); - int16 val = READ_ENDIAN_SAMPLE(is16Bit, isUnsigned, _ptr, isLE); - _ptr += (is16Bit ? 2 : 1); - if (_loopPtr && eosIntern()) { - _ptr = _loopPtr; - _end = _loopEnd; - } - return val; - } bool isStereo() const { return stereo; } bool endOfData() const { return eosIntern(); } @@ -209,7 +199,6 @@ public: ~AppendableMemoryStream() { free(_bufferStart); } int readBuffer(int16 *buffer, const int numSamples); - int16 read(); bool isStereo() const { return stereo; } bool endOfStream() const { return _finalized && eosIntern(); } bool endOfData() const { return eosIntern(); } @@ -236,20 +225,6 @@ AppendableMemoryStream<stereo, is16Bit, isUnsigned, isLE>::AppendableMemoryStrea } template<bool stereo, bool is16Bit, bool isUnsigned, bool isLE> -inline int16 AppendableMemoryStream<stereo, is16Bit, isUnsigned, isLE>::read() { - assert(!eosIntern()); - - // Wrap around? - if (_pos >= _bufferEnd) - _pos = _pos - (_bufferEnd - _bufferStart); - - int16 val = READ_ENDIAN_SAMPLE(is16Bit, isUnsigned, _pos, isLE); - _pos += (is16Bit ? 2 : 1); - - return val; -} - -template<bool stereo, bool is16Bit, bool isUnsigned, bool isLE> int AppendableMemoryStream<stereo, is16Bit, isUnsigned, isLE>::readBuffer(int16 *buffer, const int numSamples) { int samples = 0; while (samples < numSamples && !eosIntern()) { diff --git a/sound/audiostream.h b/sound/audiostream.h index 8bd3f0b76d..19fbd41206 100644 --- a/sound/audiostream.h +++ b/sound/audiostream.h @@ -45,11 +45,6 @@ public: */ virtual int readBuffer(int16 *buffer, const int numSamples) = 0; - /** - * Read a single (16 bit signed) sample from the stream. - */ -// virtual int16 read() = 0; - /** Is this a stereo stream? */ virtual bool isStereo() const = 0; @@ -103,7 +98,6 @@ public: _len -= samples; return samples; } - int16 read() { assert(_len > 0); _len--; return 0; } bool isStereo() const { return false; } bool eos() const { return _len <= 0; } diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 1849ab3f48..6ecbe68fdd 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -122,12 +122,6 @@ public: (_proc)(_refCon, buffer, _isStereo ? (numSamples / 2) : numSamples); return numSamples; } - int16 read() { - error("ProcInputStream::read not supported"); - int16 sample[2] = { 0, 0 }; - (_proc)(_refCon, sample, 1); - return sample[0]; - } bool isStereo() const { return _isStereo; } bool endOfData() const { return false; } diff --git a/sound/mp3.cpp b/sound/mp3.cpp index 3d2afbcdc8..a81f2171e3 100644 --- a/sound/mp3.cpp +++ b/sound/mp3.cpp @@ -59,7 +59,6 @@ public: ~MP3InputStream(); int readBuffer(int16 *buffer, const int numSamples); - int16 read(); bool endOfData() const { return eosIntern(); } bool isStereo() const { return _isStereo; } @@ -244,30 +243,6 @@ static inline int scale_sample(mad_fixed_t sample) { return sample >> (MAD_F_FRACBITS + 1 - 16); } -inline int16 MP3InputStream::read() { - assert(!eosIntern()); - - int16 sample; - if (_isStereo) { - sample = (int16)scale_sample(_synth.pcm.samples[_curChannel][_posInFrame]); - if (_curChannel == 0) { - _curChannel = 1; - } else { - _posInFrame++; - _curChannel = 0; - } - } else { - sample = (int16)scale_sample(_synth.pcm.samples[0][_posInFrame]); - _posInFrame++; - } - - if (_posInFrame >= _synth.pcm.length) { - refill(); - } - - return sample; -} - int MP3InputStream::readBuffer(int16 *buffer, const int numSamples) { int samples = 0; assert(_curChannel == 0); // Paranoia check diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp index e629a9b093..2b3b416fb3 100644 --- a/sound/vorbis.cpp +++ b/sound/vorbis.cpp @@ -221,7 +221,6 @@ public: int readBuffer(int16 *buffer, const int numSamples); - int16 read(); bool endOfData() const { return eosIntern(); } bool isStereo() const { return _numChannels >= 2; } @@ -259,16 +258,6 @@ VorbisInputStream::~VorbisInputStream() { delete _ov_file; } -inline int16 VorbisInputStream::read() { - assert(!eosIntern()); - - int16 sample = *_pos++; - if (_pos >= _bufferEnd) { - refill(); - } - return sample; -} - inline bool VorbisInputStream::eosIntern() const { return _pos >= _bufferEnd; } |