diff options
author | Max Horn | 2007-02-28 12:54:59 +0000 |
---|---|---|
committer | Max Horn | 2007-02-28 12:54:59 +0000 |
commit | 6be027afaba3704d979e1905b269824630bd6708 (patch) | |
tree | 9e753f37f58d9ced05405e98cff0425e2b903bfb /sound | |
parent | 551b2b6b3d6e0f4f03b9084ca495068cb52df089 (diff) | |
download | scummvm-rg350-6be027afaba3704d979e1905b269824630bd6708.tar.gz scummvm-rg350-6be027afaba3704d979e1905b269824630bd6708.tar.bz2 scummvm-rg350-6be027afaba3704d979e1905b269824630bd6708.zip |
cleanup
svn-id: r25906
Diffstat (limited to 'sound')
-rw-r--r-- | sound/audiostream.cpp | 12 | ||||
-rw-r--r-- | sound/audiostream.h | 30 |
2 files changed, 10 insertions, 32 deletions
diff --git a/sound/audiostream.cpp b/sound/audiostream.cpp index 351deeb3b7..d3c0e2e745 100644 --- a/sound/audiostream.cpp +++ b/sound/audiostream.cpp @@ -32,6 +32,15 @@ #include "sound/flac.h" +// This used to be an inline template function, but +// buggy template function handling in MSVC6 forced +// us to go with the macro approach. So far this is +// the only template function that MSVC6 seemed to +// compile incorrectly. Knock on wood. +#define READ_ENDIAN_SAMPLE(is16Bit, isUnsigned, ptr, isLE) \ + ((is16Bit ? (isLE ? READ_LE_UINT16(ptr) : READ_BE_UINT16(ptr)) : (*ptr << 8)) ^ (isUnsigned ? 0x8000 : 0)) + + namespace Audio { struct StreamFileFormat { @@ -62,8 +71,7 @@ static const StreamFileFormat STREAM_FILEFORMATS[] = { { NULL, NULL, NULL } // Terminator }; -AudioStream* AudioStream::openStreamFile(const char *filename) -{ +AudioStream* AudioStream::openStreamFile(const char *filename) { char buffer[1024]; const uint len = strlen(filename); assert(len+6 < sizeof(buffer)); // we need a bigger buffer if wrong diff --git a/sound/audiostream.h b/sound/audiostream.h index 5aa46f2e85..b76f2f9cd2 100644 --- a/sound/audiostream.h +++ b/sound/audiostream.h @@ -89,27 +89,6 @@ public: static AudioStream* openStreamFile(const char *filename); }; -/** - * A simple AudioStream which represents a 'silent' stream, - * containing the specified number of zero samples. - */ -class ZeroInputStream : public AudioStream { -private: - int _len; -public: - ZeroInputStream(uint len) : _len(len) { } - int readBuffer(int16 *buffer, const int numSamples) { - int samples = MIN(_len, numSamples); - memset(buffer, 0, samples * 2); - _len -= samples; - return samples; - } - bool isStereo() const { return false; } - bool eos() const { return _len <= 0; } - - int getRate() const { return -1; } -}; - AudioStream *makeLinearInputStream(int rate, byte flags, const byte *ptr, uint32 len, uint loopOffset, uint loopLen); /** @@ -125,15 +104,6 @@ public: AppendableAudioStream *makeAppendableAudioStream(int rate, byte _flags, uint32 len); -// This used to be an inline template function, but -// buggy template function handling in MSVC6 forced -// us to go with the macro approach. So far this is -// the only template function that MSVC6 seemed to -// compile incorrectly. Knock on wood. -#define READ_ENDIAN_SAMPLE(is16Bit, isUnsigned, ptr, isLE) \ - ((is16Bit ? (isLE ? READ_LE_UINT16(ptr) : READ_BE_UINT16(ptr)) : (*ptr << 8)) ^ (isUnsigned ? 0x8000 : 0)) - - } // End of namespace Audio #endif |