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
;
60 volatile ALfloat Position
[3];
61 volatile ALfloat Velocity
[3];
62 volatile ALfloat Orientation
[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
;
79 enum Resampler Resampler
;
82 * Last user-specified offset, and the offset type (bytes, samples, or
88 /** Source type (static, streaming, or undetermined) */
89 volatile ALint SourceType
;
91 /** Source state (initial, playing, paused, or stopped) */
92 volatile ALenum state
;
96 * Source offset in samples, relative to the currently playing buffer, NOT
97 * the whole queue, and the fractional (fixed-point) offset to the next
101 ALuint position_fraction
;
103 /** Source Buffer Queue info. */
104 ATOMIC(ALbufferlistitem
*) queue
;
105 ATOMIC(ALbufferlistitem
*) current_buffer
;
108 /** Current buffer sample info. */
112 /** Direct filter and auxiliary send info. */
121 struct ALeffectslot
*Slot
;
129 /** Source needs to update its mixing parameters. */
130 ATOMIC(ALenum
) NeedsUpdate
;
136 inline struct ALsource
*LookupSource(ALCcontext
*context
, ALuint id
)
137 { return (struct ALsource
*)LookupUIntMapKey(&context
->SourceMap
, id
); }
138 inline struct ALsource
*RemoveSource(ALCcontext
*context
, ALuint id
)
139 { return (struct ALsource
*)RemoveUIntMapKey(&context
->SourceMap
, id
); }
141 ALvoid
SetSourceState(ALsource
*Source
, ALCcontext
*Context
, ALenum state
);
142 ALboolean
ApplyOffset(ALsource
*Source
);
144 ALvoid
ReleaseALSources(ALCcontext
*Context
);