mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
AudioStream::read() has been removed quite some time ago, now making sure that change is reflected everywhere
svn-id: r15911
This commit is contained in:
@@ -103,8 +103,5 @@ public:
|
||||
|
||||
return numSamples;
|
||||
}
|
||||
int16 read() {
|
||||
error("ProcInputStream::read not supported");
|
||||
}
|
||||
bool endOfData() const { return false; }
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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(); }
|
||||
@@ -235,20 +224,6 @@ AppendableMemoryStream<stereo, is16Bit, isUnsigned, isLE>::AppendableMemoryStrea
|
||||
_bufferEnd = _bufferStart + bufferSize;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user