Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4961 in orxonox.OLD for orxonox/trunk/src/lib/sound/ogg_player.h


Ignore:
Timestamp:
Jul 28, 2005, 1:19:50 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: music now plays back, as one would expect, and the ReosurceManager handles ogg's.
Also the naming has changed a bit, and doxygen tags are complete in ogg_player.h/cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/sound/ogg_player.h

    r4836 r4961  
    11/*!
    22 * @file ogg_player.h
    3  *  Ogg-Player definition
     3 * Ogg-Player definition
    44 */
    55
     
    88#define _OGG_PLAYER_H
    99
    10 #include <string>
    1110#include <iostream>
    1211using namespace std;
     12
     13#include "base_object.h"
    1314
    1415#include <AL/al.h>
     
    2122
    2223
     24// the definition of a Ogg-Player
     25class OggPlayer : public BaseObject
     26  {
     27  public:
     28    OggPlayer(const char* fileName = NULL);
    2329
    24 class OggStream
    25 {
    26     public:
     30    void open(const char* fileName);
     31    void release();
     32    void display();
     33    bool playback();
     34    bool playing();
     35    bool update();
    2736
    28         void open(string path);
    29         void release();
    30         void display();
    31         bool playback();
    32         bool playing();
    33         bool update();
     37  protected:
    3438
    35     protected:
     39    bool stream(ALuint buffer);
     40    void empty();
     41    void check();
     42    const char* errorString(int code);
    3643
    37         bool stream(ALuint buffer);
    38         void empty();
    39         void check();
    40         const char* errorString(int code);
     44  private:
    4145
    42     private:
     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
    4350
    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 };
     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  };
    5355
    5456
Note: See TracChangeset for help on using the changeset viewer.