Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2005, 4:16:51 PM (19 years ago)
Author:
patrick
Message:

network: merged the trunk into the network with the command svn merge -r5824:HEAD ../trunk network, changes changed… bla bla..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/sound/sound_engine.h

    r5819 r5968  
    1414
    1515#include <list>
     16#include <stack>
    1617
    1718#define SOUND_DOPPLER_FACTOR       0.001          //!< A factor for the audible doppler effect
     
    2223class IniParser;
    2324
     25
    2426//! A class that handles audio via the openAudioLibrary
    2527class SoundEngine : public BaseObject {
    26 
    2728  public:
    2829    virtual ~SoundEngine();
     
    4748
    4849  // administrative
    49     void addBuffer(SoundBuffer* buffer);
    50     void removeBuffer(SoundBuffer* buffer);
    51     void addSource(SoundSource* source);
     50    void popALSource(ALuint& source);
     51    void pushALSource(ALuint& source) { if (source != 0) this->ALSources.push(source); };
    5252
    5353    void flushUnusedBuffers();
    5454    void flushAllBuffers();
    5555    void flushAllSources();
     56
    5657    bool initAudio();
     58    bool allocateSources(unsigned int count);
    5759
    5860  // error handling:
    59     static void PrintALErrorString(ALenum err);
    60   //  static void PrintALCErrorString(ALenum err);
    61 
     61    static const char* getALErrorString(ALenum err);
    6262
    6363  private:
    6464    SoundEngine();
     65
    6566    void listDevices();
    6667
    6768  private:
    68     static SoundEngine*      singletonRef;             //!< Reference to this class
     69    static SoundEngine*            singletonRef;             //!< Reference to this class
    6970
    70     ALCdevice*               device;                   //!< the used audio-device.
    71     ALCcontext*              context;                  //!< the context, currently in use.
     71    ALCdevice*                     device;                   //!< the used audio-device.
     72    ALCcontext*                    context;                  //!< the context, currently in use.
    7273
    73     float                    musicVolume;              //!< the maximum volume of the music in % (0f,1f]
    74     float                    effectsVolume;            //!< the maximum volume of sound-effects in % (0f,1f]
    75     PNode*                   listener;                 //!< The listener of the Scene
     74    float                          musicVolume;              //!< the maximum volume of the music in % (0f,1f]
     75    float                          effectsVolume;            //!< the maximum volume of sound-effects in % (0f,1f]
     76    PNode*                         listener;                 //!< The listener of the Scene
    7677
    77     std::list<BaseObject*>*  bufferList;               //!< A list of buffers
    78     std::list<BaseObject*>*  sourceList;               //!< A list for all the sources in the scene.
     78    const std::list<BaseObject*>*  bufferList;               //!< A list of buffers
     79    const std::list<BaseObject*>*  sourceList;               //!< A list for all the sources in the scene.
    7980
    80 
     81    unsigned int                   maxSourceCount;           //!< How many Sources is the Maximum
     82    std::stack<ALuint>             ALSources;                //!< A list of real openAL-Sources, the engine allocates, and stores for reuse.
    8183};
    8284
Note: See TracChangeset for help on using the changeset viewer.