]> git.tdb.fi Git - libs/al.git/blob - source/source.h
Fix compilation on OS X
[libs/al.git] / source / source.h
1 #ifndef MSP_AL_SOURCE_H_
2 #define MSP_AL_SOURCE_H_
3
4 #include <vector>
5 #include "al.h"
6 #include "types.h"
7
8 namespace Msp {
9 namespace AL {
10
11 class Buffer;
12
13 enum SourceState
14 {
15         INITIAL = AL_INITIAL,
16         PLAYING = AL_PLAYING,
17         PAUSED  = AL_PAUSED,
18         STOPPED = AL_STOPPED
19 };
20
21 /**
22 Represents an audio source in the 3D environment.
23 */
24 class Source
25 {
26 private:
27         uint id;
28
29 public:
30         Source();
31         ~Source();
32
33         SourceState get_state() const;
34         void set_position(float, float, float);
35         void set_velocity(float, float, float);
36         void set_gain(float);
37         void set_rolloff_factor(float);
38
39         void set_buffer(const Buffer &);
40         void queue_buffers(const std::vector<const Buffer *> &);
41         void queue_buffer(const Buffer &);
42         void unqueue_buffers(const std::vector<const Buffer *> &);
43         void unqueue_buffer(const Buffer &);
44         void clear_buffers();
45         unsigned get_buffers_queued() const;
46         unsigned get_buffers_processed() const;
47
48         void set_looping(bool);
49         void play();
50         void pause();
51         void stop();
52         void rewind();
53 };
54
55 } // namespace AL
56 } // namespace Msp
57
58 #endif