13 #ifndef OALPLUS_BUFFER_1303201647_HPP
14 #define OALPLUS_BUFFER_1303201647_HPP
20 #include <oalplus/error/object.hpp>
21 #include <oalplus/object/wrapper.hpp>
39 static void Gen(tag::Generate, ALsizei count, ALuint* names)
41 assert(names !=
nullptr);
42 OALPLUS_ALFUNC(GenBuffers)(count, names);
43 OALPLUS_CHECK_SIMPLE(GenBuffers);
46 static void Delete(ALsizei count, ALuint* names)
48 assert(names !=
nullptr);
49 OALPLUS_ALFUNC(DeleteBuffers)(count, names);
50 OALPLUS_VERIFY_SIMPLE(DeleteBuffers);
53 static ALboolean IsA(ALuint name)
56 ALboolean result = OALPLUS_ALFUNC(IsBuffer)(name);
57 OALPLUS_VERIFY_SIMPLE(IsBuffer);
71 :
public ObjectName<tag::Buffer>
88 OALPLUS_ALFUNC(BufferData)(
111 OALPLUS_ALFUNC(GetBufferiv)(
121 return ALsizei(result);
133 OALPLUS_ALFUNC(GetBufferiv)(
143 return ALsizei(result);
155 OALPLUS_ALFUNC(GetBufferiv)(
165 return ALsizei(result);
177 OALPLUS_ALFUNC(GetBufferiv)(
187 return ALsizei(result);
203 ALfloat b = Bits()/8.0f;
204 ALfloat c = Channels();
206 return bps>0.0f?ALfloat(s/bps):ALfloat(0);
215 :
public oalplus::ObjGenDelOps<oalplus::tag::Buffer>
218 template <
typename OpsTag>
220 :
public oalplus::ObjectOps<OpsTag, oalplus::tag::Buffer>
237 #endif // include guard
ALsizei Size(void) const
Returns the size of the data stored in this buffer.
Definition: buffer.hpp:130
ALsizei Frequency(void) const
Returns the sampling frequency of the data stored in this buffer.
Definition: buffer.hpp:108
void Data(DataFormat format, const ALvoid *data, ALsizei size, ALsizei frequency)
Specifies the buffer data.
Definition: buffer.hpp:81
Compile-time configuration options.
ALfloat Duration(void) const
Returns the duration of the sound stored in this buffer.
Definition: buffer.hpp:199
Helper macro expanding into OpenAL function name.
ObjectOps< tag::ExplicitSel, tag::Buffer > BufferOps
Object< BufferOps > Buffer
An oalplus_object encapsulating the OpenAL buffer functionality.
Definition: buffer.hpp:233
ALsizei Bits(void) const
Returns the number of bits of the data stored in this buffer.
Definition: buffer.hpp:152
ALsizei Channels(void) const
Returns the number of channels of the data stored in this buffer.
Definition: buffer.hpp:174