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. */
38 ALuint Offset
; /* Number of output samples mixed since starting. */
41 SendParams Send
[MAX_SENDS
];
45 typedef struct ALsource
{
46 /** Source properties. */
47 volatile ALfloat Pitch
;
48 volatile ALfloat Gain
;
49 volatile ALfloat OuterGain
;
50 volatile ALfloat MinGain
;
51 volatile ALfloat MaxGain
;
52 volatile ALfloat InnerAngle
;
53 volatile ALfloat OuterAngle
;
54 volatile ALfloat RefDistance
;
55 volatile ALfloat MaxDistance
;
56 volatile ALfloat RollOffFactor
;
57 volatile ALfloat Position
[3];
58 volatile ALfloat Velocity
[3];
59 volatile ALfloat Orientation
[3];
60 volatile ALboolean HeadRelative
;
61 volatile ALboolean Looping
;
62 volatile enum DistanceModel DistanceModel
;
63 volatile ALboolean DirectChannels
;
65 volatile ALboolean DryGainHFAuto
;
66 volatile ALboolean WetGainAuto
;
67 volatile ALboolean WetGainHFAuto
;
68 volatile ALfloat OuterGainHF
;
70 volatile ALfloat AirAbsorptionFactor
;
71 volatile ALfloat RoomRolloffFactor
;
72 volatile ALfloat DopplerFactor
;
74 volatile ALfloat Radius
;
76 enum Resampler Resampler
;
79 * Last user-specified offset, and the offset type (bytes, samples, or
85 /** Source type (static, streaming, or undetermined) */
86 volatile ALint SourceType
;
88 /** Source state (initial, playing, paused, or stopped) */
89 volatile ALenum state
;
93 * Source offset in samples, relative to the currently playing buffer, NOT
94 * the whole queue, and the fractional (fixed-point) offset to the next
98 ALuint position_fraction
;
100 /** Source Buffer Queue info. */
101 ALbufferlistitem
*volatile queue
;
102 ALbufferlistitem
*volatile current_buffer
;
105 /** Current buffer sample info. */
109 /** Direct filter and auxiliary send info. */
118 struct ALeffectslot
*Slot
;
126 /** Source needs to update its mixing parameters. */
127 ATOMIC(ALenum
) NeedsUpdate
;
133 inline struct ALsource
*LookupSource(ALCcontext
*context
, ALuint id
)
134 { return (struct ALsource
*)LookupUIntMapKey(&context
->SourceMap
, id
); }
135 inline struct ALsource
*RemoveSource(ALCcontext
*context
, ALuint id
)
136 { return (struct ALsource
*)RemoveUIntMapKey(&context
->SourceMap
, id
); }
138 ALvoid
SetSourceState(ALsource
*Source
, ALCcontext
*Context
, ALenum state
);
139 ALboolean
ApplyOffset(ALsource
*Source
);
141 ALvoid
ReleaseALSources(ALCcontext
*Context
);