2007-11-14 02:02:18 +00:00
|
|
|
#ifndef _AL_SOURCE_H_
|
|
|
|
#define _AL_SOURCE_H_
|
|
|
|
|
2009-04-15 05:18:47 +00:00
|
|
|
#define MAX_SENDS 2
|
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,
|
|
|
|
COSINE_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;
|
|
|
|
} 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;
|
|
|
|
|
2008-08-14 12:43:52 +00:00
|
|
|
// Current gains, which are ramped while mixed
|
|
|
|
ALfloat DryGains[OUTPUTCHANNELS];
|
2009-04-12 03:04:46 +00:00
|
|
|
ALfloat WetGains[MAX_SENDS];
|
2008-11-13 13:48:38 +00:00
|
|
|
ALboolean FirstStart;
|
2008-08-14 12:43:52 +00:00
|
|
|
|
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 {
|
|
|
|
ALfloat DryGains[OUTPUTCHANNELS];
|
|
|
|
ALfloat WetGains[MAX_SENDS];
|
|
|
|
ALfloat Pitch;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
FILTER iirFilter;
|
2009-11-26 08:39:32 +00:00
|
|
|
ALfloat history[OUTPUTCHANNELS];
|
2009-10-21 21:25:54 +00:00
|
|
|
} Send[MAX_SENDS];
|
|
|
|
|
|
|
|
FILTER iirFilter;
|
|
|
|
ALfloat history[OUTPUTCHANNELS*2];
|
|
|
|
} Params;
|
|
|
|
|
|
|
|
// Index to itself
|
|
|
|
ALuint source;
|
2007-11-14 02:02:18 +00:00
|
|
|
} ALsource;
|
|
|
|
|
2008-01-16 21:27:15 +00:00
|
|
|
ALvoid ReleaseALSources(ALCcontext *Context);
|
|
|
|
|
2007-11-14 02:02:18 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|