Last change
on this file since 420 was
419,
checked in by nicolape, 17 years ago
|
We now have a nice backgroundsound playing
|
File size:
1.2 KB
|
Rev | Line | |
---|
[349] | 1 | #ifndef AUDIOMANAGER_H_ |
---|
| 2 | #define AUDIOMANAGER_H_ |
---|
| 3 | |
---|
[409] | 4 | #include "AudioIncludes.h" |
---|
[349] | 5 | |
---|
| 6 | #include "AudioBuffer.h" |
---|
| 7 | #include "AudioSource.h" |
---|
[419] | 8 | #include "AudioStream.h" |
---|
[349] | 9 | |
---|
| 10 | namespace audio |
---|
| 11 | { |
---|
| 12 | class AudioManager |
---|
| 13 | { |
---|
| 14 | public: |
---|
[419] | 15 | |
---|
[349] | 16 | // Init audio |
---|
| 17 | AudioManager(); |
---|
[419] | 18 | |
---|
[349] | 19 | // Kill audio and set buffers, sources and memory free |
---|
| 20 | ~AudioManager(); |
---|
[419] | 21 | |
---|
[349] | 22 | // Set listener position |
---|
| 23 | void setPos(std::vector<float> newPosition); |
---|
[419] | 24 | |
---|
[349] | 25 | // Set listener speed |
---|
| 26 | void setSpeed(std::vector<float> newSpeed); |
---|
[419] | 27 | |
---|
[349] | 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); |
---|
[419] | 32 | |
---|
[377] | 33 | // Parses given xml string |
---|
| 34 | void loadParams(); |
---|
[419] | 35 | |
---|
| 36 | // Update |
---|
| 37 | void update(); |
---|
| 38 | |
---|
[349] | 39 | private: |
---|
[377] | 40 | |
---|
[419] | 41 | // Backgroundsound |
---|
| 42 | AudioStream bgSound; |
---|
[377] | 43 | |
---|
[349] | 44 | // Vector containing all audio files |
---|
| 45 | std::vector<AudioBuffer> buffers; |
---|
| 46 | // Vector containing all audio sources which referer to one buffer |
---|
| 47 | std::vector<AudioSource> sources; |
---|
| 48 | // The ambient background sound |
---|
| 49 | AudioSource ambient; |
---|
| 50 | |
---|
| 51 | std::vector<float> listenerPosition; |
---|
| 52 | std::vector<float> listenerSpeed; |
---|
| 53 | std::vector<float> listenerAt; |
---|
| 54 | std::vector<float> listenerup; |
---|
| 55 | }; |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | #endif /*AUDIOMANAGER_H_*/ |
---|
Note: See
TracBrowser
for help on using the repository browser.