13 #ifndef OALPLUS_SOURCE_1303201647_HPP
14 #define OALPLUS_SOURCE_1303201647_HPP
19 #include <oalplus/math/angle.hpp>
20 #include <oalplus/math/vector.hpp>
21 #include <oalplus/error/basic.hpp>
22 #include <oalplus/object/wrapper.hpp>
23 #include <oalplus/object/sequence.hpp>
44 static void Gen(tag::Generate, ALsizei count, ALuint* names)
46 assert(names !=
nullptr);
47 OALPLUS_ALFUNC(GenSources)(count, names);
48 OALPLUS_CHECK_SIMPLE(GenSources);
51 static void Delete(ALsizei count, ALuint* names)
53 assert(names !=
nullptr);
54 OALPLUS_ALFUNC(DeleteSources)(count, names);
55 OALPLUS_VERIFY_SIMPLE(DeleteSources);
58 static ALboolean IsA(ALuint name)
61 ALboolean result = OALPLUS_ALFUNC(IsSource)(name);
62 OALPLUS_VERIFY_SIMPLE(IsSource);
75 :
public ObjectName<tag::Source>
87 OALPLUS_ALFUNC(SourcePlay)(_name);
102 OALPLUS_ALFUNC(SourcePause)(_name);
117 OALPLUS_ALFUNC(SourceStop)(_name);
132 OALPLUS_ALFUNC(SourceRewind)(_name);
149 OALPLUS_ALFUNC(GetSourceiv)(
159 return SourceState(result);
170 OALPLUS_ALFUNC(Sourcei)(
173 value?AL_TRUE:AL_FALSE
191 OALPLUS_ALFUNC(GetSourceiv)(
201 return result == AL_TRUE;
212 OALPLUS_ALFUNC(Sourcei)(
233 OALPLUS_ALFUNC(GetSourceiv)(
243 return SourceType(ALenum(result));
254 OALPLUS_ALFUNC(Sourcei)(
257 value?AL_TRUE:AL_FALSE
275 OALPLUS_ALFUNC(GetSourceiv)(
285 return result == AL_TRUE;
296 OALPLUS_ALFUNC(Sourcei)(
316 OALPLUS_ALFUNC(Sourcei)(
335 OALPLUS_ALFUNC(SourceQueueBuffers)(
338 const_cast<ALuint*
>(GetALNames(buffers))
354 OALPLUS_ALFUNC(SourceUnqueueBuffers)(
357 const_cast<ALuint*
>(GetALNames(buffers))
360 SourceUnqueueBuffers,
374 OALPLUS_ALFUNC(Sourcef)(
395 OALPLUS_ALFUNC(GetSourcefv)(
416 OALPLUS_ALFUNC(Sourcef)(
437 OALPLUS_ALFUNC(GetSourcefv)(
458 OALPLUS_ALFUNC(Sourcef)(
479 OALPLUS_ALFUNC(GetSourcefv)(
500 OALPLUS_ALFUNC(Sourcef)(
502 AL_REFERENCE_DISTANCE,
521 OALPLUS_ALFUNC(GetSourcefv)(
523 AL_REFERENCE_DISTANCE,
542 OALPLUS_ALFUNC(Sourcef)(
563 OALPLUS_ALFUNC(GetSourcefv)(
584 OALPLUS_ALFUNC(Sourcef)(
605 OALPLUS_ALFUNC(GetSourcefv)(
626 OALPLUS_ALFUNC(Sourcef)(
647 OALPLUS_ALFUNC(GetSourcefv)(
668 OALPLUS_ALFUNC(Sourcefv)(
688 OALPLUS_ALFUNC(Source3f)(
709 OALPLUS_ALFUNC(GetSourcefv)(
719 return Vec3f(result);
730 OALPLUS_ALFUNC(Sourcefv)(
750 OALPLUS_ALFUNC(Source3f)(
771 OALPLUS_ALFUNC(GetSourcefv)(
781 return Vec3f(result);
792 OALPLUS_ALFUNC(Sourcefv)(
812 OALPLUS_ALFUNC(Source3f)(
833 OALPLUS_ALFUNC(GetSourcefv)(
843 return Vec3f(result);
854 OALPLUS_ALFUNC(Sourcef)(
857 angle.ValueInDegrees()
875 OALPLUS_ALFUNC(GetSourcefv)(
896 OALPLUS_ALFUNC(Sourcef)(
899 angle.ValueInDegrees()
917 OALPLUS_ALFUNC(GetSourcefv)(
938 OALPLUS_ALFUNC(Sourcef)(
959 OALPLUS_ALFUNC(GetSourcefv)(
980 OALPLUS_ALFUNC(Sourcef)(
1000 OALPLUS_ALFUNC(Sourcef)(
1020 OALPLUS_ALFUNC(Sourcef)(
1039 :
public oalplus::ObjGenDelOps<oalplus::tag::Source>
1042 template <
typename OpsTag>
1044 :
public oalplus::ObjectOps<OpsTag, oalplus::tag::Source>
1061 #endif // include guard
void Play(void)
Starts the audio playback.
Definition: source.hpp:85
void QueueBuffers(const Sequence< BufferName > &buffers)
Enqueues multiple buffers to the source.
Definition: source.hpp:333
void DetachBuffers(void)
Detaches all queued buffers from the source.
Definition: source.hpp:314
void Direction(const Vec3f &dir)
Sets the direction of the source.
Definition: source.hpp:790
void UnqueueBuffers(const Sequence< BufferName > &buffers)
Removes multiple buffers from the sources queue.
Definition: source.hpp:352
Vector< GLfloat, 3 > Vec3f
SourceType Type(void) const
Returns the source type.
Definition: source.hpp:230
void SecOffset(ALfloat value)
Sets the Sec-offset value.
Definition: source.hpp:978
void ConeOuterAngle(Anglef angle)
Sets the sound cone's outer angle.
Definition: source.hpp:894
void Position(ALfloat x, ALfloat y, ALfloat z)
Sets the position of the source.
Definition: source.hpp:686
Vec3f Direction(void) const
Returns the direction of the source.
Definition: source.hpp:830
void Velocity(ALfloat x, ALfloat y, ALfloat z)
Sets the velocity of the source.
Definition: source.hpp:748
Compile-time configuration options.
void ConeOuterGain(ALfloat value)
Sets the sound cone's outer gain value.
Definition: source.hpp:936
Helper macro expanding into OpenAL function name.
void Gain(ALfloat value)
Sets the value of gain.
Definition: source.hpp:372
void MinGain(ALfloat value)
Sets the minimal value of gain.
Definition: source.hpp:414
void ReferenceDistance(ALfloat value)
Sets the reference distance.
Definition: source.hpp:498
void MaxGain(ALfloat value)
Sets the maximum value of gain.
Definition: source.hpp:456
Vec3f Position(void) const
Returns the position of the source.
Definition: source.hpp:706
void MaxDistance(ALfloat value)
Sets the value of max distance used with some distance models.
Definition: source.hpp:582
void Rewind(void)
Rewinds the audio track.
Definition: source.hpp:130
void ConeInnerAngle(Anglef angle)
Sets the sound cone's inner angle.
Definition: source.hpp:852
ALfloat Pitch(void) const
Returns the value of pitch.
Definition: source.hpp:644
void ByteOffset(ALfloat value)
Sets the byte-offset value.
Definition: source.hpp:1018
void Looping(bool value)
Sets the looping mode.
Definition: source.hpp:252
ALfloat MaxGain(void) const
Returns the maximum value of gain.
Definition: source.hpp:476
ALfloat RolloffFactor(void) const
Returns the value of rolloff factor.
Definition: source.hpp:560
ALfloat Gain(void) const
Returns the value of gain.
Definition: source.hpp:392
void Velocity(const Vec3f &dir)
Sets the velocity of the source.
Definition: source.hpp:728
ALfloat ReferenceDistance(void) const
Returns the reference distance.
Definition: source.hpp:518
void Position(const Vec3f &dir)
Sets the position of the source.
Definition: source.hpp:666
Object< SourceOps > Source
An oalplus_object encapsulating the OpenAL source functionality.
Definition: source.hpp:1057
ALfloat MinGain(void) const
Returns the minimal value of gain.
Definition: source.hpp:434
void Type(SourceType type)
Sets the source type.
Definition: source.hpp:210
SourceState State(void) const
Returns the source state.
Definition: source.hpp:146
void Stop(void)
Stops the audio playback.
Definition: source.hpp:115
Anglef ConeOuterAngle(void) const
Returns the sound cone's outer angle.
Definition: source.hpp:914
void SampleOffset(ALfloat value)
Sets the sample-offset value.
Definition: source.hpp:998
Wrapper for OpenAL buffer object.
void Pitch(ALfloat value)
Sets the value of pitch.
Definition: source.hpp:624
bool Relative(void) const
Returns true if the source is relative.
Definition: source.hpp:188
OpenAL Source type enumeration.
ALfloat MaxDistance(void) const
Returns the value of max distance used with some distance models.
Definition: source.hpp:602
void Pause(void)
Pauses the audio playback.
Definition: source.hpp:100
void Relative(bool value)
Sets the source to relative or absoulte state.
Definition: source.hpp:168
ALfloat ConeOuterGain(void) const
Returns the sound cone's outer gain value.
Definition: source.hpp:956
void Direction(ALfloat x, ALfloat y, ALfloat z)
Sets the direction of the source.
Definition: source.hpp:810
void Buffer(const BufferName &buffer)
Assigns an audio buffer to the source.
Definition: source.hpp:294
Anglef ConeInnerAngle(void) const
Returns the sound cone's inner angle.
Definition: source.hpp:872
OpenAL source execution state enumeration.
void RolloffFactor(ALfloat value)
Sets the value of rolloff factor.
Definition: source.hpp:540
Angle< AngleValueType > Degrees(AngleValueType val_deg)
bool Looping(void) const
Returns true if the source is in looping mode.
Definition: source.hpp:272
Vec3f Velocity(void) const
Returns the velocity of the source.
Definition: source.hpp:768