Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

orxonox/new_class_id: SoundSource completely added as a Resource

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