19#ifndef HEADER_SFX_BUFFER_HPP
20#define HEADER_SFX_BUFFER_HPP
26typedef unsigned int ALuint;
29#include "utils/no_copy.hpp"
30#include "utils/vec3.hpp"
31#include "utils/leak_check.hpp"
The base class for sound effects.
Definition: sfx_base.hpp:43
The buffer (data) for one kind of sound effects.
Definition: sfx_buffer.hpp:44
bool m_positional
If the sound is positional.
Definition: sfx_buffer.hpp:59
bool isPositional() const
Returns if the buffer is positional.
Definition: sfx_buffer.hpp:101
bool load()
load the buffer from file into OpenAL.
Definition: sfx_buffer.cpp:89
ALuint m_buffer
The openal buffer id.
Definition: sfx_buffer.hpp:56
float m_rolloff
The roll-off value.
Definition: sfx_buffer.hpp:62
float m_duration
Duration of the sfx.
Definition: sfx_buffer.hpp:71
bool isLoaded() const
Definition: sfx_buffer.hpp:95
float getDuration() const
Returns how long this buffer will play.
Definition: sfx_buffer.hpp:119
float m_max_dist
Maximum distance the sfx can be heard.
Definition: sfx_buffer.hpp:68
const std::string & getFileName() const
Returns the file name of this buffer.
Definition: sfx_buffer.hpp:113
float getMaxDist() const
Returns the maximum distance this sfx can be heard.
Definition: sfx_buffer.hpp:110
float getGain() const
Returns the gain for this sfx.
Definition: sfx_buffer.hpp:107
ALuint getBufferID() const
Only returns a valid buffer if isLoaded() returned true.
Definition: sfx_buffer.hpp:98
float getRolloff() const
Returns the rolloff value of this buffer.
Definition: sfx_buffer.hpp:104
bool m_loaded
Whether the contents of the file was loaded.
Definition: sfx_buffer.hpp:50
void unload()
Frees the loaded buffer.
Definition: sfx_buffer.cpp:128
bool loadVorbisBuffer(const std::string &name, ALuint buffer)
Load a vorbis file into an OpenAL buffer based on a routine by Peter Mulholland, used with permission...
Definition: sfx_buffer.cpp:148
float m_gain
The volume gain value.
Definition: sfx_buffer.hpp:65
std::string m_file
The file that contains the OGG audio data.
Definition: sfx_buffer.hpp:53
void setPositional(bool positional)
Sets if this buffer is positional or not.
Definition: sfx_buffer.hpp:116
utility class used to parse XML files
Definition: xml_node.hpp:48