Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 22, 2009, 4:01:16 PM (14 years ago)
Author:
rgrieder
Message:

Merged sound3 branch to presentation2.

Location:
code/branches/presentation2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2

  • code/branches/presentation2/src/orxonox/sound/BaseSound.h

    r5929 r6117  
    2626 *
    2727 */
     28
    2829#ifndef _BaseSound_H__
    2930#define _BaseSound_H__
     
    3233
    3334#include <string>
    34 #include <OgreSharedPtr.h>
    3535#include <OgreDataStream.h>
    3636#include "core/OrxonoxClass.h"
     
    4949        virtual ~BaseSound();
    5050
    51         void play();
    52         void stop();
    53         void pause();
     51        void XMLPortExtern(Element& xmlelement, XMLPort::Mode mode);
    5452
    55         bool isPlaying();
    56         bool isPaused();
    57         bool isStopped();
     53        virtual void play();
     54        virtual void stop();
     55        virtual void pause();
    5856
    59         void setSource(const std::string& source);
    60         const std::string& getSource() { return this->source_; }
     57        bool isPlaying() { return this->state_ == Playing; }
     58        bool isPaused()  { return this->state_ == Paused; }
     59        bool isStopped() { return this->state_ == Stopped; }
    6160
    62         bool getPlayOnLoad() { return this->bPlayOnLoad_; }
    63         void setPlayOnLoad(bool val);
     61        virtual void setSource(const std::string& source);
     62        virtual const std::string& getSource() const { return this->source_; }
    6463
    65         bool getLoop() { return this->bLoop_; }
    66         void setLoop(bool val) { this->bLoop_ = val; }
     64        void setVolume(float vol);
     65        float getVolume() const { return this->volume_; }
     66
     67        bool getLooping() const   { return this->bLoop_; }
     68        void setLooping(bool val);
     69
     70        //ALuint getALAudioSource(void);
    6771
    6872    protected:
    6973        ALuint loadOggFile();
    70         ALint getSourceState();
    7174
    7275        ALuint audioSource_;
     
    7477
    7578    private:
    76         std::string source_;
    77         bool bPlayOnLoad_;
    78         bool bLoop_;
    79         DataStreamPtr dataStream_;
     79        enum State
     80        {
     81            Stopped,
     82            Playing,
     83            Paused
     84        };
     85
     86        std::string     source_;
     87        float           volume_;
     88        bool            bLoop_;
     89        State           state_;
     90        DataStreamPtr   dataStream_;
    8091    };
    8192}
Note: See TracChangeset for help on using the changeset viewer.