Line | |
---|
1 | /*! |
---|
2 | * @file sound_buffer.h |
---|
3 | * @brief Definition of the sound-buffer-class |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _SOUND_BUFFER_H |
---|
7 | #define _SOUND_BUFFER_H |
---|
8 | |
---|
9 | #include "base_object.h" |
---|
10 | #include "alincl.h" |
---|
11 | |
---|
12 | // FORWARD DECLARATION |
---|
13 | typedef struct SDL_AudioSpec; |
---|
14 | |
---|
15 | //! A class that represents a datastructure to play Sounds. |
---|
16 | class SoundBuffer : public BaseObject |
---|
17 | { |
---|
18 | public: |
---|
19 | SoundBuffer(const char* fileName); |
---|
20 | virtual ~SoundBuffer(); |
---|
21 | |
---|
22 | bool loadWAV(const char* fileName); |
---|
23 | |
---|
24 | /** @returns the ID of the buffer used in this SoundBuffer */ |
---|
25 | inline ALuint getID() const { return this->bufferID; } |
---|
26 | |
---|
27 | private: |
---|
28 | ALenum sdlAudioSpecToAlFormat(const SDL_AudioSpec* audiospec); |
---|
29 | |
---|
30 | private: |
---|
31 | ALuint bufferID; //!< The address of the Buffer. |
---|
32 | |
---|
33 | ALsizei size; //!< The size of the Buffer. |
---|
34 | ALboolean loop; //!< loop information. |
---|
35 | }; |
---|
36 | |
---|
37 | #endif /* _SOUND_BUFFER_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.