Add an option for point resampling
[openal-soft/openal-hmr.git] / OpenAL32 / Include / alSource.h
blobde746c61c3caecfb4ddf7e6631b03b9524417225
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 enum {
26 POINT = 0,
27 LINEAR,
29 RESAMPLER_MAX
30 } resampler_t;
31 extern resampler_t DefaultResampler;
33 typedef struct ALbufferlistitem
35 struct ALbuffer *buffer;
36 struct ALbufferlistitem *next;
37 } ALbufferlistitem;
39 typedef struct ALsource
41 ALfloat flPitch;
42 ALfloat flGain;
43 ALfloat flOuterGain;
44 ALfloat flMinGain;
45 ALfloat flMaxGain;
46 ALfloat flInnerAngle;
47 ALfloat flOuterAngle;
48 ALfloat flRefDistance;
49 ALfloat flMaxDistance;
50 ALfloat flRollOffFactor;
51 ALfloat vPosition[3];
52 ALfloat vVelocity[3];
53 ALfloat vOrientation[3];
54 ALboolean bHeadRelative;
55 ALboolean bLooping;
56 ALenum DistanceModel;
58 resampler_t Resampler;
60 ALenum state;
61 ALuint position;
62 ALuint position_fraction;
64 struct ALbuffer *Buffer;
66 struct ALbufferlistitem *queue; // Linked list of buffers in queue
67 ALuint BuffersInQueue; // Number of buffers in queue
68 ALuint BuffersPlayed; // Number of buffers played on this loop
70 ALfilter DirectFilter;
72 struct {
73 struct ALeffectslot *Slot;
74 ALfilter WetFilter;
75 } Send[MAX_SENDS];
77 ALboolean DryGainHFAuto;
78 ALboolean WetGainAuto;
79 ALboolean WetGainHFAuto;
80 ALfloat OuterGainHF;
82 ALfloat AirAbsorptionFactor;
83 ALfloat RoomRolloffFactor;
84 ALfloat DopplerFactor;
86 ALint lOffset;
87 ALint lOffsetType;
89 // Source Type (Static, Streaming, or Undetermined)
90 ALint lSourceType;
92 // Current gains, which are ramped while mixed
93 ALfloat DryGains[OUTPUTCHANNELS];
94 ALfloat WetGains[MAX_SENDS];
95 ALboolean FirstStart;
97 // Current target parameters used for mixing
98 ALboolean NeedsUpdate;
99 struct {
100 ALfloat DryGains[OUTPUTCHANNELS];
101 ALfloat WetGains[MAX_SENDS];
102 ALfloat Pitch;
104 struct {
105 FILTER iirFilter;
106 ALfloat history[OUTPUTCHANNELS];
107 } Send[MAX_SENDS];
109 FILTER iirFilter;
110 ALfloat history[OUTPUTCHANNELS*2];
111 } Params;
113 // Index to itself
114 ALuint source;
116 struct ALsource *next;
117 } ALsource;
119 ALvoid ReleaseALSources(ALCcontext *Context);
121 #ifdef __cplusplus
123 #endif
125 #endif