]> git.tdb.fi Git - libs/al.git/blobdiff - source/sounddecoder.h
Implement seeking in sound decoders
[libs/al.git] / source / sounddecoder.h
index 7a08644117317623d629b88559788036b5f16e8b..37fddac2ee34c8881163c30a875d451c7429d473 100644 (file)
@@ -8,6 +8,14 @@
 namespace Msp {
 namespace AL {
 
+class unsupported_sound: public std::runtime_error
+{
+public:
+       unsupported_sound(const std::string &);
+       virtual ~unsupported_sound() throw() { }
+};
+
+
 /**
 This class facilitates loading sound files.  Currently only Ogg Vorbis is
 supported.
@@ -29,7 +37,8 @@ public:
        static SoundDecoder *open_file(const std::string &);
        static SoundDecoder *open_io(IO::Seekable &);
 
-       virtual void rewind() = 0;
+       virtual void rewind() { seek(0); }
+       virtual void seek(unsigned) = 0;
        virtual unsigned read(char *, unsigned) = 0;
        bool eof() const { return eof_flag; }