diff options
-rw-r--r-- | backends/midi/emumidi.h | 3 | ||||
-rw-r--r-- | saga/music.cpp | 11 | ||||
-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 | ||||
-rw-r--r-- | sword2/driver/d_sound.cpp | 15 | ||||
-rw-r--r-- | sword2/driver/d_sound.h | 1 |
9 files changed, 0 insertions, 103 deletions
diff --git a/backends/midi/emumidi.h b/backends/midi/emumidi.h index b15577e0fb..34cd4b0983 100644 --- a/backends/midi/emumidi.h +++ b/backends/midi/emumidi.h @@ -103,8 +103,5 @@ public: return numSamples; } - int16 read() { - error("ProcInputStream::read not supported"); - } bool endOfData() const { return false; } }; diff --git a/saga/music.cpp b/saga/music.cpp index b1a949b8f7..da4dce3681 100644 --- a/saga/music.cpp +++ b/saga/music.cpp @@ -74,7 +74,6 @@ public: int readBuffer(int16 *buffer, const int numSamples); - int16 read(); bool endOfData() const { return eosIntern(); } bool isStereo() const { return true; } int getRate() const { return 11025; } @@ -99,16 +98,6 @@ RAWInputStream::~RAWInputStream() { _file->decRef(); } -inline int16 RAWInputStream::read() { - assert(!eosIntern()); - - int16 sample = *_pos++; - if (_pos >= _bufferEnd) { - refill(); - } - return sample; -} - inline bool RAWInputStream::eosIntern() const { return _pos >= _bufferEnd; } 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; } diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp index 18012f4d52..6f6d4d94d3 100644 --- a/sword2/driver/d_sound.cpp +++ b/sword2/driver/d_sound.cpp @@ -166,7 +166,6 @@ public: int readBuffer(int16 *buffer, const int numSamples); - int16 read(); bool endOfData() const { return eosIntern(); } bool isStereo() const { return false; } int getRate() const { return 22050; } @@ -189,16 +188,6 @@ CLUInputStream::~CLUInputStream() { _file->decRef(); } -inline int16 CLUInputStream::read() { - assert(!eosIntern()); - - int16 sample = *_pos++; - if (_pos >= _bufferEnd) { - refill(); - } - return sample; -} - inline bool CLUInputStream::eosIntern() const { return _pos >= _bufferEnd; } @@ -566,10 +555,6 @@ int Sound::readBuffer(int16 *buffer, const int numSamples) { return numSamples; } -int16 Sound::read() { - error("ProcInputStream::read not supported"); -} - bool Sound::isStereo() const { return false; } bool Sound::endOfData() const { return !fpMus.isOpen(); } int Sound::getRate() const { return 22050; } diff --git a/sword2/driver/d_sound.h b/sword2/driver/d_sound.h index 234abbe08b..ddea6f41f7 100644 --- a/sword2/driver/d_sound.h +++ b/sword2/driver/d_sound.h @@ -93,7 +93,6 @@ public: // AudioStream API int readBuffer(int16 *buffer, const int numSamples); - int16 read(); bool isStereo() const; bool endOfData() const; int getRate() const; |