Remove the format and frequency from the source, get them manually
[openal-soft.git] / OpenAL32 / Include / alSource.h
blob663a9e3568037e261ec4c3c94a6f789fea8008f2
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 struct ALbufferlistitem *next;
29 } ALbufferlistitem;
31 typedef struct ALsource
33 ALfloat flPitch;
34 ALfloat flGain;
35 ALfloat flOuterGain;
36 ALfloat flMinGain;
37 ALfloat flMaxGain;
38 ALfloat flInnerAngle;
39 ALfloat flOuterAngle;
40 ALfloat flRefDistance;
41 ALfloat flMaxDistance;
42 ALfloat flRollOffFactor;
43 ALfloat vPosition[3];
44 ALfloat vVelocity[3];
45 ALfloat vOrientation[3];
46 ALboolean bHeadRelative;
47 ALboolean bLooping;
48 ALenum DistanceModel;
50 ALenum state;
51 ALuint position;
52 ALuint position_fraction;
54 struct ALbuffer *Buffer;
56 struct ALbufferlistitem *queue; // Linked list of buffers in queue
57 ALuint BuffersInQueue; // Number of buffers in queue
58 ALuint BuffersPlayed; // Number of buffers played on this loop
60 ALfilter DirectFilter;
62 struct {
63 struct ALeffectslot *Slot;
64 ALfilter WetFilter;
65 } Send[MAX_SENDS];
67 ALboolean DryGainHFAuto;
68 ALboolean WetGainAuto;
69 ALboolean WetGainHFAuto;
70 ALfloat OuterGainHF;
72 ALfloat AirAbsorptionFactor;
73 ALfloat RoomRolloffFactor;
74 ALfloat DopplerFactor;
76 ALint lOffset;
77 ALint lOffsetType;
79 // Source Type (Static, Streaming, or Undetermined)
80 ALint lSourceType;
82 // Current gains, which are ramped while mixed
83 ALfloat DryGains[OUTPUTCHANNELS];
84 ALfloat WetGains[MAX_SENDS];
85 ALboolean FirstStart;
87 // Current target parameters used for mixing
88 struct {
89 ALfloat DryGains[OUTPUTCHANNELS];
90 ALfloat WetGains[MAX_SENDS];
91 ALfloat Pitch;
93 struct {
94 FILTER iirFilter;
95 ALfloat history[2];
96 } Send[MAX_SENDS];
98 FILTER iirFilter;
99 ALfloat history[OUTPUTCHANNELS*2];
100 } Params;
102 // Index to itself
103 ALuint source;
105 struct ALsource *next;
106 } ALsource;
108 ALvoid ReleaseALSources(ALCcontext *Context);
110 #ifdef __cplusplus
112 #endif
114 #endif