Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
May 1, 2006, 12:30:34 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: Namespaces for sound

File:
1 edited

Legend:

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

    r7355 r7460  
    2222// FORWARD DECLARATION
    2323class PNode;
    24 class IniParser;
    25 
    26 
    27 //! A class that handles audio via the openAudioLibrary
    28 class SoundEngine : public BaseObject {
     24namespace OrxSound
     25{
     26  //! A class that handles audio via the openAudioLibrary
     27  class SoundEngine : public BaseObject
     28  {
    2929  public:
    3030    virtual ~SoundEngine();
     
    3232    inline static SoundEngine* getInstance() { if (!SoundEngine::singletonRef) SoundEngine::singletonRef = new SoundEngine();  return SoundEngine::singletonRef; };
    3333
     34    SoundSource* createSource(const std::string& fileName, PNode* sourceNode = NULL);
    3435    void loadSettings();
    35 
    36     SoundSource* createSource(const std::string& fileName, PNode* sourceNode = NULL);
     36    bool initAudio();
    3737
    3838    /** @param listener the listener in the scene */
    39     void setListener(PNode* listener) { this->listener = listener; };
     39  void setListener(const PNode* listener) { this->listener = listener; };
    4040    void setDopplerValues(ALfloat dopplerFactor, ALfloat dopplerVelocity);
     41
    4142
    4243
     
    4849    void update();
    4950
    50   // administrative
     51    // administrative
    5152    void popALSource(ALuint& source);
    5253    void pushALSource(ALuint& source);
    5354
    54 
    55     bool initAudio();
    56     bool allocateSources(unsigned int count);
    57 
    58   // error handling:
     55    // error handling:
    5956    static bool checkError(const std::string& error, unsigned int line);
    6057    bool checkALCError(const std::string& error, unsigned int line);
     
    6461  private:
    6562    SoundEngine();
     63    bool allocateSources(unsigned int count);
    6664
    6765    void listDevices();
     
    7573    float                          musicVolume;              //!< the maximum volume of the music in % (0f,1f]
    7674    float                          effectsVolume;            //!< the maximum volume of sound-effects in % (0f,1f]
    77     PNode*                         listener;                 //!< The listener of the Scene
     75    const PNode*                   listener;                 //!< The listener of the Scene
    7876
    7977    const std::list<BaseObject*>*  bufferList;               //!< A list of buffers
     
    8482
    8583    SDL_mutex*                     sourceMutex;              //!< A mutex so we can not harm the stack
    86 };
     84  };
     85}
    8786
    8887#endif /* _SOUND_ENGINE_H */
Note: See TracChangeset for help on using the changeset viewer.