]> git.tdb.fi Git - libs/al.git/blob - source/source.h
Add Streamer class
[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_attribute(ALenum, int *) const;
42         void get_attribute(ALenum, float *) const;
43         SourceState get_state() const;
44         unsigned get_buffers_queued() const;
45         unsigned get_buffers_processed() const;
46         void set_position(float, float, float);
47         void set_looping(bool);
48         void set_buffer(const Buffer &);
49         void queue_buffers(const std::vector<const Buffer *> &);
50         void queue_buffer(const Buffer &);
51         void unqueue_buffers(const std::vector<const Buffer *> &);
52         void unqueue_buffer(const Buffer &);
53         void clear_buffers();
54         void play();
55         void pause();
56         void stop();
57         void rewind();
58 };
59
60 } // namespace AL
61 } // namespace Msp
62
63 #endif