Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2899


Ignore:
Timestamp:
Apr 6, 2009, 3:08:09 PM (15 years ago)
Author:
erwin
Message:

implemented SoundManager class

Location:
code/branches/sound/src/sound
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/sound/src/sound/SoundBase.h

    r2866 r2899  
    2828
    2929#include <al.h>
     30#include <string>
    3031
    3132class Ogre::SceneNode;
     
    3435namespace orxonox
    3536{
    36 
     37    /**
     38     * The SoudBase class is the base class for all sound file loader classes.
     39     * It server as main interface to the OpenAL library.
     40     *
     41     */
    3742    class SoundBase
    3843    {
     
    4954        bool isPlaying();
    5055
     56        virtual void loadFile(std::string filename) = 0;
     57
    5158    private:
    5259        ALuint source_;
  • code/branches/sound/src/sound/SoundManager.h

    r2866 r2899  
    2929#include <alc.h>
    3030
     31#include <Tickable.h>
     32
    3133class SoundBase;
    3234
    3335namespace Orxonox
    3436{
     37    /**
     38     * The SoundManager class manages the OpenAL device, context and listener
     39     * position. It has a list of all SoundBase objects and calls their update
     40     * function every tick. It is a singleton.
     41     *
     42     */
    3543    class SoundManager : public Tickable
    3644    {
    3745    public:
    38         SoundManager();
     46        static SoundManager* instance();
    3947       
    4048        void addSound(SoundBase* sound);
    4149        void removeSound(SoundBase* sound);
    42 
     50       
    4351        void tick(float dt);
    4452
    4553    private:
     54        SoundManager(); // private constructor -> singleton
     55        static SoundManager* singleton_;
     56
    4657        ALCcontext* context_;
    4758        ALCdevice* device_;
Note: See TracChangeset for help on using the changeset viewer.