Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/scriptchanges/src/lib/sound/sound_buffer_data.h @ 10322

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

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File size: 1.3 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    inline bool loaded() const { return bLoaded; };
36
37  private:
38    ALenum sdlAudioSpecToAlFormat(const SDL_AudioSpec* audiospec);
39
40  private:
41    ALuint        bufferID;             //!< The address of the Buffer.
42
43    ALsizei       size;                 //!< The size of the Buffer.
44    ALboolean     loop;                 //!< loop information.
45    bool          bLoaded;               //!< If the Sound was loaded this is true.
46  };
47}
48#endif /* _SOUND_BUFFER_DATA_H */
Note: See TracBrowser for help on using the repository browser.