18 typedef struct ALbufferlistitem {
19 struct ALbuffer *buffer;
20 struct ALbufferlistitem *volatile next;
21 struct ALbufferlistitem *volatile prev;
25 typedef struct ALvoice {
26 struct ALsource *volatile Source;
28 /** Method to update mixing parameters. */
29 ALvoid (*Update)(struct ALvoice *self, const struct ALsource *source, const ALCcontext *context);
31 /** Current target parameters used for mixing. */
36 ALuint Offset; /* Number of output samples mixed since starting. */
38 alignas(16) ALfloat PrevSamples[MAX_INPUT_CHANNELS][MAX_PRE_SAMPLES];
43 SendParams Send[MAX_SENDS];
47 typedef struct ALsource {
48 /** Source properties. */
49 volatile ALfloat Pitch;
50 volatile ALfloat Gain;
51 volatile ALfloat OuterGain;
52 volatile ALfloat MinGain;
53 volatile ALfloat MaxGain;
54 volatile ALfloat InnerAngle;
55 volatile ALfloat OuterAngle;
56 volatile ALfloat RefDistance;
57 volatile ALfloat MaxDistance;
58 volatile ALfloat RollOffFactor;
62 volatile ALfloat Orientation[2][3];
63 volatile ALboolean HeadRelative;
64 volatile ALboolean Looping;
65 volatile enum DistanceModel DistanceModel;
66 volatile ALboolean DirectChannels;
68 volatile ALboolean DryGainHFAuto;
69 volatile ALboolean WetGainAuto;
70 volatile ALboolean WetGainHFAuto;
71 volatile ALfloat OuterGainHF;
73 volatile ALfloat AirAbsorptionFactor;
74 volatile ALfloat RoomRolloffFactor;
75 volatile ALfloat DopplerFactor;
77 volatile ALfloat Radius;
80 * Last user-specified offset, and the offset type (bytes, samples, or
86 /** Source type (static, streaming, or undetermined) */
87 volatile ALint SourceType;
89 /** Source state (initial, playing, paused, or stopped) */
90 volatile ALenum state;
94 * Source offset in samples, relative to the currently playing buffer, NOT
95 * the whole queue, and the fractional (fixed-point) offset to the next
99 ALuint position_fraction;
103 * Number of repeats Source should be played before finishing playback.
108 /** Source Buffer Queue info. */
109 ATOMIC(ALbufferlistitem*) queue;
110 ATOMIC(ALbufferlistitem*) current_buffer;
113 /** Current buffer sample info. */
117 /** Direct filter and auxiliary send info. */
126 struct ALeffectslot *Slot;
134 /** Source needs to update its mixing parameters. */
135 ATOMIC(ALenum) NeedsUpdate;
141 inline struct ALsource *LookupSource(ALCcontext *context, ALuint id)
142 { return (struct ALsource*)LookupUIntMapKey(&context->SourceMap, id); }
143 inline struct ALsource *RemoveSource(ALCcontext *context, ALuint id)
144 { return (struct ALsource*)RemoveUIntMapKey(&context->SourceMap, id); }
146 ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state);
147 ALboolean ApplyOffset(ALsource *Source);
149 ALvoid ReleaseALSources(ALCcontext *Context);