Last change
on this file since 663 was
430,
checked in by nicolape, 17 years ago
|
We now have a background sound playlist
|
File size:
882 bytes
|
Line | |
---|
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: |
---|
13 | AudioStream(std::string path); |
---|
14 | void open(); |
---|
15 | void release(); |
---|
16 | void display(); |
---|
17 | bool playback(); |
---|
18 | bool playing(); |
---|
19 | bool update(); |
---|
20 | inline bool isLoaded() { return loaded; } |
---|
21 | |
---|
22 | protected: |
---|
23 | |
---|
24 | bool stream(ALuint buffer); |
---|
25 | void empty(); |
---|
26 | void check(); |
---|
27 | std::string errorString(int code); |
---|
28 | |
---|
29 | private: |
---|
30 | |
---|
31 | std::string path; |
---|
32 | |
---|
33 | FILE* oggFile; |
---|
34 | OggVorbis_File oggStream; |
---|
35 | vorbis_info* vorbisInfo; |
---|
36 | vorbis_comment* vorbisComment; |
---|
37 | bool loaded; |
---|
38 | |
---|
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.