| Line |   | 
|---|
| 1 | #ifndef _AudioStream_H__ | 
|---|
| 2 | #define _AudioStream_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 |       bool stream(ALuint buffer); | 
|---|
| 24 |       void empty(); | 
|---|
| 25 |       void check(); | 
|---|
| 26 |       std::string errorString(int code); | 
|---|
| 27 |  | 
|---|
| 28 |     private: | 
|---|
| 29 |       std::string path; | 
|---|
| 30 |  | 
|---|
| 31 |       FILE*           oggFile; | 
|---|
| 32 |       OggVorbis_File  oggStream; | 
|---|
| 33 |       vorbis_info*    vorbisInfo; | 
|---|
| 34 |       vorbis_comment* vorbisComment; | 
|---|
| 35 |       bool loaded; | 
|---|
| 36 |  | 
|---|
| 37 |       ALuint buffers[2]; | 
|---|
| 38 |       ALuint source; | 
|---|
| 39 |       ALenum format; | 
|---|
| 40 |   }; | 
|---|
| 41 | } | 
|---|
| 42 |  | 
|---|
| 43 | #endif /* _AudioStream_H__ */ | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.