2007-11-14 02:02:18 +00:00
|
|
|
#ifndef _AL_SOURCE_H_
|
|
|
|
#define _AL_SOURCE_H_
|
|
|
|
|
2010-11-06 22:08:54 +00:00
|
|
|
#define MAX_SENDS 4
|
2007-12-19 02:13:49 +00:00
|
|
|
|
2007-12-18 00:28:16 +00:00
|
|
|
#include "alFilter.h"
|
2008-08-14 12:43:52 +00:00
|
|
|
#include "alu.h"
|
2007-11-14 02:02:18 +00:00
|
|
|
#include "AL/al.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2010-01-11 13:37:20 +00:00
|
|
|
typedef enum {
|
2010-01-12 07:47:03 +00:00
|
|
|
POINT_RESAMPLER = 0,
|
|
|
|
LINEAR_RESAMPLER,
|
2010-11-26 07:05:44 +00:00
|
|
|
CUBIC_RESAMPLER,
|
2010-01-11 13:37:20 +00:00
|
|
|
|
2010-01-11 15:02:29 +00:00
|
|
|
RESAMPLER_MAX,
|
|
|
|
RESAMPLER_MIN = -1,
|
2010-01-12 07:47:03 +00:00
|
|
|
RESAMPLER_DEFAULT = LINEAR_RESAMPLER
|
2010-01-11 13:37:20 +00:00
|
|
|
} resampler_t;
|
|
|
|
extern resampler_t DefaultResampler;
|
|
|
|
|
2007-11-14 02:02:18 +00:00
|
|
|
typedef struct ALbufferlistitem
|
|
|
|
{
|
2009-10-22 16:31:26 +00:00
|
|
|
struct ALbuffer *buffer;
|
2007-11-14 02:02:18 +00:00
|
|
|
struct ALbufferlistitem *next;
|
2010-11-26 02:30:57 +00:00
|
|
|
struct ALbufferlistitem *prev;
|
2007-11-14 02:02:18 +00:00
|
|
|
} ALbufferlistitem;
|
|
|
|
|
2007-12-31 09:09:21 +00:00
|
|
|
typedef struct ALsource
|
2007-11-14 02:02:18 +00:00
|
|
|
{
|
|
|
|
ALfloat flPitch;
|
|
|
|
ALfloat flGain;
|
|
|
|
ALfloat flOuterGain;
|
|
|
|
ALfloat flMinGain;
|
|
|
|
ALfloat flMaxGain;
|
|
|
|
ALfloat flInnerAngle;
|
|
|
|
ALfloat flOuterAngle;
|
|
|
|
ALfloat flRefDistance;
|
|
|
|
ALfloat flMaxDistance;
|
|
|
|
ALfloat flRollOffFactor;
|
|
|
|
ALfloat vPosition[3];
|
|
|
|
ALfloat vVelocity[3];
|
|
|
|
ALfloat vOrientation[3];
|
|
|
|
ALboolean bHeadRelative;
|
|
|
|
ALboolean bLooping;
|
2008-11-26 02:56:10 +00:00
|
|
|
ALenum DistanceModel;
|
2007-11-14 02:02:18 +00:00
|
|
|
|
2010-01-11 13:37:20 +00:00
|
|
|
resampler_t Resampler;
|
|
|
|
|
2007-11-14 02:02:18 +00:00
|
|
|
ALenum state;
|
|
|
|
ALuint position;
|
|
|
|
ALuint position_fraction;
|
2008-08-16 00:43:07 +00:00
|
|
|
|
2009-10-22 16:31:26 +00:00
|
|
|
struct ALbuffer *Buffer;
|
|
|
|
|
2007-11-14 02:02:18 +00:00
|
|
|
struct ALbufferlistitem *queue; // Linked list of buffers in queue
|
|
|
|
ALuint BuffersInQueue; // Number of buffers in queue
|
2009-07-08 04:01:41 +00:00
|
|
|
ALuint BuffersPlayed; // Number of buffers played on this loop
|
2007-11-14 02:02:18 +00:00
|
|
|
|
2007-12-18 00:28:16 +00:00
|
|
|
ALfilter DirectFilter;
|
|
|
|
|
2007-12-18 23:10:21 +00:00
|
|
|
struct {
|
2008-01-16 22:01:24 +00:00
|
|
|
struct ALeffectslot *Slot;
|
2007-12-18 23:10:21 +00:00
|
|
|
ALfilter WetFilter;
|
2007-12-19 02:13:49 +00:00
|
|
|
} Send[MAX_SENDS];
|
2007-12-18 23:10:21 +00:00
|
|
|
|
2007-12-18 05:33:05 +00:00
|
|
|
ALboolean DryGainHFAuto;
|
2007-12-19 03:13:41 +00:00
|
|
|
ALboolean WetGainAuto;
|
2007-12-19 00:54:22 +00:00
|
|
|
ALboolean WetGainHFAuto;
|
2007-12-18 05:56:31 +00:00
|
|
|
ALfloat OuterGainHF;
|
2007-12-18 05:33:05 +00:00
|
|
|
|
2007-12-18 21:37:07 +00:00
|
|
|
ALfloat AirAbsorptionFactor;
|
2007-12-19 03:03:40 +00:00
|
|
|
ALfloat RoomRolloffFactor;
|
2008-07-15 09:33:05 +00:00
|
|
|
ALfloat DopplerFactor;
|
|
|
|
|
2007-11-14 02:02:18 +00:00
|
|
|
ALint lOffset;
|
|
|
|
ALint lOffsetType;
|
|
|
|
|
|
|
|
// Source Type (Static, Streaming, or Undetermined)
|
|
|
|
ALint lSourceType;
|
|
|
|
|
2009-10-21 21:25:54 +00:00
|
|
|
// Current target parameters used for mixing
|
2009-11-26 00:21:47 +00:00
|
|
|
ALboolean NeedsUpdate;
|
2009-10-21 21:25:54 +00:00
|
|
|
struct {
|
2010-08-07 12:43:16 +00:00
|
|
|
ALint Step;
|
2009-10-21 21:25:54 +00:00
|
|
|
|
2010-11-24 18:01:50 +00:00
|
|
|
ALfloat DryGains[OUTPUTCHANNELS];
|
|
|
|
FILTER iirFilter;
|
|
|
|
ALfloat history[OUTPUTCHANNELS*2];
|
|
|
|
|
2009-10-21 21:25:54 +00:00
|
|
|
struct {
|
2010-11-24 18:01:50 +00:00
|
|
|
ALfloat WetGain;
|
2009-10-21 21:25:54 +00:00
|
|
|
FILTER iirFilter;
|
2009-11-26 08:39:32 +00:00
|
|
|
ALfloat history[OUTPUTCHANNELS];
|
2009-10-21 21:25:54 +00:00
|
|
|
} Send[MAX_SENDS];
|
|
|
|
} Params;
|
2010-09-26 08:15:27 +00:00
|
|
|
|
2010-08-04 06:10:00 +00:00
|
|
|
ALvoid (*Update)(struct ALsource *self, const ALCcontext *context);
|
2009-10-21 21:25:54 +00:00
|
|
|
|
|
|
|
// Index to itself
|
|
|
|
ALuint source;
|
2007-11-14 02:02:18 +00:00
|
|
|
} ALsource;
|
2010-09-26 19:23:22 +00:00
|
|
|
#define ALsource_Update(s,a) ((s)->Update(s,a))
|
2007-11-14 02:02:18 +00:00
|
|
|
|
2008-01-16 21:27:15 +00:00
|
|
|
ALvoid ReleaseALSources(ALCcontext *Context);
|
|
|
|
|
2007-11-14 02:02:18 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|