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