diff options
author | Max Horn | 2003-12-17 02:19:24 +0000 |
---|---|---|
committer | Max Horn | 2003-12-17 02:19:24 +0000 |
commit | e7bf167428968ac894a8be035a38985c08c0d7c3 (patch) | |
tree | 999c73865c2f1a7b279df46637748995a96b55fe /sound/audiostream.h | |
parent | 4da0b08b90b08baa988ad11adfb5f7952384f04d (diff) | |
download | scummvm-rg350-e7bf167428968ac894a8be035a38985c08c0d7c3.tar.gz scummvm-rg350-e7bf167428968ac894a8be035a38985c08c0d7c3.tar.bz2 scummvm-rg350-e7bf167428968ac894a8be035a38985c08c0d7c3.zip |
Made sure that *all* AudioInputStream 'know' their sample rate; removed pointless MusicStream class; removed various specific Channel subclasses and instead generalized the base class some more
svn-id: r11699
Diffstat (limited to 'sound/audiostream.h')
-rw-r--r-- | sound/audiostream.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/sound/audiostream.h b/sound/audiostream.h index 5e8455cc5a..ef702d3259 100644 --- a/sound/audiostream.h +++ b/sound/audiostream.h @@ -68,16 +68,17 @@ public: return samples; } - /** Read a singel (16 bit signed) sample from the stream. */ + /** Read a single (16 bit signed) sample from the stream. */ virtual int16 read() = 0; /** Is this a stereo stream? */ virtual bool isStereo() const = 0; - /* End of stream reached? */ + /** End of stream reached? */ virtual bool eos() const = 0; - virtual int getRate() const { return -1; } + /** Sample rate of the stream. */ + virtual int getRate() const = 0; }; class WrappedAudioInputStream : public AudioInputStream { @@ -101,23 +102,19 @@ public: int size() const { return _len; } bool isStereo() const { return false; } bool eos() const { return _len <= 0; } + + int getRate() const { return -1; } }; -class MusicStream : public AudioInputStream { -public: - virtual int getRate() const = 0; -}; - - -AudioInputStream *makeLinearInputStream(byte _flags, const byte *ptr, uint32 len, uint loopOffset, uint loopLen); -WrappedAudioInputStream *makeWrappedInputStream(byte _flags, uint32 len); +AudioInputStream *makeLinearInputStream(int rate, byte _flags, const byte *ptr, uint32 len, uint loopOffset, uint loopLen); +WrappedAudioInputStream *makeWrappedInputStream(int rate, byte _flags, uint32 len); #ifdef USE_MAD -MusicStream *makeMP3Stream(File *file, mad_timer_t duration, uint size = 0); +AudioInputStream *makeMP3Stream(File *file, mad_timer_t duration, uint size = 0); #endif #ifdef USE_VORBIS -MusicStream *makeVorbisStream(OggVorbis_File *file, int duration); +AudioInputStream *makeVorbisStream(OggVorbis_File *file, int duration); #endif |