]> git.tdb.fi Git - libs/al.git/blob - source/source.h
Drop copyright notices and Id tags from source files
[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/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         void attribute(ALenum, int);
34         void attribute(ALenum, float);
35         void attribute(ALenum, float, float, float);
36         void attribute(ALenum, const float *);
37         void get_attribute(ALenum, int *) const;
38         void get_attribute(ALenum, float *) const;
39
40         SourceState get_state() const;
41         void set_position(float, float, float);
42         void set_gain(float);
43
44         void set_rolloff_factor(float);
45         void set_buffer(const Buffer &);
46         void queue_buffers(const std::vector<const Buffer *> &);
47         void queue_buffer(const Buffer &);
48         void unqueue_buffers(const std::vector<const Buffer *> &);
49         void unqueue_buffer(const Buffer &);
50         void clear_buffers();
51         unsigned get_buffers_queued() const;
52         unsigned get_buffers_processed() const;
53
54         void set_looping(bool);
55         void play();
56         void pause();
57         void stop();
58         void rewind();
59 };
60
61 } // namespace AL
62 } // namespace Msp
63
64 #endif