]> git.tdb.fi Git - libs/al.git/blob - source/source.h
df8bbc54c06310e91d430888a2aaddf5cedbad30
[libs/al.git] / source / source.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_SOURCE_H_
9 #define MSP_AL_SOURCE_H_
10
11 #include <vector>
12 #include <AL/al.h>
13 #include "types.h"
14
15 namespace Msp {
16 namespace AL {
17
18 class Buffer;
19
20 enum SourceState
21 {
22         INITIAL = AL_INITIAL,
23         PLAYING = AL_PLAYING,
24         PAUSED  = AL_PAUSED,
25         STOPPED = AL_STOPPED
26 };
27
28 class Source
29 {
30 private:
31         uint id;
32
33 public:
34         Source();
35         ~Source();
36
37         void attribute(ALenum, int);
38         void attribute(ALenum, float);
39         void attribute(ALenum, float, float, float);
40         void attribute(ALenum, const float *);
41         void get_attr(ALenum, int *) const;
42         void get_attr(ALenum, float *) const;
43         SourceState get_state() const;
44         void set_position(float, float, float);
45         void set_looping(bool);
46         void set_buffer(const Buffer &);
47         void queue_buffers(const std::vector<const Buffer *> &);
48         void queue_buffer(const Buffer &);
49         void play();
50         void pause();
51         void stop();
52         void rewind();
53 };
54
55 } // namespace AL
56 } // namespace Msp
57
58 #endif