Use "internal" visibility by default
[openal-soft.git] / OpenAL32 / Include / alSource.h
blob09ff330bee0c783e040920b9998bc0a5c1b431ea
1 #ifndef _AL_SOURCE_H_
2 #define _AL_SOURCE_H_
4 #define MAX_SENDS 4
6 #include "alFilter.h"
7 #include "alu.h"
8 #include "AL/al.h"
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
14 typedef enum {
15 POINT_RESAMPLER = 0,
16 LINEAR_RESAMPLER,
17 CUBIC_RESAMPLER,
19 RESAMPLER_MAX,
20 RESAMPLER_MIN = -1,
21 RESAMPLER_DEFAULT = LINEAR_RESAMPLER
22 } resampler_t;
23 extern resampler_t DefaultResampler;
25 extern const ALsizei ResamplerPadding[RESAMPLER_MAX];
26 extern const ALsizei ResamplerPrePadding[RESAMPLER_MAX];
29 typedef struct ALbufferlistitem
31 struct ALbuffer *buffer;
32 struct ALbufferlistitem *next;
33 struct ALbufferlistitem *prev;
34 } ALbufferlistitem;
36 typedef struct ALsource
38 ALfloat flPitch;
39 ALfloat flGain;
40 ALfloat flOuterGain;
41 ALfloat flMinGain;
42 ALfloat flMaxGain;
43 ALfloat flInnerAngle;
44 ALfloat flOuterAngle;
45 ALfloat flRefDistance;
46 ALfloat flMaxDistance;
47 ALfloat flRollOffFactor;
48 ALfloat vPosition[3];
49 ALfloat vVelocity[3];
50 ALfloat vOrientation[3];
51 ALboolean bHeadRelative;
52 ALboolean bLooping;
53 ALenum DistanceModel;
55 resampler_t Resampler;
57 ALenum state;
58 ALuint position;
59 ALuint position_fraction;
61 struct ALbuffer *Buffer;
63 ALbufferlistitem *queue; // Linked list of buffers in queue
64 ALuint BuffersInQueue; // Number of buffers in queue
65 ALuint BuffersPlayed; // Number of buffers played on this loop
67 ALfilter DirectFilter;
69 struct {
70 struct ALeffectslot *Slot;
71 ALfilter WetFilter;
72 } Send[MAX_SENDS];
74 ALboolean DryGainHFAuto;
75 ALboolean WetGainAuto;
76 ALboolean WetGainHFAuto;
77 ALfloat OuterGainHF;
79 ALfloat AirAbsorptionFactor;
80 ALfloat RoomRolloffFactor;
81 ALfloat DopplerFactor;
83 ALint lOffset;
84 ALint lOffsetType;
86 // Source Type (Static, Streaming, or Undetermined)
87 ALint lSourceType;
89 // Current target parameters used for mixing
90 ALboolean NeedsUpdate;
91 struct {
92 ALint Step;
94 ALfloat DryGains[MAXCHANNELS];
95 FILTER iirFilter;
96 ALfloat history[MAXCHANNELS*2];
98 struct {
99 ALfloat WetGain;
100 FILTER iirFilter;
101 ALfloat history[MAXCHANNELS];
102 } Send[MAX_SENDS];
103 } Params;
105 ALvoid (*Update)(struct ALsource *self, const ALCcontext *context);
107 // Index to itself
108 ALuint source;
109 } ALsource;
110 #define ALsource_Update(s,a) ((s)->Update(s,a))
112 ALvoid ReleaseALSources(ALCcontext *Context);
114 #ifdef __cplusplus
116 #endif
118 #endif