]> git.tdb.fi Git - libs/al.git/blob - source/oggdecoder.h
Add dedicated exception classes for decoding sounds
[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 class OggDecoder: public SoundDecoder
22 {
23 private:
24         struct Private;
25
26         Private *priv;
27
28 public:
29         OggDecoder(IO::Seekable &);
30         ~OggDecoder();
31
32         virtual void rewind();
33         virtual unsigned read(char *, unsigned);
34 };
35
36 } // namespace AL
37 } // namespace Msp
38
39 #endif