Store a reference to the effect slot in a source's send, not a copy
[openal-soft.git] / OpenAL32 / Include / alSource.h
blobf6a4619a0e87457081b64324c81569c60b283ab7
1 #ifndef _AL_SOURCE_H_
2 #define _AL_SOURCE_H_
4 #define AL_NUM_SOURCE_PARAMS 128
6 /* This cannot be changed without working on the code! */
7 #define MAX_SENDS 1
9 #include "alFilter.h"
10 #include "alAuxEffectSlot.h"
11 #include "AL/al.h"
13 #define AL_DIRECT_FILTER 0x20005
14 #define AL_AUXILIARY_SEND_FILTER 0x20006
15 #define AL_AIR_ABSORPTION_FACTOR 0x20007
16 #define AL_ROOM_ROLLOFF_FACTOR 0x20008
17 #define AL_CONE_OUTER_GAINHF 0x20009
18 #define AL_DIRECT_FILTER_GAINHF_AUTO 0x2000A
19 #define AL_AUXILIARY_SEND_FILTER_GAIN_AUTO 0x2000B
20 #define AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO 0x2000C
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
26 typedef struct ALbufferlistitem
28 ALuint buffer;
29 ALuint bufferstate;
30 ALuint flag;
31 struct ALbufferlistitem *next;
32 } ALbufferlistitem;
34 typedef struct ALsource
36 ALfloat flPitch;
37 ALfloat flGain;
38 ALfloat flOuterGain;
39 ALfloat flMinGain;
40 ALfloat flMaxGain;
41 ALfloat flInnerAngle;
42 ALfloat flOuterAngle;
43 ALfloat flRefDistance;
44 ALfloat flMaxDistance;
45 ALfloat flRollOffFactor;
46 ALfloat vPosition[3];
47 ALfloat vVelocity[3];
48 ALfloat vOrientation[3];
49 ALboolean bHeadRelative;
50 ALboolean bLooping;
52 ALuint ulBufferID;
54 ALboolean inuse;
55 ALboolean play;
56 ALenum state;
57 ALuint position;
58 ALuint position_fraction;
59 struct ALbufferlistitem *queue; // Linked list of buffers in queue
60 ALuint BuffersInQueue; // Number of buffers in queue
61 ALuint BuffersProcessed; // Number of buffers already processed (played)
63 ALuint TotalBufferDataSize; // Total amount of data contained in the buffers queued for this source
64 ALuint BuffersPlayed; // Number of buffers played on this loop
65 ALuint BufferPosition; // Read position in audio data of current buffer
67 ALfilter DirectFilter;
69 struct {
70 ALeffectslot *Slot;
71 ALfilter WetFilter;
72 } Send[MAX_SENDS];
74 ALfloat LastDrySample;
75 ALfloat LastWetSample;
77 ALboolean DryGainHFAuto;
78 ALboolean WetGainAuto;
79 ALboolean WetGainHFAuto;
80 ALfloat OuterGainHF;
82 ALfloat AirAbsorptionFactor;
84 ALfloat RoomRolloffFactor;
86 // Index to itself
87 ALuint source;
89 ALint lBytesPlayed;
91 ALint lOffset;
92 ALint lOffsetType;
94 // Source Type (Static, Streaming, or Undetermined)
95 ALint lSourceType;
97 struct ALsource *next;
98 } ALsource;
100 #ifdef __cplusplus
102 #endif
104 #endif