]> git.tdb.fi Git - libs/al.git/blob - source/listener.cpp
74c50c9cc844a480d8195a3478af89a66688e6cf
[libs/al.git] / source / listener.cpp
1 #include "listener.h"
2
3 namespace Msp {
4 namespace AL {
5
6 Listener &Listener::instance()
7 {
8         static Listener listener;
9         return listener;
10 }
11
12 void Listener::attribute(ALenum attr, float v)
13 {
14         alListenerf(attr, v);
15 }
16
17 void Listener::attribute(ALenum attr, float v0, float v1, float v2)
18 {
19         alListener3f(attr, v0, v1, v2);
20 }
21
22 void Listener::attribute(ALenum attr, const float *v)
23 {
24         alListenerfv(attr, v);
25 }
26
27 void Listener::set_position(float x, float y, float z)
28 {
29         attribute(AL_POSITION, x, y, z);
30 }
31
32 void Listener::set_gain(float g)
33 {
34         attribute(AL_GAIN, g);
35 }
36
37 } // namespace AL
38 } // namespace Msp