14 extern enum Resampler DefaultResampler
;
16 extern const ALsizei ResamplerPadding
[ResamplerMax
];
17 extern const ALsizei ResamplerPrePadding
[ResamplerMax
];
20 typedef struct ALbufferlistitem
{
21 struct ALbuffer
*buffer
;
22 struct ALbufferlistitem
*next
;
23 struct ALbufferlistitem
*prev
;
27 typedef struct ALactivesource
{
28 struct ALsource
*Source
;
30 /** Method to update mixing parameters. */
31 ALvoid (*Update
)(struct ALactivesource
*self
, const ALCcontext
*context
);
33 /** Current target parameters used for mixing. */
34 ResamplerFunc Resample
;
37 HrtfMixerFunc HrtfMix
;
44 ALuint Offset
; /* Number of output samples mixed since starting. */
47 SendParams Send
[MAX_SENDS
];
51 typedef struct ALsource
{
52 /** Source properties. */
53 volatile ALfloat Pitch
;
54 volatile ALfloat Gain
;
55 volatile ALfloat OuterGain
;
56 volatile ALfloat MinGain
;
57 volatile ALfloat MaxGain
;
58 volatile ALfloat InnerAngle
;
59 volatile ALfloat OuterAngle
;
60 volatile ALfloat RefDistance
;
61 volatile ALfloat MaxDistance
;
62 volatile ALfloat RollOffFactor
;
63 volatile ALfloat Position
[3];
64 volatile ALfloat Velocity
[3];
65 volatile ALfloat Orientation
[3];
66 volatile ALboolean HeadRelative
;
67 volatile ALboolean Looping
;
68 volatile enum DistanceModel DistanceModel
;
69 volatile ALboolean DirectChannels
;
71 volatile ALboolean DryGainHFAuto
;
72 volatile ALboolean WetGainAuto
;
73 volatile ALboolean WetGainHFAuto
;
74 volatile ALfloat OuterGainHF
;
76 volatile ALfloat AirAbsorptionFactor
;
77 volatile ALfloat RoomRolloffFactor
;
78 volatile ALfloat DopplerFactor
;
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 ALbufferlistitem
*volatile queue
;
106 ALbufferlistitem
*volatile 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 volatile 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
);