Last change
on this file since 540 was
430,
checked in by nicolape, 17 years ago
|
We now have a background sound playlist
|
File size:
882 bytes
|
Rev | Line | |
---|
[410] | 1 | #ifndef __ogg_h__ |
---|
| 2 | #define __ogg_h__ |
---|
| 3 | |
---|
| 4 | #include "AudioIncludes.h" |
---|
| 5 | |
---|
| 6 | namespace audio |
---|
| 7 | { |
---|
| 8 | #define BUFFER_SIZE (4096 * 4) |
---|
| 9 | |
---|
| 10 | class AudioStream |
---|
| 11 | { |
---|
| 12 | public: |
---|
[430] | 13 | AudioStream(std::string path); |
---|
| 14 | void open(); |
---|
[410] | 15 | void release(); |
---|
| 16 | void display(); |
---|
| 17 | bool playback(); |
---|
| 18 | bool playing(); |
---|
| 19 | bool update(); |
---|
[423] | 20 | inline bool isLoaded() { return loaded; } |
---|
| 21 | |
---|
[410] | 22 | protected: |
---|
| 23 | |
---|
| 24 | bool stream(ALuint buffer); |
---|
| 25 | void empty(); |
---|
| 26 | void check(); |
---|
| 27 | std::string errorString(int code); |
---|
| 28 | |
---|
| 29 | private: |
---|
[430] | 30 | |
---|
| 31 | std::string path; |
---|
| 32 | |
---|
[410] | 33 | FILE* oggFile; |
---|
| 34 | OggVorbis_File oggStream; |
---|
| 35 | vorbis_info* vorbisInfo; |
---|
| 36 | vorbis_comment* vorbisComment; |
---|
[423] | 37 | bool loaded; |
---|
| 38 | |
---|
[410] | 39 | ALuint buffers[2]; |
---|
| 40 | ALuint source; |
---|
| 41 | ALenum format; |
---|
| 42 | }; |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | #endif // __ogg_h__ |
---|
Note: See
TracBrowser
for help on using the repository browser.