|
Last change
on this file since 4830 was
4750,
checked in by bensch, 20 years ago
|
|
orxonox/trunk: injected the ogg-player into orxonox
|
|
File size:
960 bytes
|
| Line | |
|---|
| 1 | /*! |
|---|
| 2 | * @file ogg_player.h |
|---|
| 3 | * @brief Ogg-Player definition |
|---|
| 4 | */ |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | #ifndef _OGG_PLAYER_H |
|---|
| 8 | #define _OGG_PLAYER_H |
|---|
| 9 | |
|---|
| 10 | #include <string> |
|---|
| 11 | #include <iostream> |
|---|
| 12 | using namespace std; |
|---|
| 13 | |
|---|
| 14 | #include <AL/al.h> |
|---|
| 15 | #include <ogg/ogg.h> |
|---|
| 16 | #include <vorbis/vorbisfile.h> |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | #define BUFFER_SIZE (4096 * 4) |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | class OggStream |
|---|
| 25 | { |
|---|
| 26 | public: |
|---|
| 27 | |
|---|
| 28 | void open(string path); |
|---|
| 29 | void release(); |
|---|
| 30 | void display(); |
|---|
| 31 | bool playback(); |
|---|
| 32 | bool playing(); |
|---|
| 33 | bool update(); |
|---|
| 34 | |
|---|
| 35 | protected: |
|---|
| 36 | |
|---|
| 37 | bool stream(ALuint buffer); |
|---|
| 38 | void empty(); |
|---|
| 39 | void check(); |
|---|
| 40 | const char* errorString(int code); |
|---|
| 41 | |
|---|
| 42 | private: |
|---|
| 43 | |
|---|
| 44 | FILE* oggFile; |
|---|
| 45 | OggVorbis_File oggStream; |
|---|
| 46 | vorbis_info* vorbisInfo; |
|---|
| 47 | vorbis_comment* vorbisComment; |
|---|
| 48 | |
|---|
| 49 | ALuint buffers[2]; |
|---|
| 50 | ALuint source; |
|---|
| 51 | ALenum format; |
|---|
| 52 | }; |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | #endif /* _OGG_PLAYER_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.