7 #ifndef CAFU_SOUNDSYS_BUFFER_HPP_INCLUDED
8 #define CAFU_SOUNDSYS_BUFFER_HPP_INCLUDED
10 #include "OpenALIncl.hpp"
11 #include "Templates/Array.hpp"
29 BufferT(
const std::string& ResName,
bool ForceMono);
35 const std::string&
GetName()
const {
return m_ResName; }
76 unsigned int ConvertToMono(
unsigned char* Buffer,
unsigned int Size);
82 void operator = (
const BufferT&);
84 const std::string m_ResName;
85 const bool m_ForceMono;
virtual ~BufferT()
The virtual destructor, so that derived classes can safely be deleted via a BufferT (base class) poin...
Definition: Buffer.hpp:32
A mixer track represents/encapsulates/abstracs an OpenAL sound source.
Definition: MixerTrack.hpp:22
ArrayT< MixerTrackT * > m_MixerTracks
Mixer tracks this buffer is currently attached to.
Definition: Buffer.hpp:70
virtual void Update()=0
Updates the buffer.
virtual bool CanShare() const =0
Returns whether this buffer can be attached to multiple mixer tracks (resource sharing).
unsigned int ConvertToMono(unsigned char *Buffer, unsigned int Size)
Converts signed 16 bit raw PCM data from stereo to mono.
Definition: Buffer.cpp:18
A BufferT encapsulates an audio resource such as a file or a capture device.
Definition: Buffer.hpp:22
BufferT(const std::string &ResName, bool ForceMono)
The constructor.
Definition: Buffer.cpp:10
const std::string & GetName() const
Returns the name of the resource (file or capture device) that this buffer was created from...
Definition: Buffer.hpp:35
virtual bool DetachFromMixerTrack(MixerTrackT *MixerTrack)=0
Detaches the buffer from a mixer track.
unsigned int References
Number of references to this buffer (e.g. how many sound objects use this buffer).
Definition: Buffer.hpp:65
bool ForcesMono() const
Returns whether the data from the resource is reduced to a single channel before use (mono output)...
Definition: Buffer.hpp:38
virtual bool AttachToMixerTrack(MixerTrackT *MixerTrack)=0
Attaches the buffer to a mixer track, so the mixer track can play this buffer.
virtual unsigned int GetChannels() const =0
Returns the number of audio channels in this buffer (1 is mono, 2 is stereo).