X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsounddecoder.h;fp=source%2Fsounddecoder.h;h=7a08644117317623d629b88559788036b5f16e8b;hb=10cdb043b613d60c5de8f1cce0f7a5512b0d0074;hp=c9566592f38870198e84bc8a263cf65d5b177522;hpb=ef9906f379e066cb9c754853a3cc771e8e881356;p=libs%2Fal.git diff --git a/source/sounddecoder.h b/source/sounddecoder.h index c956659..7a08644 100644 --- a/source/sounddecoder.h +++ b/source/sounddecoder.h @@ -1,8 +1,7 @@ -#ifndef MSP_AL_SOUND_H_ -#define MSP_AL_SOUND_H_ +#ifndef MSP_AL_SOUNDDECODER_H_ +#define MSP_AL_SOUNDDECODER_H_ #include -#include #include #include "format.h" @@ -16,25 +15,22 @@ supported. class SoundDecoder { private: - OggVorbis_File ovfile; IO::Seekable *source; +protected: unsigned freq; unsigned size; Format format; bool eof_flag; -public: SoundDecoder(); - ~SoundDecoder(); - - void open_file(const std::string &); - void open_io(IO::Seekable &); -private: - void open_common(); public: - void close(); - void rewind(); - unsigned read(char *, unsigned); + virtual ~SoundDecoder(); + + static SoundDecoder *open_file(const std::string &); + static SoundDecoder *open_io(IO::Seekable &); + + virtual void rewind() = 0; + virtual unsigned read(char *, unsigned) = 0; bool eof() const { return eof_flag; } Format get_format() const { return format; }