Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5386 in orxonox.OLD for trunk/src/lib/sound/sound_engine.h


Ignore:
Timestamp:
Oct 15, 2005, 11:44:14 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: split open the soundengine into
sound_engine: the Handler
sound_source: the sources
sound_buffers: playback-buffers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/sound/sound_engine.h

    r5216 r5386  
    1010#include "alincl.h"
    1111
     12#include "sound_buffer.h"
     13#include "sound_source.h"
     14
    1215#define SOUND_DOPPLER_FACTOR       0.001          //!< A factor for the audible doppler effect
    1316#define SOUND_DOPPLER_VELOCITY     5000000        //!< A factor for the TravelSpeed of sound
     
    1720template<class T> class tList;
    1821class IniParser;
    19 
    20 
    21 //! A class that represents a datastructure to play Sounds.
    22 class SoundBuffer : public BaseObject
    23 {
    24   public:
    25     SoundBuffer(const char* fileName);
    26     ~SoundBuffer();
    27 
    28     /** @returns the ID of the buffer used in this SoundBuffer */
    29     inline ALuint getID() const { return this->bufferID; }
    30 
    31   private:
    32     ALuint        bufferID;             //!< The address of the Buffer.
    33 
    34     ALsizei       size;                 //!< The size of the Buffer.
    35     ALboolean     loop;                 //!< loop information.
    36 };
    37 
    38 //! A class that represents a SoundSource
    39 class SoundSource : public BaseObject
    40 {
    41   public:
    42     SoundSource(const PNode* sourceNode = NULL, const SoundBuffer* buffer = NULL);
    43     ~SoundSource();
    44 
    45   // user interaction
    46     void play();
    47     void play(const SoundBuffer* buffer);
    48     void stop();
    49     void pause();
    50     void rewind();
    51 
    52   // 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;}
    59 
    60     void setRolloffFactor(ALfloat rolloffFactor);
    61 
    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.
    66 };
    67 
    68 
    6922
    7023//! A class that handles audio via the openAudioLibrary
Note: See TracChangeset for help on using the changeset viewer.