/*! * @file sound_buffer_data.h * @brief Definition of the sound-buffer-datacontainer-class */ #ifndef _SOUND_BUFFER_DATA_H #define _SOUND_BUFFER_DATA_H #include "base_object.h" #include "alincl.h" #include "util/count_pointer.h" // FORWARD DECLARATION typedef struct SDL_AudioSpec; namespace OrxSound { //! A class that represents a datastructure to play Sounds. class SoundBufferData : public BaseObject { ObjectListDeclaration(SoundBufferData); public: typedef CountPointer Pointer; public: SoundBufferData(); virtual ~SoundBufferData(); bool load(const std::string& fileName); bool loadWAV(const std::string& fileName); bool loadOGG(const std::string& fileName); /** @returns the ID of the buffer used in this SoundBuffer */ inline ALuint getID() const { return this->bufferID; } inline bool loaded() const { return bLoaded; }; private: ALenum sdlAudioSpecToAlFormat(const SDL_AudioSpec* audiospec); private: ALuint bufferID; //!< The address of the Buffer. ALsizei size; //!< The size of the Buffer. ALboolean loop; //!< loop information. bool bLoaded; //!< If the Sound was loaded this is true. }; } #endif /* _SOUND_BUFFER_DATA_H */