]> git.tdb.fi Git - libs/al.git/blob - source/oggdecoder.h
Fix sound file signature comparisons
[libs/al.git] / source / oggdecoder.h
1 #ifndef MSP_AL_OGGDECODER_H_
2 #define MSP_AL_OGGDECODER_H_
3
4 #include <stdexcept>
5 #include "sounddecoder.h"
6
7 namespace Msp {
8 namespace AL {
9
10 class ogg_error: public std::runtime_error
11 {
12 public:
13         ogg_error(const std::string &, int);
14         virtual ~ogg_error() throw() { }
15
16 private:
17         static std::string get_message(int);
18 };
19
20
21 /**
22 Decoder for Ogg Vorbis files.  Normally you should use one of the
23 SoundDecoder::open_* functions to create a decoder.
24 */
25 class OggDecoder: public SoundDecoder
26 {
27 private:
28         struct Private;
29
30         Private *priv;
31
32 public:
33         OggDecoder(IO::Seekable &);
34         ~OggDecoder();
35
36         static bool detect(const std::string &);
37
38         virtual void seek(unsigned);
39         virtual unsigned read(char *, unsigned);
40 };
41
42 } // namespace AL
43 } // namespace Msp
44
45 #endif