Line | |
---|
1 | /*! |
---|
2 | * @file sound_buffer_data.h |
---|
3 | * @brief Definition of the sound-buffer-datacontainer-class |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _SOUND_BUFFER_DATA_H |
---|
7 | #define _SOUND_BUFFER_DATA_H |
---|
8 | |
---|
9 | #include "base_object.h" |
---|
10 | #include "alincl.h" |
---|
11 | #include "util/count_pointer.h" |
---|
12 | |
---|
13 | // FORWARD DECLARATION |
---|
14 | typedef struct SDL_AudioSpec; |
---|
15 | |
---|
16 | namespace OrxSound |
---|
17 | { |
---|
18 | //! A class that represents a datastructure to play Sounds. |
---|
19 | class SoundBufferData : public BaseObject |
---|
20 | { |
---|
21 | ObjectListDeclaration(SoundBufferData); |
---|
22 | public: |
---|
23 | typedef CountPointer<SoundBufferData> Pointer; |
---|
24 | |
---|
25 | public: |
---|
26 | SoundBufferData(); |
---|
27 | virtual ~SoundBufferData(); |
---|
28 | |
---|
29 | bool load(const std::string& fileName); |
---|
30 | bool loadWAV(const std::string& fileName); |
---|
31 | bool loadOGG(const std::string& fileName); |
---|
32 | |
---|
33 | /** @returns the ID of the buffer used in this SoundBuffer */ |
---|
34 | inline ALuint getID() const { return this->bufferID; } |
---|
35 | inline bool loaded() const { return bLoaded; }; |
---|
36 | |
---|
37 | private: |
---|
38 | ALenum sdlAudioSpecToAlFormat(const SDL_AudioSpec* audiospec); |
---|
39 | |
---|
40 | private: |
---|
41 | ALuint bufferID; //!< The address of the Buffer. |
---|
42 | |
---|
43 | ALsizei size; //!< The size of the Buffer. |
---|
44 | ALboolean loop; //!< loop information. |
---|
45 | bool bLoaded; //!< If the Sound was loaded this is true. |
---|
46 | }; |
---|
47 | } |
---|
48 | #endif /* _SOUND_BUFFER_DATA_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.