Use powf when available
[openal-soft.git] / OpenAL32 / Include / alSource.h
blobb916b37b04ec6e258132a96e6ef603a3d3ec7dd3
1 #ifndef _AL_SOURCE_H_
2 #define _AL_SOURCE_H_
4 #define MAX_SENDS 2
6 #include "alFilter.h"
7 #include "alu.h"
8 #include "AL/al.h"
10 #define AL_DIRECT_FILTER 0x20005
11 #define AL_AUXILIARY_SEND_FILTER 0x20006
12 #define AL_AIR_ABSORPTION_FACTOR 0x20007
13 #define AL_ROOM_ROLLOFF_FACTOR 0x20008
14 #define AL_CONE_OUTER_GAINHF 0x20009
15 #define AL_DIRECT_FILTER_GAINHF_AUTO 0x2000A
16 #define AL_AUXILIARY_SEND_FILTER_GAIN_AUTO 0x2000B
17 #define AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO 0x2000C
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
23 typedef enum {
24 POINT_RESAMPLER = 0,
25 LINEAR_RESAMPLER,
26 COSINE_RESAMPLER,
28 RESAMPLER_MAX,
29 RESAMPLER_MIN = -1,
30 RESAMPLER_DEFAULT = LINEAR_RESAMPLER
31 } resampler_t;
32 extern resampler_t DefaultResampler;
34 typedef struct ALbufferlistitem
36 struct ALbuffer *buffer;
37 struct ALbufferlistitem *next;
38 } ALbufferlistitem;
40 typedef struct ALsource
42 ALfloat flPitch;
43 ALfloat flGain;
44 ALfloat flOuterGain;
45 ALfloat flMinGain;
46 ALfloat flMaxGain;
47 ALfloat flInnerAngle;
48 ALfloat flOuterAngle;
49 ALfloat flRefDistance;
50 ALfloat flMaxDistance;
51 ALfloat flRollOffFactor;
52 ALfloat vPosition[3];
53 ALfloat vVelocity[3];
54 ALfloat vOrientation[3];
55 ALboolean bHeadRelative;
56 ALboolean bLooping;
57 ALenum DistanceModel;
59 resampler_t Resampler;
61 ALenum state;
62 ALuint position;
63 ALuint position_fraction;
65 struct ALbuffer *Buffer;
67 struct ALbufferlistitem *queue; // Linked list of buffers in queue
68 ALuint BuffersInQueue; // Number of buffers in queue
69 ALuint BuffersPlayed; // Number of buffers played on this loop
71 ALfilter DirectFilter;
73 struct {
74 struct ALeffectslot *Slot;
75 ALfilter WetFilter;
76 } Send[MAX_SENDS];
78 ALboolean DryGainHFAuto;
79 ALboolean WetGainAuto;
80 ALboolean WetGainHFAuto;
81 ALfloat OuterGainHF;
83 ALfloat AirAbsorptionFactor;
84 ALfloat RoomRolloffFactor;
85 ALfloat DopplerFactor;
87 ALint lOffset;
88 ALint lOffsetType;
90 // Source Type (Static, Streaming, or Undetermined)
91 ALint lSourceType;
93 // Current gains, which are ramped while mixed
94 ALfloat DryGains[OUTPUTCHANNELS];
95 ALfloat WetGains[MAX_SENDS];
96 ALboolean FirstStart;
98 // Current target parameters used for mixing
99 ALboolean NeedsUpdate;
100 struct {
101 ALfloat DryGains[OUTPUTCHANNELS];
102 ALfloat WetGains[MAX_SENDS];
103 ALfloat Pitch;
105 struct {
106 FILTER iirFilter;
107 ALfloat history[OUTPUTCHANNELS];
108 } Send[MAX_SENDS];
110 FILTER iirFilter;
111 ALfloat history[OUTPUTCHANNELS*2];
112 } Params;
114 // Index to itself
115 ALuint source;
117 struct ALsource *next;
118 } ALsource;
120 ALvoid ReleaseALSources(ALCcontext *Context);
122 #ifdef __cplusplus
124 #endif
126 #endif