]> git.tdb.fi Git - libs/al.git/blob - source/buffer.h
Bump version for release
[libs/al.git] / source / buffer.h
1 /* $Id$
2
3 This file is part of libmspal
4 Copyright © 2008 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_AL_BUFFER_H_
9 #define MSP_AL_BUFFER_H_
10
11 #include <string>
12 #include <AL/al.h>
13 #include <msp/datafile/loader.h>
14 #include "format.h"
15 #include "types.h"
16
17 namespace Msp {
18 namespace AL {
19
20 class Sound;
21
22 /**
23 Buffers are used to store audio data and feed it into a Source.
24 */
25 class Buffer
26 {
27 public:
28         class Loader: public DataFile::Loader
29         {
30         private:
31                 Buffer &buf;
32
33         public:
34                 Loader(Buffer &);
35         private:
36                 void sound_data(const std::string &);
37         };
38
39 private:
40         uint id;
41
42 public:
43         Buffer();
44         ~Buffer();
45
46         uint get_id() const { return id; }
47         void data(Format, const void *, sizei, sizei);
48         void data(const Sound &);
49         void load_data(const std::string &);
50 };
51
52 } // namespace AL
53 } // namespace Msp
54
55 #endif