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
;
36 HrtfMixerFunc HrtfMix
;
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 enum Resampler Resampler
;
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
;
101 /** Source Buffer Queue info. */
102 ALbufferlistitem
*volatile queue
;
103 ALbufferlistitem
*volatile current_buffer
;
106 /** Current buffer sample info. */
110 /** Direct filter and auxiliary send info. */
119 struct ALeffectslot
*Slot
;
127 /** Source needs to update its mixing parameters. */
128 volatile ALenum NeedsUpdate
;
134 inline struct ALsource
*LookupSource(ALCcontext
*context
, ALuint id
)
135 { return (struct ALsource
*)LookupUIntMapKey(&context
->SourceMap
, id
); }
136 inline struct ALsource
*RemoveSource(ALCcontext
*context
, ALuint id
)
137 { return (struct ALsource
*)RemoveUIntMapKey(&context
->SourceMap
, id
); }
139 ALvoid
SetSourceState(ALsource
*Source
, ALCcontext
*Context
, ALenum state
);
140 ALboolean
ApplyOffset(ALsource
*Source
);
142 ALvoid
ReleaseALSources(ALCcontext
*Context
);