Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 24, 2006, 3:21:12 PM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: SoundSource completely added as a Resource

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/sound/sound_source.h

    r9715 r9805  
    88
    99#include "base_object.h"
     10#include "sound_buffer.h"
    1011#include "alincl.h"
    1112
     
    1415namespace OrxSound
    1516{
    16   class SoundBuffer;
    1717  //! A class that represents a SoundSource
    1818  class SoundSource : public BaseObject
     
    2020    ObjectListDeclaration(SoundSource);
    2121  public:
    22     SoundSource(const PNode* sourceNode = NULL, const SoundBuffer* buffer = NULL);
     22    SoundSource(const PNode* sourceNode = NULL, const SoundBuffer& buffer = SoundBuffer());
    2323    SoundSource(const SoundSource& source);
    2424    SoundSource& operator=(const SoundSource& source);
     
    2929    // user interaction
    3030    void play();
    31     void play(const SoundBuffer* buffer);
    32     void play(const SoundBuffer* buffer, float gain);
    33     void play(const SoundBuffer* buffer, float gain, bool loop);
     31    void play(const SoundBuffer& buffer);
     32    void play(const SoundBuffer& buffer, float gain);
     33    void play(const SoundBuffer& buffer, float gain, bool loop);
    3434
    35     void gain(const SoundBuffer* buffer, float gain);
     35    void gain(const SoundBuffer& buffer, float gain);
    3636
    3737    void stop();
    3838    void pause();
    3939    void rewind();
    40     void fadein(const SoundBuffer* buffer, ALfloat duration);
     40    void fadein(const SoundBuffer& buffer, ALfloat duration);
    4141
    4242    // development functions
     
    4747    void setSourceNode(const PNode* sourceNode);
    4848    /** @returns the SoundBuffer of this Source */
    49     inline const SoundBuffer* getBuffer() const { return this->buffer; };
     49    inline const SoundBuffer& getBuffer() const { return this->buffer; };
    5050    /** @returns the SourceNode of this Source */
    5151    inline const PNode* getNode() const { return this->sourceNode; };
     
    6666    bool                   resident;    //!< If the alSource should be resident (if true, the alSource will be returned on deletion).
    6767    ALuint                 sourceID;    //!< The ID of the Source
    68     const SoundBuffer*     buffer;      //!< The buffer to play in this source.
     68    SoundBuffer            buffer;      //!< The buffer to play in this source.
    6969    const PNode*           sourceNode;  //!< The SourceNode representing the position/velocity... of this source.
    7070  };
Note: See TracChangeset for help on using the changeset viewer.