Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

LoadResource should work… testing soon

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 "base_object.h"
10#include "alincl.h"
11
12#include "sound_buffer_data.h"
13
14namespace OrxSound
15{
16  //! A class that represents a datastructure to play Sounds.
17  class SoundBuffer : public BaseObject
18  {
19    ObjectListDeclaration(SoundBuffer);
20  public:
21    SoundBuffer();
22    SoundBuffer(const SoundBuffer& buffer) { this->data = buffer.data; }
23    SoundBuffer(const SoundBufferData::Pointer& dataPointer) { this->data = dataPointer; };
24    SoundBuffer(const std::string& fileName);
25
26    /** @see SoundBufferData::load */
27    inline bool load(const std::string& fileName) { return this->data->load(fileName); };
28    /** @see SoundBufferData::loadWav */
29    inline bool loadWAV(const std::string& fileName) { return this->data->loadWAV(fileName); };
30    /** @see SoundBufferData::loadOgg */
31    inline bool loadOGG(const std::string& fileName) { return this->data->loadOGG(fileName); };
32
33    /** @returns the ID of the buffer used in this SoundBuffer */
34    inline ALuint getID() const { return this->data->getID(); }
35
36    /** @returns the DataPointer */
37    const SoundBufferData::Pointer& dataPointer() const { return data; }
38    /** @param dataPointer the data to acquire @brief Buffer shall acquire dataPointers data */
39    void acquireData(const SoundBufferData::Pointer& dataPointer)  { data = dataPointer; };
40  private:
41    SoundBufferData::Pointer    data;
42  };
43}
44#endif /* _SOUND_BUFFER_H */
Note: See TracBrowser for help on using the repository browser.