Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/trunk: loading some stuff from ths sound-engine

File size: 1.3 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
10#include <iostream>
11using namespace std;
12
[4961]13#include "base_object.h"
14
[4836]15#include <AL/al.h>
16#include <ogg/ogg.h>
17#include <vorbis/vorbisfile.h>
18
19
20
[4985]21#define BUFFER_SIZE (4096 * 4)
[4836]22
23
[4961]24// the definition of a Ogg-Player
25class OggPlayer : public BaseObject
26  {
27  public:
28    OggPlayer(const char* fileName = NULL);
[4836]29
[4961]30    void open(const char* fileName);
31    void release();
32    void display();
33    bool playback();
34    bool playing();
35    bool update();
[4836]36
[4961]37  protected:
[4836]38
[4961]39    bool stream(ALuint buffer);
40    void empty();
41    void check();
42    const char* errorString(int code);
[4836]43
[4961]44  private:
[4836]45
[4961]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
[4836]50
[4961]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  };
[4836]55
56
57#endif /* _OGG_PLAYER_H */
Note: See TracBrowser for help on using the repository browser.