zenilib: zenilib/jni/external/openal-soft/OpenAL32/Include/alSource.h Source File

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
alSource.h
Go to the documentation of this file.
1 #ifndef _AL_SOURCE_H_
2 #define _AL_SOURCE_H_
3
4 #define MAX_SENDS 4
5
6 #include "alMain.h"
7 #include "alu.h"
8 #include "alFilter.h"
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 #define SRC_HISTORY_BITS (6)
15 #define SRC_HISTORY_LENGTH (1<<SRC_HISTORY_BITS)
16 #define SRC_HISTORY_MASK (SRC_HISTORY_LENGTH-1)
17
18 extern enum Resampler DefaultResampler;
19
20 extern const ALsizei ResamplerPadding[ResamplerMax];
21 extern const ALsizei ResamplerPrePadding[ResamplerMax];
22
23
24 typedef struct ALbufferlistitem
25 {
26 struct ALbuffer *buffer;
27 struct ALbufferlistitem *next;
28 struct ALbufferlistitem *prev;
29 } ALbufferlistitem;
30
31 typedef struct HrtfState {
32 ALboolean Moving;
33 ALuint Counter;
34 ALIGN(16) ALfloat History[MaxChannels][SRC_HISTORY_LENGTH];
35 ALIGN(16) ALfloat Values[MaxChannels][HRIR_LENGTH][2];
36 ALuint Offset;
37 } HrtfState;
38
39 typedef struct HrtfParams {
40 ALfloat Gain;
41 ALfloat Dir[3];
42 ALIGN(16) ALfloat Coeffs[MaxChannels][HRIR_LENGTH][2];
43 ALIGN(16) ALfloat CoeffStep[HRIR_LENGTH][2];
44 ALuint Delay[MaxChannels][2];
45 ALint DelayStep[2];
46 ALuint IrSize;
47 } HrtfParams;
48
49 typedef struct DirectParams {
50 ALfloat (*OutBuffer)[BUFFERSIZE];
51 ALfloat *ClickRemoval;
52 ALfloat *PendingClicks;
53
54 struct {
55 HrtfParams Params;
56 HrtfState *State;
57 } Hrtf;
58
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];
63
64 /* A low-pass filter, using 2 chained one-pole filters. */
65 FILTER iirFilter;
66 ALfloat history[MaxChannels*2];
67 } DirectParams;
68
69 typedef struct SendParams {
70 struct ALeffectslot *Slot;
71
72 /* Gain control, which applies to all input channels to a single (mono)
73 * output buffer. */
74 ALfloat Gain;
75
76 /* A low-pass filter, using 2 chained one-pole filters. */
77 FILTER iirFilter;
78 ALfloat history[MaxChannels*2];
79 } SendParams;
80
81
82 typedef struct ALsource
83 {
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;
100 volatile enum DistanceModel DistanceModel;
101 volatile ALboolean DirectChannels;
102
103 volatile ALboolean DryGainHFAuto;
104 volatile ALboolean WetGainAuto;
105 volatile ALboolean WetGainHFAuto;
106 volatile ALfloat OuterGainHF;
107
108 volatile ALfloat AirAbsorptionFactor;
109 volatile ALfloat RoomRolloffFactor;
110 volatile ALfloat DopplerFactor;
111
112 enum Resampler Resampler;
113
118 ALdouble Offset;
119 ALenum OffsetType;
120
122 volatile ALint SourceType;
123
125 volatile ALenum state;
126 ALenum new_state;
127
133 ALuint position;
134 ALuint position_fraction;
135
137 ALbufferlistitem *queue;
138 ALuint BuffersInQueue;
139 ALuint BuffersPlayed;
140
142 ALuint NumChannels;
143 ALuint SampleSize;
144
146 ALfloat DirectGain;
147 ALfloat DirectGainHF;
148
149 struct {
150 struct ALeffectslot *Slot;
151 ALfloat Gain;
152 ALfloat GainHF;
153 } Send[MAX_SENDS];
154
156 HrtfState Hrtf;
157
159 struct {
160 ResamplerFunc Resample;
161 DryMixerFunc DryMix;
162 WetMixerFunc WetMix;
163
164 ALint Step;
165
166 DirectParams Direct;
167
168 SendParams Send[MAX_SENDS];
169 } Params;
171 volatile ALenum NeedsUpdate;
172
174 ALvoid (*Update)(struct ALsource *self, const ALCcontext *context);
175
177 ALuint id;
178 } ALsource;
179 #define ALsource_Update(s,a) ((s)->Update(s,a))
180
181 ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state);
182 ALboolean ApplyOffset(ALsource *Source);
183
184 ALvoid ReleaseALSources(ALCcontext *Context);
185
186 #ifdef __cplusplus
187 }
188 #endif
189
190 #endif
ALsource::Offset
ALdouble Offset
Definition: alSource.h:118
ALsource::Slot
struct ALeffectslot * Slot
Definition: alSource.h:150
WetMixerFunc
ALvoid(* WetMixerFunc)(const struct SendParams *params, const ALfloat *RESTRICT data, ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
Definition: alu.h:40
ALsource::WetGainHFAuto
volatile ALboolean WetGainHFAuto
Definition: alSource.h:105
ALvoid
void ALvoid
Definition: al.h:74
DirectParams
Definition: alSource.h:49
ALsource::state
volatile ALenum state
Definition: alSource.h:125
ALsource::DopplerFactor
volatile ALfloat DopplerFactor
Definition: alSource.h:110
ALbufferlistitem
struct ALbufferlistitem ALbufferlistitem
ALsource::position
ALuint position
Definition: alSource.h:133
SRC_HISTORY_LENGTH
#define SRC_HISTORY_LENGTH
Definition: alSource.h:15
DirectParams
struct DirectParams DirectParams
ALsource::Pitch
volatile ALfloat Pitch
Definition: alSource.h:85
SendParams::iirFilter
FILTER iirFilter
Definition: alSource.h:77
ALsource::OffsetType
ALenum OffsetType
Definition: alSource.h:119
ResamplerPadding
const ALsizei ResamplerPadding[ResamplerMax]
Definition: alSource.c:38
alu.h
ALsizei
int ALsizei
Definition: al.h:62
SendParams
struct SendParams SendParams
DryMixerFunc
ALvoid(* DryMixerFunc)(const struct DirectParams *params, const ALfloat *RESTRICT data, ALuint srcchan, ALuint OutPos, ALuint SamplesToDo, ALuint BufferSize)
Definition: alu.h:36
ALint
int ALint
Definition: al.h:56
DistanceModel
DistanceModel
Definition: alMain.h:460
HrtfState::ALIGN
ALIGN(16) ALfloat History[MaxChannels][SRC_HISTORY_LENGTH]
alFilter.h
ALsource::NeedsUpdate
volatile ALenum NeedsUpdate
Definition: alSource.h:171
ALsource::OuterGainHF
volatile ALfloat OuterGainHF
Definition: alSource.h:106
ResamplerMax
Definition: alMain.h:477
HRIR_LENGTH
#define HRIR_LENGTH
Definition: alMain.h:776
ALfloat
float ALfloat
Definition: al.h:68
ALsource::DryMix
DryMixerFunc DryMix
Definition: alSource.h:161
ALbufferlistitem
Definition: alSource.h:24
ALsource::MinGain
volatile ALfloat MinGain
Definition: alSource.h:88
DirectParams::iirFilter
FILTER iirFilter
Definition: alSource.h:65
ALsource::Step
ALint Step
Definition: alSource.h:164
ALbuffer
Definition: alBuffer.h:69
DefaultResampler
enum Resampler DefaultResampler
Definition: alSource.c:37
ALsource::RoomRolloffFactor
volatile ALfloat RoomRolloffFactor
Definition: alSource.h:109
ALsource::AirAbsorptionFactor
volatile ALfloat AirAbsorptionFactor
Definition: alSource.h:108
ALdouble
double ALdouble
Definition: al.h:71
ALsource::DirectGainHF
ALfloat DirectGainHF
Definition: alSource.h:147
ALsource::position_fraction
ALuint position_fraction
Definition: alSource.h:134
ALsource::RefDistance
volatile ALfloat RefDistance
Definition: alSource.h:92
ALsource::DirectGain
ALfloat DirectGain
Definition: alSource.h:146
ALeffectslot
Definition: alAuxEffectSlot.h:19
ALsource::GainHF
ALfloat GainHF
Definition: alSource.h:152
ALsource::HeadRelative
volatile ALboolean HeadRelative
Definition: alSource.h:98
ALsource::OuterAngle
volatile ALfloat OuterAngle
Definition: alSource.h:91
ALsource::id
ALuint id
Definition: alSource.h:177
ALsource::MaxDistance
volatile ALfloat MaxDistance
Definition: alSource.h:93
alMain.h
SendParams::Slot
struct ALeffectslot * Slot
Definition: alSource.h:70
ALsource::SampleSize
ALuint SampleSize
Definition: alSource.h:143
FILTER
Definition: alFilter.h:12
ALsource::WetMix
WetMixerFunc WetMix
Definition: alSource.h:162
MAX_SENDS
#define MAX_SENDS
Definition: alSource.h:4
ResamplerPrePadding
const ALsizei ResamplerPrePadding[ResamplerMax]
Definition: alSource.c:43
ALsource::DryGainHFAuto
volatile ALboolean DryGainHFAuto
Definition: alSource.h:103
ALsource::new_state
ALenum new_state
Definition: alSource.h:126
DirectParams::Params
HrtfParams Params
Definition: alSource.h:55
SendParams::Gain
ALfloat Gain
Definition: alSource.h:74
ALsource::Resample
ResamplerFunc Resample
Definition: alSource.h:160
ALenum
int ALenum
Definition: al.h:65
ReleaseALSources
ALvoid ReleaseALSources(ALCcontext *Context)
Definition: alSource.c:2705
ALuint
unsigned int ALuint
Definition: al.h:59
ALsource::OuterGain
volatile ALfloat OuterGain
Definition: alSource.h:87
ALsource::Direct
DirectParams Direct
Definition: alSource.h:166
ALsource::NumChannels
ALuint NumChannels
Definition: alSource.h:142
ALsource::MaxGain
volatile ALfloat MaxGain
Definition: alSource.h:89
ALsource::WetGainAuto
volatile ALboolean WetGainAuto
Definition: alSource.h:104
ALbufferlistitem::buffer
struct ALbuffer * buffer
Definition: alSource.h:26
ALsource::Gain
ALfloat Gain
Definition: alSource.h:151
HrtfState::Moving
ALboolean Moving
Definition: alSource.h:32
ALsource::Looping
volatile ALboolean Looping
Definition: alSource.h:99
ALsource::DirectChannels
volatile ALboolean DirectChannels
Definition: alSource.h:101
ALsource
struct ALsource ALsource
DirectParams::PendingClicks
ALfloat * PendingClicks
Definition: alSource.h:52
Resampler
Resampler
Definition: alMain.h:472
HrtfParams
Definition: alSource.h:39
ALCcontext_struct
Definition: alMain.h:675
ALbufferlistitem::next
struct ALbufferlistitem * next
Definition: alSource.h:27
ALsource::Gain
volatile ALfloat Gain
Definition: alSource.h:86
HrtfState::Counter
ALuint Counter
Definition: alSource.h:33
DirectParams::State
HrtfState * State
Definition: alSource.h:56
HrtfParams::Gain
ALfloat Gain
Definition: alSource.h:40
ALboolean
char ALboolean
Definition: al.h:38
ALsource
Definition: alSource.h:82
ALsource::RollOffFactor
volatile ALfloat RollOffFactor
Definition: alSource.h:94
ALsource::BuffersInQueue
ALuint BuffersInQueue
Definition: alSource.h:138
ALbufferlistitem::prev
struct ALbufferlistitem * prev
Definition: alSource.h:28
context
TParseContext * context
Definition: glslang_tab.cpp:1907
ALsource::SourceType
volatile ALint SourceType
Definition: alSource.h:122
ResamplerFunc
void(* ResamplerFunc)(const ALfloat *src, ALuint frac, ALuint increment, ALfloat *RESTRICT dst, ALuint dstlen)
Definition: alu.h:33
BUFFERSIZE
#define BUFFERSIZE
Definition: alMain.h:556
HrtfState
Definition: alSource.h:31
SendParams
Definition: alSource.h:69
ALsource::BuffersPlayed
ALuint BuffersPlayed
Definition: alSource.h:139
ALsource::InnerAngle
volatile ALfloat InnerAngle
Definition: alSource.h:90
SetSourceState
ALvoid SetSourceState(ALsource *Source, ALCcontext *Context, ALenum state)
Definition: alSource.c:2312
ApplyOffset
ALboolean ApplyOffset(ALsource *Source)
Definition: alSource.c:2596
DirectParams::ClickRemoval
ALfloat * ClickRemoval
Definition: alSource.h:51
ALsource::queue
ALbufferlistitem * queue
Definition: alSource.h:137
MaxChannels
Definition: alMain.h:491
ALsource::Hrtf
HrtfState Hrtf
Definition: alSource.h:156
HrtfState::Offset
ALuint Offset
Definition: alSource.h:36