Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/lib/sound/sound_buffer.h @ 9808

Last change on this file since 9808 was 9808, checked in by bensch, 18 years ago

fixed a copy bug… wow… this took 2 hours again

File size: 1.8 KB
RevLine 
[4838]1/*!
[5386]2 * @file sound_buffer.h
3 * @brief Definition of the sound-buffer-class
[3245]4*/
[1853]5
[5386]6#ifndef _SOUND_BUFFER_H
7#define _SOUND_BUFFER_H
[1853]8
[9806]9#include "base_object.h"
[9803]10#include "sound_buffer_data.h"
[3543]11
[7460]12namespace OrxSound
[5386]13{
[7460]14  //! A class that represents a datastructure to play Sounds.
[9806]15  class SoundBuffer : virtual public BaseObject
[7460]16  {
[9806]17    ObjectListDeclaration(SoundBuffer);
[5386]18  public:
[9803]19    SoundBuffer();
[9805]20    SoundBuffer(const SoundBuffer& buffer);
21    SoundBuffer(const SoundBufferData::Pointer& dataPointer);
[7221]22    SoundBuffer(const std::string& fileName);
[9806]23    virtual ~SoundBuffer();
[3543]24
[9808]25    /** @brief assignment operator */
26    SoundBuffer& operator=(const SoundBuffer& buffer) { this->data = buffer.data; return *this; };
[9805]27    bool operator==(const SoundBuffer& buffer) const {return this->data == buffer.data; };
28
[9803]29    /** @see SoundBufferData::load */
30    inline bool load(const std::string& fileName) { return this->data->load(fileName); };
31    /** @see SoundBufferData::loadWav */
32    inline bool loadWAV(const std::string& fileName) { return this->data->loadWAV(fileName); };
33    /** @see SoundBufferData::loadOgg */
34    inline bool loadOGG(const std::string& fileName) { return this->data->loadOGG(fileName); };
[6836]35
[5386]36    /** @returns the ID of the buffer used in this SoundBuffer */
[9803]37    inline ALuint getID() const { return this->data->getID(); }
[9805]38    inline bool loaded() const { return this->data->loaded(); }
[2036]39
[9804]40    /** @returns the DataPointer */
41    const SoundBufferData::Pointer& dataPointer() const { return data; }
42    /** @param dataPointer the data to acquire @brief Buffer shall acquire dataPointers data */
43    void acquireData(const SoundBufferData::Pointer& dataPointer)  { data = dataPointer; };
[9805]44
[5386]45  private:
[9805]46    SoundBufferData::Pointer    data;                //!< Pointer to the Stored Data
[7460]47  };
48}
[5386]49#endif /* _SOUND_BUFFER_H */
Note: See TracBrowser for help on using the repository browser.