/*! * @file sound_buffer.h * @brief Definition of the sound-buffer-class */ #ifndef _SOUND_BUFFER_H #define _SOUND_BUFFER_H #include "base_object.h" #include "sound_buffer_data.h" namespace OrxSound { //! A class that represents a datastructure to play Sounds. class SoundBuffer : virtual public BaseObject { ObjectListDeclaration(SoundBuffer); public: SoundBuffer(); SoundBuffer(const SoundBuffer& buffer); SoundBuffer(const SoundBufferData::Pointer& dataPointer); SoundBuffer(const std::string& fileName); virtual ~SoundBuffer(); /** @brief assignment operator */ SoundBuffer& operator=(const SoundBuffer& buffer) { this->data = buffer.data; return *this; }; bool operator==(const SoundBuffer& buffer) const {return this->data == buffer.data; }; /** @see SoundBufferData::load */ inline bool load(const std::string& fileName) { return this->data->load(fileName); }; /** @see SoundBufferData::loadWav */ inline bool loadWAV(const std::string& fileName) { return this->data->loadWAV(fileName); }; /** @see SoundBufferData::loadOgg */ inline bool loadOGG(const std::string& fileName) { return this->data->loadOGG(fileName); }; /** @returns the ID of the buffer used in this SoundBuffer */ inline ALuint getID() const { return this->data->getID(); } inline bool loaded() const { return this->data->loaded(); } /** @returns the DataPointer */ const SoundBufferData::Pointer& dataPointer() const { return data; } /** @param dataPointer the data to acquire @brief Buffer shall acquire dataPointers data */ void acquireData(const SoundBufferData::Pointer& dataPointer) { data = dataPointer; }; private: SoundBufferData::Pointer data; //!< Pointer to the Stored Data }; } #endif /* _SOUND_BUFFER_H */