Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/lib/sound/sound_buffer_data.h @ 9803

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

Ported SoundBuffer to match the Data-Paradigm

File size: 1.2 KB
Line 
1/*!
2 * @file sound_buffer_data.h
3 * @brief Definition of the sound-buffer-datacontainer-class
4*/
5
6#ifndef _SOUND_BUFFER_DATA_H
7#define _SOUND_BUFFER_DATA_H
8
9#include "base_object.h"
10#include "alincl.h"
11#include "util/count_pointer.h"
12
13// FORWARD DECLARATION
14typedef struct SDL_AudioSpec;
15
16namespace OrxSound
17{
18  //! A class that represents a datastructure to play Sounds.
19  class SoundBufferData : public BaseObject
20  {
21    ObjectListDeclaration(SoundBufferData);
22  public:
23    typedef CountPointer<SoundBufferData> Pointer;
24
25  public:
26    SoundBufferData();
27    virtual ~SoundBufferData();
28
29    bool load(const std::string& fileName);
30    bool loadWAV(const std::string& fileName);
31    bool loadOGG(const std::string& fileName);
32
33    /** @returns the ID of the buffer used in this SoundBuffer */
34    inline ALuint getID() const { return this->bufferID; }
35
36  private:
37    ALenum sdlAudioSpecToAlFormat(const SDL_AudioSpec* audiospec);
38
39  private:
40    ALuint        bufferID;             //!< The address of the Buffer.
41
42    ALsizei       size;                 //!< The size of the Buffer.
43    ALboolean     loop;                 //!< loop information.
44  };
45}
46#endif /* _SOUND_BUFFER_DATA_H */
Note: See TracBrowser for help on using the repository browser.