28
28
struct ALbufferlistitem *prev;
29
29
} ALbufferlistitem;
31
typedef struct HrtfState {
34
ALIGN(16) ALfloat History[MaxChannels][SRC_HISTORY_LENGTH];
35
ALIGN(16) ALfloat Values[MaxChannels][HRIR_LENGTH][2];
39
typedef struct HrtfParams {
42
ALIGN(16) ALfloat Coeffs[MaxChannels][HRIR_LENGTH][2];
43
ALIGN(16) ALfloat CoeffStep[HRIR_LENGTH][2];
44
ALuint Delay[MaxChannels][2];
49
typedef struct DirectParams {
50
ALfloat (*OutBuffer)[BUFFERSIZE];
51
ALfloat *ClickRemoval;
52
ALfloat *PendingClicks;
59
/* A mixing matrix. First subscript is the channel number of the input data
60
* (regardless of channel configuration) and the second is the channel
61
* target (eg. FrontLeft). Not used with HRTF. */
62
ALfloat Gains[MaxChannels][MaxChannels];
64
/* A low-pass filter, using 2 chained one-pole filters. */
66
ALfloat history[MaxChannels*2];
69
typedef struct SendParams {
70
struct ALeffectslot *Slot;
72
/* Gain control, which applies to all input channels to a single (mono)
76
/* A low-pass filter, using 2 chained one-pole filters. */
78
ALfloat history[MaxChannels*2];
31
82
typedef struct ALsource
33
volatile ALfloat flPitch;
34
volatile ALfloat flGain;
35
volatile ALfloat flOuterGain;
36
volatile ALfloat flMinGain;
37
volatile ALfloat flMaxGain;
38
volatile ALfloat flInnerAngle;
39
volatile ALfloat flOuterAngle;
40
volatile ALfloat flRefDistance;
41
volatile ALfloat flMaxDistance;
42
volatile ALfloat flRollOffFactor;
43
volatile ALfloat vPosition[3];
44
volatile ALfloat vVelocity[3];
45
volatile ALfloat vOrientation[3];
46
volatile ALboolean bHeadRelative;
47
volatile ALboolean bLooping;
84
/** Source properties. */
85
volatile ALfloat Pitch;
86
volatile ALfloat Gain;
87
volatile ALfloat OuterGain;
88
volatile ALfloat MinGain;
89
volatile ALfloat MaxGain;
90
volatile ALfloat InnerAngle;
91
volatile ALfloat OuterAngle;
92
volatile ALfloat RefDistance;
93
volatile ALfloat MaxDistance;
94
volatile ALfloat RollOffFactor;
95
volatile ALfloat Position[3];
96
volatile ALfloat Velocity[3];
97
volatile ALfloat Orientation[3];
98
volatile ALboolean HeadRelative;
99
volatile ALboolean Looping;
48
100
volatile enum DistanceModel DistanceModel;
49
101
volatile ALboolean DirectChannels;
103
volatile ALboolean DryGainHFAuto;
104
volatile ALboolean WetGainAuto;
105
volatile ALboolean WetGainHFAuto;
106
volatile ALfloat OuterGainHF;
108
volatile ALfloat AirAbsorptionFactor;
109
volatile ALfloat RoomRolloffFactor;
110
volatile ALfloat DopplerFactor;
51
112
enum Resampler Resampler;
115
* Last user-specified offset, and the offset type (bytes, samples, or
121
/** Source type (static, streaming, or undetermined) */
122
volatile ALint SourceType;
124
/** Source state (initial, playing, paused, or stopped) */
53
125
volatile ALenum state;
129
* Source offset in samples, relative to the currently playing buffer, NOT
130
* the whole queue, and the fractional (fixed-point) offset to the next
56
134
ALuint position_fraction;
58
ALbufferlistitem *queue; // Linked list of buffers in queue
59
ALuint BuffersInQueue; // Number of buffers in queue
60
ALuint BuffersPlayed; // Number of buffers played on this loop
136
/** Source Buffer Queue info. */
137
ALbufferlistitem *queue;
138
ALuint BuffersInQueue;
139
ALuint BuffersPlayed;
141
/** Current buffer sample info. */
145
/** Direct filter and auxiliary send info. */
62
146
ALfloat DirectGain;
63
147
ALfloat DirectGainHF;
66
150
struct ALeffectslot *Slot;
69
153
} Send[MAX_SENDS];
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;
83
// Source Type (Static, Streaming, or Undetermined)
84
volatile ALint lSourceType;
92
ALfloat HrtfHistory[MAXCHANNELS][SRC_HISTORY_LENGTH];
93
ALfloat HrtfValues[MAXCHANNELS][HRIR_LENGTH][2];
96
/* Current target parameters used for mixing */
158
/** Current target parameters used for mixing. */
160
ResamplerFunc Resample;
104
ALfloat HrtfCoeffs[MAXCHANNELS][HRIR_LENGTH][2];
105
ALuint HrtfDelay[MAXCHANNELS][2];
106
ALfloat HrtfCoeffStep[HRIR_LENGTH][2];
107
ALint HrtfDelayStep[2];
109
/* A mixing matrix. First subscript is the channel number of the input
110
* data (regardless of channel configuration) and the second is the
111
* channel target (eg. FRONT_LEFT) */
112
ALfloat DryGains[MAXCHANNELS][MAXCHANNELS];
115
ALfloat history[MAXCHANNELS*2];
118
struct ALeffectslot *Slot;
121
ALfloat history[MAXCHANNELS];
168
SendParams Send[MAX_SENDS];
170
/** Source needs to update its mixing parameters. */
124
171
volatile ALenum NeedsUpdate;
173
/** Method to update mixing parameters. */
126
174
ALvoid (*Update)(struct ALsource *self, const ALCcontext *context);
131
179
#define ALsource_Update(s,a) ((s)->Update(s,a))