Store the buffer handle directly in the source and buffer queue list
[openal-soft.git] / OpenAL32 / Include / alSource.h
blob7e22584da630527c315f514c861583e4bed0d7bc
1 #ifndef _AL_SOURCE_H_
2 #define _AL_SOURCE_H_
4 #define AL_NUM_SOURCE_PARAMS 128
6 #define MAX_SENDS 2
8 #include "alFilter.h"
9 #include "alu.h"
10 #include "AL/al.h"
12 #define AL_DIRECT_FILTER 0x20005
13 #define AL_AUXILIARY_SEND_FILTER 0x20006
14 #define AL_AIR_ABSORPTION_FACTOR 0x20007
15 #define AL_ROOM_ROLLOFF_FACTOR 0x20008
16 #define AL_CONE_OUTER_GAINHF 0x20009
17 #define AL_DIRECT_FILTER_GAINHF_AUTO 0x2000A
18 #define AL_AUXILIARY_SEND_FILTER_GAIN_AUTO 0x2000B
19 #define AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO 0x2000C
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
25 typedef struct ALbufferlistitem
27 struct ALbuffer *buffer;
28 ALuint bufferstate;
29 ALuint flag;
30 struct ALbufferlistitem *next;
31 } ALbufferlistitem;
33 typedef struct ALsource
35 ALfloat flPitch;
36 ALfloat flGain;
37 ALfloat flOuterGain;
38 ALfloat flMinGain;
39 ALfloat flMaxGain;
40 ALfloat flInnerAngle;
41 ALfloat flOuterAngle;
42 ALfloat flRefDistance;
43 ALfloat flMaxDistance;
44 ALfloat flRollOffFactor;
45 ALfloat vPosition[3];
46 ALfloat vVelocity[3];
47 ALfloat vOrientation[3];
48 ALboolean bHeadRelative;
49 ALboolean bLooping;
50 ALenum DistanceModel;
52 ALenum state;
53 ALuint position;
54 ALuint position_fraction;
56 struct ALbuffer *Buffer;
58 struct 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
62 ALfilter DirectFilter;
64 struct {
65 struct ALeffectslot *Slot;
66 ALfilter WetFilter;
67 } Send[MAX_SENDS];
69 ALboolean DryGainHFAuto;
70 ALboolean WetGainAuto;
71 ALboolean WetGainHFAuto;
72 ALfloat OuterGainHF;
74 ALfloat AirAbsorptionFactor;
75 ALfloat RoomRolloffFactor;
76 ALfloat DopplerFactor;
78 ALint lOffset;
79 ALint lOffsetType;
81 // Source Type (Static, Streaming, or Undetermined)
82 ALint lSourceType;
84 // Current gains, which are ramped while mixed
85 ALfloat DryGains[OUTPUTCHANNELS];
86 ALfloat WetGains[MAX_SENDS];
87 ALboolean FirstStart;
89 // Current target parameters used for mixing
90 struct {
91 ALfloat DryGains[OUTPUTCHANNELS];
92 ALfloat WetGains[MAX_SENDS];
93 ALfloat Pitch;
95 struct {
96 FILTER iirFilter;
97 ALfloat history[2];
98 } Send[MAX_SENDS];
100 FILTER iirFilter;
101 ALfloat history[OUTPUTCHANNELS*2];
102 } Params;
104 // Index to itself
105 ALuint source;
107 struct ALsource *next;
108 } ALsource;
110 ALvoid ReleaseALSources(ALCcontext *Context);
112 #ifdef __cplusplus
114 #endif
116 #endif