119 lines
2.6 KiB
C
Raw Normal View History

2007-11-13 18:02:18 -08:00
#ifndef _AL_SOURCE_H_
#define _AL_SOURCE_H_
#define MAX_SENDS 4
#include "alFilter.h"
#include "alu.h"
2007-11-13 18:02:18 -08:00
#include "AL/al.h"
#ifdef __cplusplus
extern "C" {
#endif
2010-01-11 05:37:20 -08:00
typedef enum {
2010-01-11 23:47:03 -08:00
POINT_RESAMPLER = 0,
LINEAR_RESAMPLER,
2010-11-25 23:05:44 -08:00
CUBIC_RESAMPLER,
2010-01-11 05:37:20 -08:00
RESAMPLER_MAX,
RESAMPLER_MIN = -1,
2010-01-11 23:47:03 -08:00
RESAMPLER_DEFAULT = LINEAR_RESAMPLER
2010-01-11 05:37:20 -08:00
} resampler_t;
extern resampler_t DefaultResampler;
extern const ALsizei ResamplerPadding[RESAMPLER_MAX];
extern const ALsizei ResamplerPrePadding[RESAMPLER_MAX];
2007-11-13 18:02:18 -08:00
typedef struct ALbufferlistitem
{
struct ALbuffer *buffer;
2007-11-13 18:02:18 -08:00
struct ALbufferlistitem *next;
struct ALbufferlistitem *prev;
2007-11-13 18:02:18 -08:00
} ALbufferlistitem;
typedef struct ALsource
2007-11-13 18:02:18 -08: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;
ALenum DistanceModel;
2007-11-13 18:02:18 -08:00
2010-01-11 05:37:20 -08:00
resampler_t Resampler;
2007-11-13 18:02:18 -08:00
ALenum state;
ALuint position;
ALuint position_fraction;
2008-08-15 17:43:07 -07:00
struct ALbuffer *Buffer;
2010-11-26 20:35:47 -08:00
ALbufferlistitem *queue; // Linked list of buffers in queue
ALuint BuffersInQueue; // Number of buffers in queue
ALuint BuffersPlayed; // Number of buffers played on this loop
2007-11-13 18:02:18 -08:00
ALfilter DirectFilter;
2007-12-18 15:10:21 -08:00
struct {
struct ALeffectslot *Slot;
2007-12-18 15:10:21 -08:00
ALfilter WetFilter;
} Send[MAX_SENDS];
2007-12-18 15:10:21 -08:00
ALboolean DryGainHFAuto;
ALboolean WetGainAuto;
ALboolean WetGainHFAuto;
ALfloat OuterGainHF;
ALfloat AirAbsorptionFactor;
ALfloat RoomRolloffFactor;
ALfloat DopplerFactor;
2007-11-13 18:02:18 -08:00
ALint lOffset;
ALint lOffsetType;
// Source Type (Static, Streaming, or Undetermined)
ALint lSourceType;
// Current target parameters used for mixing
ALboolean NeedsUpdate;
struct {
ALint Step;
2010-11-24 10:01:50 -08:00
ALfloat DryGains[OUTPUTCHANNELS];
FILTER iirFilter;
ALfloat history[OUTPUTCHANNELS*2];
struct {
2010-11-24 10:01:50 -08:00
ALfloat WetGain;
FILTER iirFilter;
ALfloat history[OUTPUTCHANNELS];
} Send[MAX_SENDS];
} Params;
ALvoid (*Update)(struct ALsource *self, const ALCcontext *context);
// Index to itself
ALuint source;
2007-11-13 18:02:18 -08:00
} ALsource;
#define ALsource_Update(s,a) ((s)->Update(s,a))
2007-11-13 18:02:18 -08:00
ALvoid ReleaseALSources(ALCcontext *Context);
2007-11-13 18:02:18 -08:00
#ifdef __cplusplus
}
#endif
#endif