[Scummvm-cvs-logs] CVS: scummvm/sound audiostream.cpp,1.66,1.67 mixer.cpp,1.167,1.168 mp3.cpp,1.13,1.14 vorbis.cpp,1.17,1.18 audiostream.h,1.40,1.41
Max Horn
fingolfin at users.sourceforge.net
Sat Nov 27 09:07:39 CET 2004
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3780/sound
Modified Files:
audiostream.cpp mixer.cpp mp3.cpp vorbis.cpp audiostream.h
Log Message:
AudioStream::read() has been removed quite some time ago, now making sure that change is reflected everywhere
Index: audiostream.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/audiostream.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- audiostream.cpp 11 Oct 2004 22:01:16 -0000 1.66
+++ audiostream.cpp 27 Nov 2004 13:54:08 -0000 1.67
@@ -149,16 +149,6 @@
}
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 @@
~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 @@
}
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()) {
Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -d -r1.167 -r1.168
--- mixer.cpp 11 Oct 2004 22:01:17 -0000 1.167
+++ mixer.cpp 27 Nov 2004 13:54:08 -0000 1.168
@@ -122,12 +122,6 @@
(_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; }
Index: mp3.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mp3.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- mp3.cpp 23 Oct 2004 13:39:03 -0000 1.13
+++ mp3.cpp 27 Nov 2004 13:54:08 -0000 1.14
@@ -59,7 +59,6 @@
~MP3InputStream();
int readBuffer(int16 *buffer, const int numSamples);
- int16 read();
bool endOfData() const { return eosIntern(); }
bool isStereo() const { return _isStereo; }
@@ -244,30 +243,6 @@
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
Index: vorbis.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/vorbis.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- vorbis.cpp 4 Sep 2004 10:12:22 -0000 1.17
+++ vorbis.cpp 27 Nov 2004 13:54:08 -0000 1.18
@@ -221,7 +221,6 @@
int readBuffer(int16 *buffer, const int numSamples);
- int16 read();
bool endOfData() const { return eosIntern(); }
bool isStereo() const { return _numChannels >= 2; }
@@ -259,16 +258,6 @@
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;
}
Index: audiostream.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/audiostream.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- audiostream.h 22 Nov 2004 22:52:48 -0000 1.40
+++ audiostream.h 27 Nov 2004 13:54:08 -0000 1.41
@@ -45,11 +45,6 @@
*/
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 @@
_len -= samples;
return samples;
}
- int16 read() { assert(_len > 0); _len--; return 0; }
bool isStereo() const { return false; }
bool eos() const { return _len <= 0; }
More information about the Scummvm-git-logs
mailing list