Use a macro to add backend include dirs
[openal-soft.git] / OpenAL32 / Include / alSource.h
blob03034ce812c5f8bba4120554a375434b19cc6608
1 #ifndef _AL_SOURCE_H_
2 #define _AL_SOURCE_H_
4 #include "bool.h"
5 #include "alMain.h"
6 #include "alu.h"
7 #include "hrtf.h"
8 #include "atomic.h"
10 #define MAX_SENDS 16
11 #define DEFAULT_SENDS 2
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
17 struct ALbuffer;
18 struct ALsource;
21 typedef struct ALbufferlistitem {
22 struct ALbuffer *buffer;
23 ATOMIC(struct ALbufferlistitem*) next;
24 } ALbufferlistitem;
27 typedef struct ALsource {
28 /** Source properties. */
29 ALfloat Pitch;
30 ALfloat Gain;
31 ALfloat OuterGain;
32 ALfloat MinGain;
33 ALfloat MaxGain;
34 ALfloat InnerAngle;
35 ALfloat OuterAngle;
36 ALfloat RefDistance;
37 ALfloat MaxDistance;
38 ALfloat RolloffFactor;
39 ALfloat Position[3];
40 ALfloat Velocity[3];
41 ALfloat Direction[3];
42 ALfloat Orientation[2][3];
43 ALboolean HeadRelative;
44 ALboolean Looping;
45 enum DistanceModel DistanceModel;
46 enum Resampler Resampler;
47 ALboolean DirectChannels;
48 enum SpatializeMode Spatialize;
50 ALboolean DryGainHFAuto;
51 ALboolean WetGainAuto;
52 ALboolean WetGainHFAuto;
53 ALfloat OuterGainHF;
55 ALfloat AirAbsorptionFactor;
56 ALfloat RoomRolloffFactor;
57 ALfloat DopplerFactor;
59 /* NOTE: Stereo pan angles are specified in radians, counter-clockwise
60 * rather than clockwise.
62 ALfloat StereoPan[2];
64 ALfloat Radius;
66 /** Direct filter and auxiliary send info. */
67 struct {
68 ALfloat Gain;
69 ALfloat GainHF;
70 ALfloat HFReference;
71 ALfloat GainLF;
72 ALfloat LFReference;
73 } Direct;
74 struct {
75 struct ALeffectslot *Slot;
76 ALfloat Gain;
77 ALfloat GainHF;
78 ALfloat HFReference;
79 ALfloat GainLF;
80 ALfloat LFReference;
81 } *Send;
83 /**
84 * Last user-specified offset, and the offset type (bytes, samples, or
85 * seconds).
87 ALdouble Offset;
88 ALenum OffsetType;
90 /** Source type (static, streaming, or undetermined) */
91 ALint SourceType;
93 /** Source state (initial, playing, paused, or stopped) */
94 ATOMIC(ALenum) state;
96 /** Source Buffer Queue head. */
97 RWLock queue_lock;
98 ALbufferlistitem *queue;
100 ATOMIC_FLAG PropsClean;
102 /** Self ID */
103 ALuint id;
104 } ALsource;
106 inline void LockSourcesRead(ALCcontext *context)
107 { LockUIntMapRead(&context->SourceMap); }
108 inline void UnlockSourcesRead(ALCcontext *context)
109 { UnlockUIntMapRead(&context->SourceMap); }
110 inline void LockSourcesWrite(ALCcontext *context)
111 { LockUIntMapWrite(&context->SourceMap); }
112 inline void UnlockSourcesWrite(ALCcontext *context)
113 { UnlockUIntMapWrite(&context->SourceMap); }
115 inline struct ALsource *LookupSource(ALCcontext *context, ALuint id)
116 { return (struct ALsource*)LookupUIntMapKeyNoLock(&context->SourceMap, id); }
117 inline struct ALsource *RemoveSource(ALCcontext *context, ALuint id)
118 { return (struct ALsource*)RemoveUIntMapKeyNoLock(&context->SourceMap, id); }
120 void UpdateAllSourceProps(ALCcontext *context);
122 ALvoid ReleaseALSources(ALCcontext *Context);
124 #ifdef __cplusplus
126 #endif
128 #endif