Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4959 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jul 27, 2005, 6:07:47 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: orxonox runs again (the TrackManager produces speed)

Location:
orxonox/trunk/src/lib/sound
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/sound/sound_engine.cc

    r4885 r4959  
    467467}
    468468
     469void SoundEngine::listDevices()
     470{
     471
     472  printf("%s\n",(const char*)alcGetString(NULL, ALC_DEVICE_SPECIFIER));
     473}
     474
    469475/*
    470476void SoundEngine::PrintALCErrorString(ALenum err)
  • orxonox/trunk/src/lib/sound/sound_engine.h

    r4885 r4959  
    11/*!
    2     \file sound_engine.h
    3   * Definition of the SoundEngine singleton Class
    4 */
     2 * @file sound_engine.h
     3 * Definition of the SoundEngine singleton Class
     4 */
    55
    66#ifndef _SOUND_ENGINE_H
     
    2222class SoundBuffer : public BaseObject
    2323{
    24  public:
    25   SoundBuffer(const char* fileName);
    26   ~SoundBuffer();
     24  public:
     25    SoundBuffer(const char* fileName);
     26    ~SoundBuffer();
    2727
    28   /** @returns the ID of the buffer used in this SoundBuffer */
    29   inline ALuint getID() const { return this->bufferID; }
     28    /** @returns the ID of the buffer used in this SoundBuffer */
     29    inline ALuint getID() const { return this->bufferID; }
    3030
    31  private:
    32   ALuint        bufferID;             //!< The address of the Buffer.
     31  private:
     32    ALuint        bufferID;             //!< The address of the Buffer.
    3333
    34   ALsizei       size;                 //!< The size of the Buffer.
    35   ALboolean     loop;                 //!< loop information.
     34    ALsizei       size;                 //!< The size of the Buffer.
     35    ALboolean     loop;                 //!< loop information.
    3636};
    3737
     
    3939class SoundSource : public BaseObject
    4040{
    41  public:
    42   SoundSource(const PNode* sourceNode = NULL, const SoundBuffer* buffer = NULL);
    43   ~SoundSource();
     41  public:
     42    SoundSource(const PNode* sourceNode = NULL, const SoundBuffer* buffer = NULL);
     43    ~SoundSource();
    4444
    4545  // user interaction
    46   void play();
    47   void play(const SoundBuffer* buffer);
    48   void stop();
    49   void pause();
    50   void rewind();
     46    void play();
     47    void play(const SoundBuffer* buffer);
     48    void stop();
     49    void pause();
     50    void rewind();
    5151
    5252  // development functions
    53   /** @returns The ID of this Source */
    54   inline ALuint getID() const { return this->sourceID; }
    55   /** @returns the SoundBuffer of this Source */
    56   inline const SoundBuffer* getBuffer() const { return this->buffer; }
    57   /** @returns the SourceNode of this Source */
    58   inline const PNode* getNode() const { return this->sourceNode;}
     53    /** @returns The ID of this Source */
     54    inline ALuint getID() const { return this->sourceID; }
     55    /** @returns the SoundBuffer of this Source */
     56    inline const SoundBuffer* getBuffer() const { return this->buffer; }
     57    /** @returns the SourceNode of this Source */
     58    inline const PNode* getNode() const { return this->sourceNode;}
    5959
    60   void setRolloffFactor(ALfloat rolloffFactor);
     60    void setRolloffFactor(ALfloat rolloffFactor);
    6161
    62  private:
    63   ALuint                 sourceID;              //!< The ID of the Source
    64   const SoundBuffer*     buffer;                //!< The buffer to play in this source.
    65   const PNode*           sourceNode;            //!< The SourceNode represente the position/velocity... of this source.
     62  private:
     63    ALuint                 sourceID;              //!< The ID of the Source
     64    const SoundBuffer*     buffer;                //!< The buffer to play in this source.
     65    const PNode*           sourceNode;            //!< The SourceNode represente the position/velocity... of this source.
    6666};
    6767
     
    7171class SoundEngine : public BaseObject {
    7272
    73  public:
    74   virtual ~SoundEngine();
    75   /** @returns a Pointer to the only object of this Class */
    76   inline static SoundEngine* getInstance() { if (!singletonRef) singletonRef = new SoundEngine();  return singletonRef; };
     73  public:
     74    virtual ~SoundEngine();
     75    /** @returns a Pointer to the only object of this Class */
     76    inline static SoundEngine* getInstance() { if (!singletonRef) singletonRef = new SoundEngine();  return singletonRef; };
    7777
    78   SoundSource* createSource(const char* fileName, PNode* sourceNode = NULL);
     78    SoundSource* createSource(const char* fileName, PNode* sourceNode = NULL);
    7979
    80   void setListener(PNode* listener);
    81   void setDopplerValues(ALfloat dopplerFactor, ALfloat dopplerVelocity);
     80    void setListener(PNode* listener);
     81    void setDopplerValues(ALfloat dopplerFactor, ALfloat dopplerVelocity);
    8282
    8383
    84   void addBuffer(SoundBuffer* buffer);
    85   void removeBuffer(SoundBuffer* buffer);
    86   void addSource(SoundSource* source);
    87   void removeSource(SoundSource* source);
     84    void addBuffer(SoundBuffer* buffer);
     85    void removeBuffer(SoundBuffer* buffer);
     86    void addSource(SoundSource* source);
     87    void removeSource(SoundSource* source);
    8888
    89   void update();
     89    void update();
    9090
    9191  // administrative
    92   void flushUnusedBuffers();
    93   void flushAllBuffers();
    94   void flushAllSources();
    95   bool initAudio();
     92    void flushUnusedBuffers();
     93    void flushAllBuffers();
     94    void flushAllSources();
     95    bool initAudio();
    9696
    9797  // error handling:
    98   static void PrintALErrorString(ALenum err);
     98    static void PrintALErrorString(ALenum err);
    9999  //  static void PrintALCErrorString(ALenum err);
    100100
    101101
    102  private:
    103   SoundEngine();
    104   static SoundEngine*      singletonRef;             //!< Reference to this class
     102  private:
     103    SoundEngine();
     104    void listDevices();
     105
     106  private:
     107    static SoundEngine*      singletonRef;             //!< Reference to this class
    105108
    106109
    107   PNode*                   listener;                 //!< The listener of the Scene
    108   tList<SoundBuffer>*      bufferList;               //!< A list of buffers
    109   tList<SoundSource>*      sourceList;               //!< A list for all the sources in the scene.
     110    PNode*                   listener;                 //!< The listener of the Scene
     111    tList<SoundBuffer>*      bufferList;               //!< A list of buffers
     112    tList<SoundSource>*      sourceList;               //!< A list for all the sources in the scene.
    110113
    111114};
Note: See TracChangeset for help on using the changeset viewer.