Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/sound/ogg_player.h @ 7286

Last change on this file since 7286 was 7286, checked in by bensch, 19 years ago

trunk: very stuck at the moment…. segfaults and errors everywhere…. maybe i will sync back soon… :/

File size: 1.3 KB
Line 
1/*!
2 * @file ogg_player.h
3 * Ogg-Player definition
4 */
5
6
7#ifndef _OGG_PLAYER_H
8#define _OGG_PLAYER_H
9
10using namespace std;
11
12#include "base_object.h"
13
14#include "alincl.h"
15#include <ogg/ogg.h>
16#include <vorbis/vorbisfile.h>
17
18struct File;
19
20
21
22#define BUFFER_SIZE (8096 * 16)
23
24
25// the definition of a Ogg-Player
26class OggPlayer : public BaseObject
27{
28public:
29  OggPlayer(const std::string& fileName = "");
30  virtual ~OggPlayer();
31
32  bool open(const std::string& fileName);
33  void release();
34  void debug();
35  bool playback();
36  bool playing();
37  bool update();
38
39protected:
40
41  bool stream(ALuint buffer);
42  void empty();
43  const char* errorString(int code);
44
45private:
46  FILE*               oggFile;              //!< general file-handler, to open the sound-file
47  OggVorbis_File      oggStream;            //!< The stream this Ogg-player is playing back
48  vorbis_info*        vorbisInfo;           //!< The information held in the opened ogg-file
49  vorbis_comment*     vorbisComment;        //!< Comments about the ogg-file
50
51  ALuint              buffers[2];           //!< buffers that handle sequentially buffering of the audio
52  ALuint              source;               //!< The source we play back on
53  ALenum              format;               //!< The format we play back
54  bool                trackLoaded;          //!< If a Track has been loaded.
55};
56
57
58#endif /* _OGG_PLAYER_H */
Note: See TracBrowser for help on using the repository browser.