Line | |
---|
1 | #ifndef AUDIOMANAGER_H_ |
---|
2 | #define AUDIOMANAGER_H_ |
---|
3 | |
---|
4 | #include <iostream> |
---|
5 | #include <string> |
---|
6 | #include <vector> |
---|
7 | |
---|
8 | #include <AL/al.h> |
---|
9 | #include <AL/alc.h> |
---|
10 | #include <AL/alut.h> |
---|
11 | |
---|
12 | #include "AudioBuffer.h" |
---|
13 | #include "AudioSource.h" |
---|
14 | |
---|
15 | namespace audio |
---|
16 | { |
---|
17 | class AudioManager |
---|
18 | { |
---|
19 | public: |
---|
20 | // Init audio |
---|
21 | AudioManager(); |
---|
22 | // Kill audio and set buffers, sources and memory free |
---|
23 | ~AudioManager(); |
---|
24 | // Set listener position |
---|
25 | void setPos(std::vector<float> newPosition); |
---|
26 | // Set listener speed |
---|
27 | void setSpeed(std::vector<float> newSpeed); |
---|
28 | // Set listener orientation (first is direction |
---|
29 | // the listener looks at, the second is the direction |
---|
30 | // upwards the listener) |
---|
31 | void setOri(std::vector<float> at, std::vector<float> up); |
---|
32 | // Parses given xml string |
---|
33 | void loadParams(); |
---|
34 | private: |
---|
35 | |
---|
36 | |
---|
37 | // Vector containing all audio files |
---|
38 | std::vector<AudioBuffer> buffers; |
---|
39 | // Vector containing all audio sources which referer to one buffer |
---|
40 | std::vector<AudioSource> sources; |
---|
41 | // The ambient background sound |
---|
42 | AudioSource ambient; |
---|
43 | |
---|
44 | std::vector<float> listenerPosition; |
---|
45 | std::vector<float> listenerSpeed; |
---|
46 | std::vector<float> listenerAt; |
---|
47 | std::vector<float> listenerup; |
---|
48 | }; |
---|
49 | } |
---|
50 | |
---|
51 | #endif /*AUDIOMANAGER_H_*/ |
---|
Note: See
TracBrowser
for help on using the repository browser.