17 extern enum Resampler DefaultResampler
;
19 extern const ALsizei ResamplerPadding
[ResamplerMax
];
20 extern const ALsizei ResamplerPrePadding
[ResamplerMax
];
23 typedef struct ALbufferlistitem
{
24 struct ALbuffer
*buffer
;
25 struct ALbufferlistitem
*volatile next
;
26 struct ALbufferlistitem
*volatile prev
;
30 typedef struct ALvoice
{
31 struct ALsource
*volatile Source
;
33 /** Method to update mixing parameters. */
34 ALvoid (*Update
)(struct ALvoice
*self
, const struct ALsource
*source
, const ALCcontext
*context
);
36 /** Current target parameters used for mixing. */
41 ALuint Offset
; /* Number of output samples mixed since starting. */
44 SendParams Send
[MAX_SENDS
];
48 typedef struct ALsource
{
49 /** Source properties. */
50 volatile ALfloat Pitch
;
51 volatile ALfloat Gain
;
52 volatile ALfloat OuterGain
;
53 volatile ALfloat MinGain
;
54 volatile ALfloat MaxGain
;
55 volatile ALfloat InnerAngle
;
56 volatile ALfloat OuterAngle
;
57 volatile ALfloat RefDistance
;
58 volatile ALfloat MaxDistance
;
59 volatile ALfloat RollOffFactor
;
63 volatile ALfloat Orientation
[2][3];
64 volatile ALboolean HeadRelative
;
65 volatile ALboolean Looping
;
66 volatile enum DistanceModel DistanceModel
;
67 volatile ALboolean DirectChannels
;
69 volatile ALboolean DryGainHFAuto
;
70 volatile ALboolean WetGainAuto
;
71 volatile ALboolean WetGainHFAuto
;
72 volatile ALfloat OuterGainHF
;
74 volatile ALfloat AirAbsorptionFactor
;
75 volatile ALfloat RoomRolloffFactor
;
76 volatile ALfloat DopplerFactor
;
78 volatile ALfloat Radius
;
80 enum Resampler Resampler
;
83 * Last user-specified offset, and the offset type (bytes, samples, or
89 /** Source type (static, streaming, or undetermined) */
90 volatile ALint SourceType
;
92 /** Source state (initial, playing, paused, or stopped) */
93 volatile ALenum state
;
97 * Source offset in samples, relative to the currently playing buffer, NOT
98 * the whole queue, and the fractional (fixed-point) offset to the next
102 ALuint position_fraction
;
104 /** Source Buffer Queue info. */
105 ATOMIC(ALbufferlistitem
*) queue
;
106 ATOMIC(ALbufferlistitem
*) current_buffer
;
109 /** Current buffer sample info. */
113 /** Direct filter and auxiliary send info. */
122 struct ALeffectslot
*Slot
;
130 /** Source needs to update its mixing parameters. */
131 ATOMIC(ALenum
) NeedsUpdate
;
137 inline struct ALsource
*LookupSource(ALCcontext
*context
, ALuint id
)
138 { return (struct ALsource
*)LookupUIntMapKey(&context
->SourceMap
, id
); }
139 inline struct ALsource
*RemoveSource(ALCcontext
*context
, ALuint id
)
140 { return (struct ALsource
*)RemoveUIntMapKey(&context
->SourceMap
, id
); }
142 ALvoid
SetSourceState(ALsource
*Source
, ALCcontext
*Context
, ALenum state
);
143 ALboolean
ApplyOffset(ALsource
*Source
);
145 ALvoid
ReleaseALSources(ALCcontext
*Context
);