Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

renamed newclassid to classid and newobjectlist to objectlist

File size: 1.0 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// FORWARD DECLARATION
13typedef struct SDL_AudioSpec;
14
15namespace OrxSound
16{
17  //! A class that represents a datastructure to play Sounds.
18  class SoundBuffer : public BaseObject
19  {
20    ObjectListDeclaration(SoundBuffer);
21  public:
22    SoundBuffer(const std::string& fileName);
23    virtual ~SoundBuffer();
24
25    bool loadWAV(const std::string& fileName);
26    bool loadOGG(const std::string& fileName);
27
28    /** @returns the ID of the buffer used in this SoundBuffer */
29    inline ALuint getID() const { return this->bufferID; }
30
31  private:
32    ALenum sdlAudioSpecToAlFormat(const SDL_AudioSpec* audiospec);
33
34  private:
35    ALuint        bufferID;             //!< The address of the Buffer.
36
37    ALsizei       size;                 //!< The size of the Buffer.
38    ALboolean     loop;                 //!< loop information.
39  };
40}
41#endif /* _SOUND_BUFFER_H */
Note: See TracBrowser for help on using the repository browser.