Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8255 in orxonox.OLD for trunk/src/lib/sound/sound_source.h


Ignore:
Timestamp:
Jun 8, 2006, 3:44:12 PM (18 years ago)
Author:
bensch
Message:

merged the atmos back with command: https://svn.orxonox.net/orxonox/branches/atmospheric_engine

File:
1 edited

Legend:

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

    r7810 r8255  
    11/*!
    2  * @file sound_source.h
    3  * @brief Definition of the SoundSource.
     2* @file sound_source.h
     3* @brief Definition of the SoundSource.
    44*/
    55
     
    1414namespace OrxSound
    1515{
    16   class SoundBuffer;
    17   //! A class that represents a SoundSource
    18   class SoundSource : public BaseObject
    19   {
    20   public:
    21     SoundSource(const PNode* sourceNode = NULL, const SoundBuffer* buffer = NULL);
    22     SoundSource(const SoundSource& source);
    23     SoundSource& operator=(const SoundSource& source);
    24     bool operator==(const SoundSource& source);
    25 
    26     virtual ~SoundSource();
    27 
    28     // user interaction
    29     void play();
    30     void play(const SoundBuffer* buffer);
    31     void loop();
    32     void loop(const SoundBuffer* buffer);
    33     void stop();
    34     void pause();
    35     void rewind();
    36 
    37     // development functions
    38     /** @returns The ID of this Source */
    39     inline ALuint getID() const { return this->sourceID; };
    40     /** @returns true, if the Source is Playing */
    41     inline bool   isPlaying() const { return this->bPlay; };
    42     void setSourceNode(const PNode* sourceNode);
    43     /** @returns the SoundBuffer of this Source */
    44     inline const SoundBuffer* getBuffer() const { return this->buffer; };
    45     /** @returns the SourceNode of this Source */
    46     inline const PNode* getNode() const { return this->sourceNode; };
    47     /** @param resident if the Source is Resident */
    48     inline void setResident(bool resident) { this->resident = resident; };
    49     /** @returns true if the alSource is Resident */
    50     inline bool isResident() const { return this->resident; };
    51 
    52     void setRolloffFactor(ALfloat rolloffFactor);
    53 
    54     static void resetSource(ALuint sourceID);
    55 
    56   private:
    57     bool retrieveSource();
    58 
    59   private:
    60     bool                   bPlay;                 //!< If the Source is Playing.
    61     bool                   resident;              //!< If the alSource should be resident (if true, the alSource will be returned on deletion).
    62     ALuint                 sourceID;              //!< The ID of the Source
    63     const SoundBuffer*     buffer;                //!< The buffer to play in this source.
    64     const PNode*           sourceNode;            //!< The SourceNode representing the position/velocity... of this source.
    65   };
     16        class SoundBuffer;
     17        //! A class that represents a SoundSource
     18        class SoundSource : public BaseObject
     19        {
     20                public:
     21                        SoundSource(const PNode* sourceNode = NULL, const SoundBuffer* buffer = NULL);
     22                        SoundSource(const SoundSource& source);
     23                        SoundSource& operator=(const SoundSource& source);
     24                        bool operator==(const SoundSource& source);
     25                       
     26                        virtual ~SoundSource();
     27                       
     28                        // user interaction
     29                        void play();
     30                        void play(const SoundBuffer* buffer);
     31                        void play(const SoundBuffer* buffer, float gain);
     32                        void loop();
     33                        void loop(const SoundBuffer* buffer);
     34                        void loop(const SoundBuffer* buffer, float gain);
     35                        void stop();
     36                        void pause();
     37                        void rewind();
     38                        void fadein(const SoundBuffer* buffer, ALfloat duration);
     39                       
     40                       
     41                        // development functions
     42                        /** @returns The ID of this Source */
     43                        inline ALuint getID() const { return this->sourceID; };
     44                        /** @returns true, if the Source is Playing */
     45                        inline bool   isPlaying() const { return this->bPlay; };
     46                        void setSourceNode(const PNode* sourceNode);
     47                        /** @returns the SoundBuffer of this Source */
     48                        inline const SoundBuffer* getBuffer() const { return this->buffer; };
     49                        /** @returns the SourceNode of this Source */
     50                        inline const PNode* getNode() const { return this->sourceNode; };
     51                        /** @param resident if the Source is Resident */
     52                        inline void setResident(bool resident) { this->resident = resident; };
     53                        /** @returns true if the alSource is Resident */
     54                        inline bool isResident() const { return this->resident; };
     55                       
     56                        void setRolloffFactor(ALfloat rolloffFactor);
     57                       
     58                        static void resetSource(ALuint sourceID);
     59               
     60                private:
     61                        bool retrieveSource();
     62                       
     63                private:
     64                        bool                   bPlay;           //!< If the Source is Playing.
     65                        bool                   resident;        //!< If the alSource should be resident (if true, the alSource will be returned on deletion).
     66                        ALuint                 sourceID;        //!< The ID of the Source
     67                        const SoundBuffer*     buffer;          //!< The buffer to play in this source.
     68                        const PNode*           sourceNode;      //!< The SourceNode representing the position/velocity... of this source.
     69        };
    6670}
    6771#endif /* _SOUND_SOURCE_H */
Note: See TracChangeset for help on using the changeset viewer.