Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 7293 was 7293, checked in by bensch, 18 years ago

OggPlayer::state

File size: 1.7 KB
RevLine 
[4836]1/*!
2 * @file ogg_player.h
[4961]3 * Ogg-Player definition
[4836]4 */
5
6
7#ifndef _OGG_PLAYER_H
8#define _OGG_PLAYER_H
9
10using namespace std;
11
[4961]12#include "base_object.h"
13
[5279]14#include "alincl.h"
[4836]15#include <ogg/ogg.h>
16#include <vorbis/vorbisfile.h>
17
[5282]18struct File;
[4836]19
20
[7054]21#define BUFFER_SIZE (8096 * 16)
[4836]22
23
[4961]24// the definition of a Ogg-Player
25class OggPlayer : public BaseObject
[6871]26{
27public:
[7221]28  OggPlayer(const std::string& fileName = "");
[6981]29  virtual ~OggPlayer();
[4836]30
[7221]31  bool open(const std::string& fileName);
[6871]32  void release();
33  void debug();
34  bool playback();
35  bool playing();
36  bool update();
[4836]37
[6871]38protected:
39  bool stream(ALuint buffer);
40  void empty();
41  const char* errorString(int code);
[4836]42
[7293]43  public:
44    typedef enum {
45      None                   = 0x000,
46      FileOpened             = 0x100,
47      SourceAllocated        = 0x200,
48      BuffersAllocated       = 0x400,
49      Stopped                = 0x010,
50      Playing                = 0x020,
51      Paused                 = 0x040,
52      Error                  = 0x001,
53    } State;
54
[6871]55private:
56  FILE*               oggFile;              //!< general file-handler, to open the sound-file
57  OggVorbis_File      oggStream;            //!< The stream this Ogg-player is playing back
58  vorbis_info*        vorbisInfo;           //!< The information held in the opened ogg-file
59  vorbis_comment*     vorbisComment;        //!< Comments about the ogg-file
[4836]60
[6871]61  ALuint              buffers[2];           //!< buffers that handle sequentially buffering of the audio
62  ALuint              source;               //!< The source we play back on
63  ALenum              format;               //!< The format we play back
[7293]64  unsigned int        state;
65  //bool                trackLoaded;          //!< If a Track has been loaded.
[6871]66};
[4836]67
68
69#endif /* _OGG_PLAYER_H */
Note: See TracBrowser for help on using the repository browser.