aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/Include
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r--OpenAL32/Include/alAuxEffectSlot.h185
-rw-r--r--OpenAL32/Include/alBuffer.h115
-rw-r--r--OpenAL32/Include/alEffect.h213
-rw-r--r--OpenAL32/Include/alError.h29
-rw-r--r--OpenAL32/Include/alFilter.h67
-rw-r--r--OpenAL32/Include/alListener.h67
-rw-r--r--OpenAL32/Include/alMain.h920
-rw-r--r--OpenAL32/Include/alSource.h120
-rw-r--r--OpenAL32/Include/alu.h534
-rw-r--r--OpenAL32/Include/bs2b.h94
-rw-r--r--OpenAL32/Include/sample_cvt.h15
11 files changed, 0 insertions, 2359 deletions
diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h
deleted file mode 100644
index 03ee97d6..00000000
--- a/OpenAL32/Include/alAuxEffectSlot.h
+++ /dev/null
@@ -1,185 +0,0 @@
-#ifndef _AL_AUXEFFECTSLOT_H_
-#define _AL_AUXEFFECTSLOT_H_
-
-#include "alMain.h"
-#include "alEffect.h"
-
-#include "atomic.h"
-#include "align.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct ALeffectStateVtable;
-struct ALeffectslot;
-
-typedef struct ALeffectState {
- RefCount Ref;
- const struct ALeffectStateVtable *vtbl;
-
- ALfloat (*OutBuffer)[BUFFERSIZE];
- ALsizei OutChannels;
-} ALeffectState;
-
-void ALeffectState_Construct(ALeffectState *state);
-void ALeffectState_Destruct(ALeffectState *state);
-
-struct ALeffectStateVtable {
- void (*const Destruct)(ALeffectState *state);
-
- ALboolean (*const deviceUpdate)(ALeffectState *state, ALCdevice *device);
- void (*const update)(ALeffectState *state, const ALCcontext *context, const struct ALeffectslot *slot, const union ALeffectProps *props);
- void (*const process)(ALeffectState *state, ALsizei samplesToDo, const ALfloat (*restrict samplesIn)[BUFFERSIZE], ALfloat (*restrict samplesOut)[BUFFERSIZE], ALsizei numChannels);
-
- void (*const Delete)(void *ptr);
-};
-
-/* Small hack to use a pointer-to-array types as a normal argument type.
- * Shouldn't be used directly.
- */
-typedef ALfloat ALfloatBUFFERSIZE[BUFFERSIZE];
-
-#define DEFINE_ALEFFECTSTATE_VTABLE(T) \
-DECLARE_THUNK(T, ALeffectState, void, Destruct) \
-DECLARE_THUNK1(T, ALeffectState, ALboolean, deviceUpdate, ALCdevice*) \
-DECLARE_THUNK3(T, ALeffectState, void, update, const ALCcontext*, const ALeffectslot*, const ALeffectProps*) \
-DECLARE_THUNK4(T, ALeffectState, void, process, ALsizei, const ALfloatBUFFERSIZE*restrict, ALfloatBUFFERSIZE*restrict, ALsizei) \
-static void T##_ALeffectState_Delete(void *ptr) \
-{ return T##_Delete(STATIC_UPCAST(T, ALeffectState, (ALeffectState*)ptr)); } \
- \
-static const struct ALeffectStateVtable T##_ALeffectState_vtable = { \
- T##_ALeffectState_Destruct, \
- \
- T##_ALeffectState_deviceUpdate, \
- T##_ALeffectState_update, \
- T##_ALeffectState_process, \
- \
- T##_ALeffectState_Delete, \
-}
-
-
-struct EffectStateFactoryVtable;
-
-typedef struct EffectStateFactory {
- const struct EffectStateFactoryVtable *vtab;
-} EffectStateFactory;
-
-struct EffectStateFactoryVtable {
- ALeffectState *(*const create)(EffectStateFactory *factory);
-};
-#define EffectStateFactory_create(x) ((x)->vtab->create((x)))
-
-#define DEFINE_EFFECTSTATEFACTORY_VTABLE(T) \
-DECLARE_THUNK(T, EffectStateFactory, ALeffectState*, create) \
- \
-static const struct EffectStateFactoryVtable T##_EffectStateFactory_vtable = { \
- T##_EffectStateFactory_create, \
-}
-
-
-#define MAX_EFFECT_CHANNELS (4)
-
-
-struct ALeffectslotArray {
- ALsizei count;
- struct ALeffectslot *slot[];
-};
-
-
-struct ALeffectslotProps {
- ALfloat Gain;
- ALboolean AuxSendAuto;
-
- ALenum Type;
- ALeffectProps Props;
-
- ALeffectState *State;
-
- ATOMIC(struct ALeffectslotProps*) next;
-};
-
-
-typedef struct ALeffectslot {
- ALfloat Gain;
- ALboolean AuxSendAuto;
-
- struct {
- ALenum Type;
- ALeffectProps Props;
-
- ALeffectState *State;
- } Effect;
-
- ATOMIC_FLAG PropsClean;
-
- RefCount ref;
-
- ATOMIC(struct ALeffectslotProps*) Update;
-
- struct {
- ALfloat Gain;
- ALboolean AuxSendAuto;
-
- ALenum EffectType;
- ALeffectProps EffectProps;
- ALeffectState *EffectState;
-
- ALfloat RoomRolloff; /* Added to the source's room rolloff, not multiplied. */
- ALfloat DecayTime;
- ALfloat DecayLFRatio;
- ALfloat DecayHFRatio;
- ALboolean DecayHFLimit;
- ALfloat AirAbsorptionGainHF;
- } Params;
-
- /* Self ID */
- ALuint id;
-
- ALsizei NumChannels;
- BFChannelConfig ChanMap[MAX_EFFECT_CHANNELS];
- /* Wet buffer configuration is ACN channel order with N3D scaling:
- * * Channel 0 is the unattenuated mono signal.
- * * Channel 1 is OpenAL -X * sqrt(3)
- * * Channel 2 is OpenAL Y * sqrt(3)
- * * Channel 3 is OpenAL -Z * sqrt(3)
- * Consequently, effects that only want to work with mono input can use
- * channel 0 by itself. Effects that want multichannel can process the
- * ambisonics signal and make a B-Format source pan for first-order device
- * output (FOAOut).
- */
- alignas(16) ALfloat WetBuffer[MAX_EFFECT_CHANNELS][BUFFERSIZE];
-} ALeffectslot;
-
-ALenum InitEffectSlot(ALeffectslot *slot);
-void DeinitEffectSlot(ALeffectslot *slot);
-void UpdateEffectSlotProps(ALeffectslot *slot, ALCcontext *context);
-void UpdateAllEffectSlotProps(ALCcontext *context);
-ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *Context);
-
-
-EffectStateFactory *NullStateFactory_getFactory(void);
-EffectStateFactory *ReverbStateFactory_getFactory(void);
-EffectStateFactory *AutowahStateFactory_getFactory(void);
-EffectStateFactory *ChorusStateFactory_getFactory(void);
-EffectStateFactory *CompressorStateFactory_getFactory(void);
-EffectStateFactory *DistortionStateFactory_getFactory(void);
-EffectStateFactory *EchoStateFactory_getFactory(void);
-EffectStateFactory *EqualizerStateFactory_getFactory(void);
-EffectStateFactory *FlangerStateFactory_getFactory(void);
-EffectStateFactory *FshifterStateFactory_getFactory(void);
-EffectStateFactory *ModulatorStateFactory_getFactory(void);
-EffectStateFactory *PshifterStateFactory_getFactory(void);
-
-EffectStateFactory *DedicatedStateFactory_getFactory(void);
-
-
-ALenum InitializeEffect(ALCcontext *Context, ALeffectslot *EffectSlot, ALeffect *effect);
-
-void ALeffectState_DecRef(ALeffectState *state);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/OpenAL32/Include/alBuffer.h b/OpenAL32/Include/alBuffer.h
deleted file mode 100644
index fbe3e6e5..00000000
--- a/OpenAL32/Include/alBuffer.h
+++ /dev/null
@@ -1,115 +0,0 @@
-#ifndef _AL_BUFFER_H_
-#define _AL_BUFFER_H_
-
-#include "AL/alc.h"
-#include "AL/al.h"
-#include "AL/alext.h"
-
-#include "inprogext.h"
-#include "atomic.h"
-#include "rwlock.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* User formats */
-enum UserFmtType {
- UserFmtUByte,
- UserFmtShort,
- UserFmtFloat,
- UserFmtDouble,
- UserFmtMulaw,
- UserFmtAlaw,
- UserFmtIMA4,
- UserFmtMSADPCM,
-};
-enum UserFmtChannels {
- UserFmtMono,
- UserFmtStereo,
- UserFmtRear,
- UserFmtQuad,
- UserFmtX51, /* (WFX order) */
- UserFmtX61, /* (WFX order) */
- UserFmtX71, /* (WFX order) */
- UserFmtBFormat2D, /* WXY */
- UserFmtBFormat3D, /* WXYZ */
-};
-
-ALsizei BytesFromUserFmt(enum UserFmtType type);
-ALsizei ChannelsFromUserFmt(enum UserFmtChannels chans);
-inline ALsizei FrameSizeFromUserFmt(enum UserFmtChannels chans, enum UserFmtType type)
-{
- return ChannelsFromUserFmt(chans) * BytesFromUserFmt(type);
-}
-
-
-/* Storable formats */
-enum FmtType {
- FmtUByte = UserFmtUByte,
- FmtShort = UserFmtShort,
- FmtFloat = UserFmtFloat,
- FmtDouble = UserFmtDouble,
- FmtMulaw = UserFmtMulaw,
- FmtAlaw = UserFmtAlaw,
-};
-enum FmtChannels {
- FmtMono = UserFmtMono,
- FmtStereo = UserFmtStereo,
- FmtRear = UserFmtRear,
- FmtQuad = UserFmtQuad,
- FmtX51 = UserFmtX51,
- FmtX61 = UserFmtX61,
- FmtX71 = UserFmtX71,
- FmtBFormat2D = UserFmtBFormat2D,
- FmtBFormat3D = UserFmtBFormat3D,
-};
-#define MAX_INPUT_CHANNELS (8)
-
-ALsizei BytesFromFmt(enum FmtType type);
-ALsizei ChannelsFromFmt(enum FmtChannels chans);
-inline ALsizei FrameSizeFromFmt(enum FmtChannels chans, enum FmtType type)
-{
- return ChannelsFromFmt(chans) * BytesFromFmt(type);
-}
-
-
-typedef struct ALbuffer {
- ALvoid *data;
-
- ALsizei Frequency;
- ALbitfieldSOFT Access;
- ALsizei SampleLen;
-
- enum FmtChannels FmtChannels;
- enum FmtType FmtType;
- ALsizei BytesAlloc;
-
- enum UserFmtType OriginalType;
- ALsizei OriginalSize;
- ALsizei OriginalAlign;
-
- ALsizei LoopStart;
- ALsizei LoopEnd;
-
- ATOMIC(ALsizei) UnpackAlign;
- ATOMIC(ALsizei) PackAlign;
-
- ALbitfieldSOFT MappedAccess;
- ALsizei MappedOffset;
- ALsizei MappedSize;
-
- /* Number of times buffer was attached to a source (deletion can only occur when 0) */
- RefCount ref;
-
- /* Self ID */
- ALuint id;
-} ALbuffer;
-
-ALvoid ReleaseALBuffers(ALCdevice *device);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/OpenAL32/Include/alEffect.h b/OpenAL32/Include/alEffect.h
deleted file mode 100644
index 7b849c0c..00000000
--- a/OpenAL32/Include/alEffect.h
+++ /dev/null
@@ -1,213 +0,0 @@
-#ifndef _AL_EFFECT_H_
-#define _AL_EFFECT_H_
-
-#include "alMain.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct ALeffect;
-
-enum {
- EAXREVERB_EFFECT = 0,
- REVERB_EFFECT,
- AUTOWAH_EFFECT,
- CHORUS_EFFECT,
- COMPRESSOR_EFFECT,
- DISTORTION_EFFECT,
- ECHO_EFFECT,
- EQUALIZER_EFFECT,
- FLANGER_EFFECT,
- FSHIFTER_EFFECT,
- MODULATOR_EFFECT,
- PSHIFTER_EFFECT,
- DEDICATED_EFFECT,
-
- MAX_EFFECTS
-};
-extern ALboolean DisabledEffects[MAX_EFFECTS];
-
-extern ALfloat ReverbBoost;
-
-struct EffectList {
- const char name[16];
- int type;
- ALenum val;
-};
-#define EFFECTLIST_SIZE 14
-extern const struct EffectList EffectList[EFFECTLIST_SIZE];
-
-
-struct ALeffectVtable {
- void (*const setParami)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALint val);
- void (*const setParamiv)(struct ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals);
- void (*const setParamf)(struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val);
- void (*const setParamfv)(struct ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals);
-
- void (*const getParami)(const struct ALeffect *effect, ALCcontext *context, ALenum param, ALint *val);
- void (*const getParamiv)(const struct ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals);
- void (*const getParamf)(const struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val);
- void (*const getParamfv)(const struct ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals);
-};
-
-#define DEFINE_ALEFFECT_VTABLE(T) \
-const struct ALeffectVtable T##_vtable = { \
- T##_setParami, T##_setParamiv, \
- T##_setParamf, T##_setParamfv, \
- T##_getParami, T##_getParamiv, \
- T##_getParamf, T##_getParamfv, \
-}
-
-extern const struct ALeffectVtable ALeaxreverb_vtable;
-extern const struct ALeffectVtable ALreverb_vtable;
-extern const struct ALeffectVtable ALautowah_vtable;
-extern const struct ALeffectVtable ALchorus_vtable;
-extern const struct ALeffectVtable ALcompressor_vtable;
-extern const struct ALeffectVtable ALdistortion_vtable;
-extern const struct ALeffectVtable ALecho_vtable;
-extern const struct ALeffectVtable ALequalizer_vtable;
-extern const struct ALeffectVtable ALflanger_vtable;
-extern const struct ALeffectVtable ALfshifter_vtable;
-extern const struct ALeffectVtable ALmodulator_vtable;
-extern const struct ALeffectVtable ALnull_vtable;
-extern const struct ALeffectVtable ALpshifter_vtable;
-extern const struct ALeffectVtable ALdedicated_vtable;
-
-
-typedef union ALeffectProps {
- struct {
- // Shared Reverb Properties
- ALfloat Density;
- ALfloat Diffusion;
- ALfloat Gain;
- ALfloat GainHF;
- ALfloat DecayTime;
- ALfloat DecayHFRatio;
- ALfloat ReflectionsGain;
- ALfloat ReflectionsDelay;
- ALfloat LateReverbGain;
- ALfloat LateReverbDelay;
- ALfloat AirAbsorptionGainHF;
- ALfloat RoomRolloffFactor;
- ALboolean DecayHFLimit;
-
- // Additional EAX Reverb Properties
- ALfloat GainLF;
- ALfloat DecayLFRatio;
- ALfloat ReflectionsPan[3];
- ALfloat LateReverbPan[3];
- ALfloat EchoTime;
- ALfloat EchoDepth;
- ALfloat ModulationTime;
- ALfloat ModulationDepth;
- ALfloat HFReference;
- ALfloat LFReference;
- } Reverb;
-
- struct {
- ALfloat AttackTime;
- ALfloat ReleaseTime;
- ALfloat Resonance;
- ALfloat PeakGain;
- } Autowah;
-
- struct {
- ALint Waveform;
- ALint Phase;
- ALfloat Rate;
- ALfloat Depth;
- ALfloat Feedback;
- ALfloat Delay;
- } Chorus; /* Also Flanger */
-
- struct {
- ALboolean OnOff;
- } Compressor;
-
- struct {
- ALfloat Edge;
- ALfloat Gain;
- ALfloat LowpassCutoff;
- ALfloat EQCenter;
- ALfloat EQBandwidth;
- } Distortion;
-
- struct {
- ALfloat Delay;
- ALfloat LRDelay;
-
- ALfloat Damping;
- ALfloat Feedback;
-
- ALfloat Spread;
- } Echo;
-
- struct {
- ALfloat LowCutoff;
- ALfloat LowGain;
- ALfloat Mid1Center;
- ALfloat Mid1Gain;
- ALfloat Mid1Width;
- ALfloat Mid2Center;
- ALfloat Mid2Gain;
- ALfloat Mid2Width;
- ALfloat HighCutoff;
- ALfloat HighGain;
- } Equalizer;
-
- struct {
- ALfloat Frequency;
- ALint LeftDirection;
- ALint RightDirection;
- } Fshifter;
-
- struct {
- ALfloat Frequency;
- ALfloat HighPassCutoff;
- ALint Waveform;
- } Modulator;
-
- struct {
- ALint CoarseTune;
- ALint FineTune;
- } Pshifter;
-
- struct {
- ALfloat Gain;
- } Dedicated;
-} ALeffectProps;
-
-typedef struct ALeffect {
- // Effect type (AL_EFFECT_NULL, ...)
- ALenum type;
-
- ALeffectProps Props;
-
- const struct ALeffectVtable *vtab;
-
- /* Self ID */
- ALuint id;
-} ALeffect;
-#define ALeffect_setParami(o, c, p, v) ((o)->vtab->setParami(o, c, p, v))
-#define ALeffect_setParamf(o, c, p, v) ((o)->vtab->setParamf(o, c, p, v))
-#define ALeffect_setParamiv(o, c, p, v) ((o)->vtab->setParamiv(o, c, p, v))
-#define ALeffect_setParamfv(o, c, p, v) ((o)->vtab->setParamfv(o, c, p, v))
-#define ALeffect_getParami(o, c, p, v) ((o)->vtab->getParami(o, c, p, v))
-#define ALeffect_getParamf(o, c, p, v) ((o)->vtab->getParamf(o, c, p, v))
-#define ALeffect_getParamiv(o, c, p, v) ((o)->vtab->getParamiv(o, c, p, v))
-#define ALeffect_getParamfv(o, c, p, v) ((o)->vtab->getParamfv(o, c, p, v))
-
-inline ALboolean IsReverbEffect(ALenum type)
-{ return type == AL_EFFECT_REVERB || type == AL_EFFECT_EAXREVERB; }
-
-void InitEffect(ALeffect *effect);
-void ReleaseALEffects(ALCdevice *device);
-
-void LoadReverbPreset(const char *name, ALeffect *effect);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/OpenAL32/Include/alError.h b/OpenAL32/Include/alError.h
deleted file mode 100644
index 858f81de..00000000
--- a/OpenAL32/Include/alError.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef _AL_ERROR_H_
-#define _AL_ERROR_H_
-
-#include "alMain.h"
-#include "logging.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern ALboolean TrapALError;
-
-void alSetError(ALCcontext *context, ALenum errorCode, const char *msg, ...) DECL_FORMAT(printf, 3, 4);
-
-#define SETERR_GOTO(ctx, err, lbl, ...) do { \
- alSetError((ctx), (err), __VA_ARGS__); \
- goto lbl; \
-} while(0)
-
-#define SETERR_RETURN(ctx, err, retval, ...) do { \
- alSetError((ctx), (err), __VA_ARGS__); \
- return retval; \
-} while(0)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/OpenAL32/Include/alFilter.h b/OpenAL32/Include/alFilter.h
deleted file mode 100644
index 2634d5e8..00000000
--- a/OpenAL32/Include/alFilter.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef _AL_FILTER_H_
-#define _AL_FILTER_H_
-
-#include "AL/alc.h"
-#include "AL/al.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define LOWPASSFREQREF (5000.0f)
-#define HIGHPASSFREQREF (250.0f)
-
-
-struct ALfilter;
-
-typedef struct ALfilterVtable {
- void (*const setParami)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALint val);
- void (*const setParamiv)(struct ALfilter *filter, ALCcontext *context, ALenum param, const ALint *vals);
- void (*const setParamf)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALfloat val);
- void (*const setParamfv)(struct ALfilter *filter, ALCcontext *context, ALenum param, const ALfloat *vals);
-
- void (*const getParami)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALint *val);
- void (*const getParamiv)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALint *vals);
- void (*const getParamf)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *val);
- void (*const getParamfv)(struct ALfilter *filter, ALCcontext *context, ALenum param, ALfloat *vals);
-} ALfilterVtable;
-
-#define DEFINE_ALFILTER_VTABLE(T) \
-const struct ALfilterVtable T##_vtable = { \
- T##_setParami, T##_setParamiv, \
- T##_setParamf, T##_setParamfv, \
- T##_getParami, T##_getParamiv, \
- T##_getParamf, T##_getParamfv, \
-}
-
-typedef struct ALfilter {
- // Filter type (AL_FILTER_NULL, ...)
- ALenum type;
-
- ALfloat Gain;
- ALfloat GainHF;
- ALfloat HFReference;
- ALfloat GainLF;
- ALfloat LFReference;
-
- const struct ALfilterVtable *vtab;
-
- /* Self ID */
- ALuint id;
-} ALfilter;
-#define ALfilter_setParami(o, c, p, v) ((o)->vtab->setParami(o, c, p, v))
-#define ALfilter_setParamf(o, c, p, v) ((o)->vtab->setParamf(o, c, p, v))
-#define ALfilter_setParamiv(o, c, p, v) ((o)->vtab->setParamiv(o, c, p, v))
-#define ALfilter_setParamfv(o, c, p, v) ((o)->vtab->setParamfv(o, c, p, v))
-#define ALfilter_getParami(o, c, p, v) ((o)->vtab->getParami(o, c, p, v))
-#define ALfilter_getParamf(o, c, p, v) ((o)->vtab->getParamf(o, c, p, v))
-#define ALfilter_getParamiv(o, c, p, v) ((o)->vtab->getParamiv(o, c, p, v))
-#define ALfilter_getParamfv(o, c, p, v) ((o)->vtab->getParamfv(o, c, p, v))
-
-void ReleaseALFilters(ALCdevice *device);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/OpenAL32/Include/alListener.h b/OpenAL32/Include/alListener.h
deleted file mode 100644
index 0d80a8d7..00000000
--- a/OpenAL32/Include/alListener.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef _AL_LISTENER_H_
-#define _AL_LISTENER_H_
-
-#include "alMain.h"
-#include "alu.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct ALcontextProps {
- ALfloat DopplerFactor;
- ALfloat DopplerVelocity;
- ALfloat SpeedOfSound;
- ALboolean SourceDistanceModel;
- enum DistanceModel DistanceModel;
- ALfloat MetersPerUnit;
-
- ATOMIC(struct ALcontextProps*) next;
-};
-
-struct ALlistenerProps {
- ALfloat Position[3];
- ALfloat Velocity[3];
- ALfloat Forward[3];
- ALfloat Up[3];
- ALfloat Gain;
-
- ATOMIC(struct ALlistenerProps*) next;
-};
-
-typedef struct ALlistener {
- alignas(16) ALfloat Position[3];
- ALfloat Velocity[3];
- ALfloat Forward[3];
- ALfloat Up[3];
- ALfloat Gain;
-
- ATOMIC_FLAG PropsClean;
-
- /* Pointer to the most recent property values that are awaiting an update.
- */
- ATOMIC(struct ALlistenerProps*) Update;
-
- struct {
- aluMatrixf Matrix;
- aluVector Velocity;
-
- ALfloat Gain;
- ALfloat MetersPerUnit;
-
- ALfloat DopplerFactor;
- ALfloat SpeedOfSound; /* in units per sec! */
- ALfloat ReverbSpeedOfSound; /* in meters per sec! */
-
- ALboolean SourceDistanceModel;
- enum DistanceModel DistanceModel;
- } Params;
-} ALlistener;
-
-void UpdateListenerProps(ALCcontext *context);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
deleted file mode 100644
index 0fd77491..00000000
--- a/OpenAL32/Include/alMain.h
+++ /dev/null
@@ -1,920 +0,0 @@
-#ifndef AL_MAIN_H
-#define AL_MAIN_H
-
-#include <string.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <math.h>
-#include <limits.h>
-
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#ifdef HAVE_INTRIN_H
-#include <intrin.h>
-#endif
-
-#include "AL/al.h"
-#include "AL/alc.h"
-#include "AL/alext.h"
-
-#include "inprogext.h"
-#include "logging.h"
-#include "polymorphism.h"
-#include "static_assert.h"
-#include "align.h"
-#include "atomic.h"
-#include "vector.h"
-#include "alstring.h"
-#include "almalloc.h"
-#include "threads.h"
-
-
-#if defined(_WIN64)
-#define SZFMT "%I64u"
-#elif defined(_WIN32)
-#define SZFMT "%u"
-#else
-#define SZFMT "%zu"
-#endif
-
-#ifdef __has_builtin
-#define HAS_BUILTIN __has_builtin
-#else
-#define HAS_BUILTIN(x) (0)
-#endif
-
-#ifdef __GNUC__
-/* LIKELY optimizes the case where the condition is true. The condition is not
- * required to be true, but it can result in more optimal code for the true
- * path at the expense of a less optimal false path.
- */
-#define LIKELY(x) __builtin_expect(!!(x), !0)
-/* The opposite of LIKELY, optimizing the case where the condition is false. */
-#define UNLIKELY(x) __builtin_expect(!!(x), 0)
-/* Unlike LIKELY, ASSUME requires the condition to be true or else it invokes
- * undefined behavior. It's essentially an assert without actually checking the
- * condition at run-time, allowing for stronger optimizations than LIKELY.
- */
-#if HAS_BUILTIN(__builtin_assume)
-#define ASSUME __builtin_assume
-#else
-#define ASSUME(x) do { if(!(x)) __builtin_unreachable(); } while(0)
-#endif
-
-#else
-
-#define LIKELY(x) (!!(x))
-#define UNLIKELY(x) (!!(x))
-#ifdef _MSC_VER
-#define ASSUME __assume
-#else
-#define ASSUME(x) ((void)0)
-#endif
-#endif
-
-#ifndef UINT64_MAX
-#define UINT64_MAX U64(18446744073709551615)
-#endif
-
-#ifndef UNUSED
-#if defined(__cplusplus)
-#define UNUSED(x)
-#elif defined(__GNUC__)
-#define UNUSED(x) UNUSED_##x __attribute__((unused))
-#elif defined(__LCLINT__)
-#define UNUSED(x) /*@unused@*/ x
-#else
-#define UNUSED(x) x
-#endif
-#endif
-
-/* Calculates the size of a struct with N elements of a flexible array member.
- * GCC and Clang allow offsetof(Type, fam[N]) for this, but MSVC seems to have
- * trouble, so a bit more verbose workaround is needed.
- */
-#define FAM_SIZE(T, M, N) (offsetof(T, M) + sizeof(((T*)NULL)->M[0])*(N))
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef ALint64SOFT ALint64;
-typedef ALuint64SOFT ALuint64;
-
-#ifndef U64
-#if defined(_MSC_VER)
-#define U64(x) ((ALuint64)(x##ui64))
-#elif SIZEOF_LONG == 8
-#define U64(x) ((ALuint64)(x##ul))
-#elif SIZEOF_LONG_LONG == 8
-#define U64(x) ((ALuint64)(x##ull))
-#endif
-#endif
-
-#ifndef I64
-#if defined(_MSC_VER)
-#define I64(x) ((ALint64)(x##i64))
-#elif SIZEOF_LONG == 8
-#define I64(x) ((ALint64)(x##l))
-#elif SIZEOF_LONG_LONG == 8
-#define I64(x) ((ALint64)(x##ll))
-#endif
-#endif
-
-/* Define a CTZ64 macro (count trailing zeros, for 64-bit integers). The result
- * is *UNDEFINED* if the value is 0.
- */
-#ifdef __GNUC__
-
-#if SIZEOF_LONG == 8
-#define CTZ64 __builtin_ctzl
-#else
-#define CTZ64 __builtin_ctzll
-#endif
-
-#elif defined(HAVE_BITSCANFORWARD64_INTRINSIC)
-
-inline int msvc64_ctz64(ALuint64 v)
-{
- unsigned long idx = 64;
- _BitScanForward64(&idx, v);
- return (int)idx;
-}
-#define CTZ64 msvc64_ctz64
-
-#elif defined(HAVE_BITSCANFORWARD_INTRINSIC)
-
-inline int msvc_ctz64(ALuint64 v)
-{
- unsigned long idx = 64;
- if(!_BitScanForward(&idx, v&0xffffffff))
- {
- if(_BitScanForward(&idx, v>>32))
- idx += 32;
- }
- return (int)idx;
-}
-#define CTZ64 msvc_ctz64
-
-#else
-
-/* There be black magics here. The popcnt64 method is derived from
- * https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel
- * while the ctz-utilizing-popcnt algorithm is shown here
- * http://www.hackersdelight.org/hdcodetxt/ntz.c.txt
- * as the ntz2 variant. These likely aren't the most efficient methods, but
- * they're good enough if the GCC or MSVC intrinsics aren't available.
- */
-inline int fallback_popcnt64(ALuint64 v)
-{
- v = v - ((v >> 1) & U64(0x5555555555555555));
- v = (v & U64(0x3333333333333333)) + ((v >> 2) & U64(0x3333333333333333));
- v = (v + (v >> 4)) & U64(0x0f0f0f0f0f0f0f0f);
- return (int)((v * U64(0x0101010101010101)) >> 56);
-}
-
-inline int fallback_ctz64(ALuint64 value)
-{
- return fallback_popcnt64(~value & (value - 1));
-}
-#define CTZ64 fallback_ctz64
-#endif
-
-#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__)
-#define IS_LITTLE_ENDIAN (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
-#else
-static const union {
- ALuint u;
- ALubyte b[sizeof(ALuint)];
-} EndianTest = { 1 };
-#define IS_LITTLE_ENDIAN (EndianTest.b[0] == 1)
-#endif
-
-#define COUNTOF(x) (sizeof(x) / sizeof(0[x]))
-
-
-struct ll_ringbuffer;
-struct Hrtf;
-struct HrtfEntry;
-struct DirectHrtfState;
-struct FrontStablizer;
-struct Compressor;
-struct ALCbackend;
-struct ALbuffer;
-struct ALeffect;
-struct ALfilter;
-struct ALsource;
-struct ALcontextProps;
-struct ALlistenerProps;
-struct ALvoiceProps;
-struct ALeffectslotProps;
-
-
-#define DEFAULT_OUTPUT_RATE (44100)
-#define MIN_OUTPUT_RATE (8000)
-
-
-/* Find the next power-of-2 for non-power-of-2 numbers. */
-inline ALuint NextPowerOf2(ALuint value)
-{
- if(value > 0)
- {
- value--;
- value |= value>>1;
- value |= value>>2;
- value |= value>>4;
- value |= value>>8;
- value |= value>>16;
- }
- return value+1;
-}
-
-/** Round up a value to the next multiple. */
-inline size_t RoundUp(size_t value, size_t r)
-{
- value += r-1;
- return value - (value%r);
-}
-
-/* Fast float-to-int conversion. No particular rounding mode is assumed; the
- * IEEE-754 default is round-to-nearest with ties-to-even, though an app could
- * change it on its own threads. On some systems, a truncating conversion may
- * always be the fastest method.
- */
-inline ALint fastf2i(ALfloat f)
-{
-#if defined(HAVE_INTRIN_H) && ((defined(_M_IX86_FP) && (_M_IX86_FP > 0)) || defined(_M_X64))
- return _mm_cvt_ss2si(_mm_set1_ps(f));
-
-#elif defined(_MSC_VER) && defined(_M_IX86_FP)
-
- ALint i;
- __asm fld f
- __asm fistp i
- return i;
-
-#elif (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))
-
- ALint i;
-#ifdef __SSE_MATH__
- __asm__("cvtss2si %1, %0" : "=r"(i) : "x"(f));
-#else
- __asm__ __volatile__("fistpl %0" : "=m"(i) : "t"(f) : "st");
-#endif
- return i;
-
- /* On GCC when compiling with -fno-math-errno, lrintf can be inlined to
- * some simple instructions. Clang does not inline it, always generating a
- * libc call, while MSVC's implementation is horribly slow, so always fall
- * back to a normal integer conversion for them.
- */
-#elif defined(HAVE_LRINTF) && !defined(_MSC_VER) && !defined(__clang__)
-
- return lrintf(f);
-
-#else
-
- return (ALint)f;
-#endif
-}
-
-/* Converts float-to-int using standard behavior (truncation). */
-inline int float2int(float f)
-{
-#if ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) && \
- !defined(__SSE_MATH__)) || (defined(_MSC_VER) && defined(_M_IX86_FP) && _M_IX86_FP == 0)
- ALint sign, shift, mant;
- union {
- ALfloat f;
- ALint i;
- } conv;
-
- conv.f = f;
- sign = (conv.i>>31) | 1;
- shift = ((conv.i>>23)&0xff) - (127+23);
-
- /* Over/underflow */
- if(UNLIKELY(shift >= 31 || shift < -23))
- return 0;
-
- mant = (conv.i&0x7fffff) | 0x800000;
- if(LIKELY(shift < 0))
- return (mant >> -shift) * sign;
- return (mant << shift) * sign;
-
-#else
-
- return (ALint)f;
-#endif
-}
-
-/* Rounds a float to the nearest integral value, according to the current
- * rounding mode. This is essentially an inlined version of rintf, although
- * makes fewer promises (e.g. -0 or -0.25 rounded to 0 may result in +0).
- */
-inline float fast_roundf(float f)
-{
-#if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) && \
- !defined(__SSE_MATH__)
-
- float out;
- __asm__ __volatile__("frndint" : "=t"(out) : "0"(f));
- return out;
-
-#else
-
- /* Integral limit, where sub-integral precision is not available for
- * floats.
- */
- static const float ilim[2] = {
- 8388608.0f /* 0x1.0p+23 */,
- -8388608.0f /* -0x1.0p+23 */
- };
- ALuint sign, expo;
- union {
- ALfloat f;
- ALuint i;
- } conv;
-
- conv.f = f;
- sign = (conv.i>>31)&0x01;
- expo = (conv.i>>23)&0xff;
-
- if(UNLIKELY(expo >= 150/*+23*/))
- {
- /* An exponent (base-2) of 23 or higher is incapable of sub-integral
- * precision, so it's already an integral value. We don't need to worry
- * about infinity or NaN here.
- */
- return f;
- }
- /* Adding the integral limit to the value (with a matching sign) forces a
- * result that has no sub-integral precision, and is consequently forced to
- * round to an integral value. Removing the integral limit then restores
- * the initial value rounded to the integral. The compiler should not
- * optimize this out because of non-associative rules on floating-point
- * math (as long as you don't use -fassociative-math,
- * -funsafe-math-optimizations, -ffast-math, or -Ofast, in which case this
- * may break).
- */
- f += ilim[sign];
- return f - ilim[sign];
-#endif
-}
-
-
-enum DevProbe {
- ALL_DEVICE_PROBE,
- CAPTURE_DEVICE_PROBE
-};
-
-
-enum DistanceModel {
- InverseDistanceClamped = AL_INVERSE_DISTANCE_CLAMPED,
- LinearDistanceClamped = AL_LINEAR_DISTANCE_CLAMPED,
- ExponentDistanceClamped = AL_EXPONENT_DISTANCE_CLAMPED,
- InverseDistance = AL_INVERSE_DISTANCE,
- LinearDistance = AL_LINEAR_DISTANCE,
- ExponentDistance = AL_EXPONENT_DISTANCE,
- DisableDistance = AL_NONE,
-
- DefaultDistanceModel = InverseDistanceClamped
-};
-
-enum Channel {
- FrontLeft = 0,
- FrontRight,
- FrontCenter,
- LFE,
- BackLeft,
- BackRight,
- BackCenter,
- SideLeft,
- SideRight,
-
- UpperFrontLeft,
- UpperFrontRight,
- UpperBackLeft,
- UpperBackRight,
- LowerFrontLeft,
- LowerFrontRight,
- LowerBackLeft,
- LowerBackRight,
-
- Aux0,
- Aux1,
- Aux2,
- Aux3,
- Aux4,
- Aux5,
- Aux6,
- Aux7,
- Aux8,
- Aux9,
- Aux10,
- Aux11,
- Aux12,
- Aux13,
- Aux14,
- Aux15,
-
- InvalidChannel
-};
-
-
-/* Device formats */
-enum DevFmtType {
- DevFmtByte = ALC_BYTE_SOFT,
- DevFmtUByte = ALC_UNSIGNED_BYTE_SOFT,
- DevFmtShort = ALC_SHORT_SOFT,
- DevFmtUShort = ALC_UNSIGNED_SHORT_SOFT,
- DevFmtInt = ALC_INT_SOFT,
- DevFmtUInt = ALC_UNSIGNED_INT_SOFT,
- DevFmtFloat = ALC_FLOAT_SOFT,
-
- DevFmtTypeDefault = DevFmtFloat
-};
-enum DevFmtChannels {
- DevFmtMono = ALC_MONO_SOFT,
- DevFmtStereo = ALC_STEREO_SOFT,
- DevFmtQuad = ALC_QUAD_SOFT,
- DevFmtX51 = ALC_5POINT1_SOFT,
- DevFmtX61 = ALC_6POINT1_SOFT,
- DevFmtX71 = ALC_7POINT1_SOFT,
- DevFmtAmbi3D = ALC_BFORMAT3D_SOFT,
-
- /* Similar to 5.1, except using rear channels instead of sides */
- DevFmtX51Rear = 0x80000000,
-
- DevFmtChannelsDefault = DevFmtStereo
-};
-#define MAX_OUTPUT_CHANNELS (16)
-
-ALsizei BytesFromDevFmt(enum DevFmtType type);
-ALsizei ChannelsFromDevFmt(enum DevFmtChannels chans, ALsizei ambiorder);
-inline ALsizei FrameSizeFromDevFmt(enum DevFmtChannels chans, enum DevFmtType type, ALsizei ambiorder)
-{
- return ChannelsFromDevFmt(chans, ambiorder) * BytesFromDevFmt(type);
-}
-
-enum AmbiLayout {
- AmbiLayout_FuMa = ALC_FUMA_SOFT, /* FuMa channel order */
- AmbiLayout_ACN = ALC_ACN_SOFT, /* ACN channel order */
-
- AmbiLayout_Default = AmbiLayout_ACN
-};
-
-enum AmbiNorm {
- AmbiNorm_FuMa = ALC_FUMA_SOFT, /* FuMa normalization */
- AmbiNorm_SN3D = ALC_SN3D_SOFT, /* SN3D normalization */
- AmbiNorm_N3D = ALC_N3D_SOFT, /* N3D normalization */
-
- AmbiNorm_Default = AmbiNorm_SN3D
-};
-
-
-enum DeviceType {
- Playback,
- Capture,
- Loopback
-};
-
-
-enum RenderMode {
- NormalRender,
- StereoPair,
- HrtfRender
-};
-
-
-/* The maximum number of Ambisonics coefficients. For a given order (o), the
- * size needed will be (o+1)**2, thus zero-order has 1, first-order has 4,
- * second-order has 9, third-order has 16, and fourth-order has 25.
- */
-#define MAX_AMBI_ORDER 3
-#define MAX_AMBI_COEFFS ((MAX_AMBI_ORDER+1) * (MAX_AMBI_ORDER+1))
-
-/* A bitmask of ambisonic channels with height information. If none of these
- * channels are used/needed, there's no height (e.g. with most surround sound
- * speaker setups). This only specifies up to 4th order, which is the highest
- * order a 32-bit mask value can specify (a 64-bit mask could handle up to 7th
- * order). This is ACN ordering, with bit 0 being ACN 0, etc.
- */
-#define AMBI_PERIPHONIC_MASK (0xfe7ce4)
-
-/* The maximum number of Ambisonic coefficients for 2D (non-periphonic)
- * representation. This is 2 per each order above zero-order, plus 1 for zero-
- * order. Or simply, o*2 + 1.
- */
-#define MAX_AMBI2D_COEFFS (MAX_AMBI_ORDER*2 + 1)
-
-
-typedef ALfloat ChannelConfig[MAX_AMBI_COEFFS];
-typedef struct BFChannelConfig {
- ALfloat Scale;
- ALsizei Index;
-} BFChannelConfig;
-
-typedef union AmbiConfig {
- /* Ambisonic coefficients for mixing to the dry buffer. */
- ChannelConfig Coeffs[MAX_OUTPUT_CHANNELS];
- /* Coefficient channel mapping for mixing to the dry buffer. */
- BFChannelConfig Map[MAX_OUTPUT_CHANNELS];
-} AmbiConfig;
-
-
-typedef struct BufferSubList {
- ALuint64 FreeMask;
- struct ALbuffer *Buffers; /* 64 */
-} BufferSubList;
-TYPEDEF_VECTOR(BufferSubList, vector_BufferSubList)
-
-typedef struct EffectSubList {
- ALuint64 FreeMask;
- struct ALeffect *Effects; /* 64 */
-} EffectSubList;
-TYPEDEF_VECTOR(EffectSubList, vector_EffectSubList)
-
-typedef struct FilterSubList {
- ALuint64 FreeMask;
- struct ALfilter *Filters; /* 64 */
-} FilterSubList;
-TYPEDEF_VECTOR(FilterSubList, vector_FilterSubList)
-
-typedef struct SourceSubList {
- ALuint64 FreeMask;
- struct ALsource *Sources; /* 64 */
-} SourceSubList;
-TYPEDEF_VECTOR(SourceSubList, vector_SourceSubList)
-
-/* Effect slots are rather large, and apps aren't likely to have more than one
- * or two (let alone 64), so hold them individually.
- */
-typedef struct ALeffectslot *ALeffectslotPtr;
-TYPEDEF_VECTOR(ALeffectslotPtr, vector_ALeffectslotPtr)
-
-
-typedef struct EnumeratedHrtf {
- al_string name;
-
- struct HrtfEntry *hrtf;
-} EnumeratedHrtf;
-TYPEDEF_VECTOR(EnumeratedHrtf, vector_EnumeratedHrtf)
-
-
-/* Maximum delay in samples for speaker distance compensation. */
-#define MAX_DELAY_LENGTH 1024
-
-typedef struct DistanceComp {
- ALfloat Gain;
- ALsizei Length; /* Valid range is [0...MAX_DELAY_LENGTH). */
- ALfloat *Buffer;
-} DistanceComp;
-
-/* Size for temporary storage of buffer data, in ALfloats. Larger values need
- * more memory, while smaller values may need more iterations. The value needs
- * to be a sensible size, however, as it constrains the max stepping value used
- * for mixing, as well as the maximum number of samples per mixing iteration.
- */
-#define BUFFERSIZE 2048
-
-typedef struct MixParams {
- AmbiConfig Ambi;
- /* Number of coefficients in each Ambi.Coeffs to mix together (4 for first-
- * order, 9 for second-order, etc). If the count is 0, Ambi.Map is used
- * instead to map each output to a coefficient index.
- */
- ALsizei CoeffCount;
-
- ALfloat (*Buffer)[BUFFERSIZE];
- ALsizei NumChannels;
-} MixParams;
-
-typedef struct RealMixParams {
- enum Channel ChannelName[MAX_OUTPUT_CHANNELS];
-
- ALfloat (*Buffer)[BUFFERSIZE];
- ALsizei NumChannels;
-} RealMixParams;
-
-typedef void (*POSTPROCESS)(ALCdevice *device, ALsizei SamplesToDo);
-
-struct ALCdevice_struct {
- RefCount ref;
-
- ATOMIC(ALenum) Connected;
- enum DeviceType Type;
-
- ALuint Frequency;
- ALuint UpdateSize;
- ALuint NumUpdates;
- enum DevFmtChannels FmtChans;
- enum DevFmtType FmtType;
- ALboolean IsHeadphones;
- ALsizei AmbiOrder;
- /* For DevFmtAmbi* output only, specifies the channel order and
- * normalization.
- */
- enum AmbiLayout AmbiLayout;
- enum AmbiNorm AmbiScale;
-
- ALCenum LimiterState;
-
- al_string DeviceName;
-
- ATOMIC(ALCenum) LastError;
-
- // Maximum number of sources that can be created
- ALuint SourcesMax;
- // Maximum number of slots that can be created
- ALuint AuxiliaryEffectSlotMax;
-
- ALCuint NumMonoSources;
- ALCuint NumStereoSources;
- ALsizei NumAuxSends;
-
- // Map of Buffers for this device
- vector_BufferSubList BufferList;
- almtx_t BufferLock;
-
- // Map of Effects for this device
- vector_EffectSubList EffectList;
- almtx_t EffectLock;
-
- // Map of Filters for this device
- vector_FilterSubList FilterList;
- almtx_t FilterLock;
-
- POSTPROCESS PostProcess;
-
- /* HRTF state and info */
- struct DirectHrtfState *Hrtf;
- al_string HrtfName;
- struct Hrtf *HrtfHandle;
- vector_EnumeratedHrtf HrtfList;
- ALCenum HrtfStatus;
-
- /* UHJ encoder state */
- struct Uhj2Encoder *Uhj_Encoder;
-
- /* High quality Ambisonic decoder */
- struct BFormatDec *AmbiDecoder;
-
- /* Stereo-to-binaural filter */
- struct bs2b *Bs2b;
-
- /* First-order ambisonic upsampler for higher-order output */
- struct AmbiUpsampler *AmbiUp;
-
- /* Rendering mode. */
- enum RenderMode Render_Mode;
-
- // Device flags
- ALuint Flags;
-
- ALuint64 ClockBase;
- ALuint SamplesDone;
- ALuint FixedLatency;
-
- /* Temp storage used for mixer processing. */
- alignas(16) ALfloat TempBuffer[4][BUFFERSIZE];
-
- /* The "dry" path corresponds to the main output. */
- MixParams Dry;
- ALsizei NumChannelsPerOrder[MAX_AMBI_ORDER+1];
-
- /* First-order ambisonics output, to be upsampled to the dry buffer if different. */
- MixParams FOAOut;
-
- /* "Real" output, which will be written to the device buffer. May alias the
- * dry buffer.
- */
- RealMixParams RealOut;
-
- struct FrontStablizer *Stablizer;
-
- struct Compressor *Limiter;
-
- /* The average speaker distance as determined by the ambdec configuration
- * (or alternatively, by the NFC-HOA reference delay). Only used for NFC.
- */
- ALfloat AvgSpeakerDist;
-
- /* Delay buffers used to compensate for speaker distances. */
- DistanceComp ChannelDelay[MAX_OUTPUT_CHANNELS];
-
- /* Dithering control. */
- ALfloat DitherDepth;
- ALuint DitherSeed;
-
- /* Running count of the mixer invocations, in 31.1 fixed point. This
- * actually increments *twice* when mixing, first at the start and then at
- * the end, so the bottom bit indicates if the device is currently mixing
- * and the upper bits indicates how many mixes have been done.
- */
- RefCount MixCount;
-
- // Contexts created on this device
- ATOMIC(ALCcontext*) ContextList;
-
- almtx_t BackendLock;
- struct ALCbackend *Backend;
-
- ATOMIC(ALCdevice*) next;
-};
-
-// Frequency was requested by the app or config file
-#define DEVICE_FREQUENCY_REQUEST (1u<<1)
-// Channel configuration was requested by the config file
-#define DEVICE_CHANNELS_REQUEST (1u<<2)
-// Sample type was requested by the config file
-#define DEVICE_SAMPLE_TYPE_REQUEST (1u<<3)
-
-// Specifies if the DSP is paused at user request
-#define DEVICE_PAUSED (1u<<30)
-
-// Specifies if the device is currently running
-#define DEVICE_RUNNING (1u<<31)
-
-
-/* Nanosecond resolution for the device clock time. */
-#define DEVICE_CLOCK_RES U64(1000000000)
-
-
-/* Must be less than 15 characters (16 including terminating null) for
- * compatibility with pthread_setname_np limitations. */
-#define MIXER_THREAD_NAME "alsoft-mixer"
-
-#define RECORD_THREAD_NAME "alsoft-record"
-
-
-enum {
- /* End event thread processing. */
- EventType_KillThread = 0,
-
- /* User event types. */
- EventType_SourceStateChange = 1<<0,
- EventType_BufferCompleted = 1<<1,
- EventType_Error = 1<<2,
- EventType_Performance = 1<<3,
- EventType_Deprecated = 1<<4,
- EventType_Disconnected = 1<<5,
-
- /* Internal events. */
- EventType_ReleaseEffectState = 65536,
-};
-
-typedef struct AsyncEvent {
- unsigned int EnumType;
- union {
- char dummy;
- struct {
- ALenum type;
- ALuint id;
- ALuint param;
- ALchar msg[1008];
- } user;
- struct ALeffectState *EffectState;
- } u;
-} AsyncEvent;
-#define ASYNC_EVENT(t) { t, { 0 } }
-
-struct ALCcontext_struct {
- RefCount ref;
-
- struct ALlistener *Listener;
-
- vector_SourceSubList SourceList;
- ALuint NumSources;
- almtx_t SourceLock;
-
- vector_ALeffectslotPtr EffectSlotList;
- almtx_t EffectSlotLock;
-
- ATOMIC(ALenum) LastError;
-
- enum DistanceModel DistanceModel;
- ALboolean SourceDistanceModel;
-
- ALfloat DopplerFactor;
- ALfloat DopplerVelocity;
- ALfloat SpeedOfSound;
- ALfloat MetersPerUnit;
-
- ATOMIC_FLAG PropsClean;
- ATOMIC(ALenum) DeferUpdates;
-
- almtx_t PropLock;
-
- /* Counter for the pre-mixing updates, in 31.1 fixed point (lowest bit
- * indicates if updates are currently happening).
- */
- RefCount UpdateCount;
- ATOMIC(ALenum) HoldUpdates;
-
- ALfloat GainBoost;
-
- ATOMIC(struct ALcontextProps*) Update;
-
- /* Linked lists of unused property containers, free to use for future
- * updates.
- */
- ATOMIC(struct ALcontextProps*) FreeContextProps;
- ATOMIC(struct ALlistenerProps*) FreeListenerProps;
- ATOMIC(struct ALvoiceProps*) FreeVoiceProps;
- ATOMIC(struct ALeffectslotProps*) FreeEffectslotProps;
-
- struct ALvoice **Voices;
- ALsizei VoiceCount;
- ALsizei MaxVoices;
-
- ATOMIC(struct ALeffectslotArray*) ActiveAuxSlots;
-
- althrd_t EventThread;
- alsem_t EventSem;
- struct ll_ringbuffer *AsyncEvents;
- ATOMIC(ALbitfieldSOFT) EnabledEvts;
- almtx_t EventCbLock;
- ALEVENTPROCSOFT EventCb;
- void *EventParam;
-
- /* Default effect slot */
- struct ALeffectslot *DefaultSlot;
-
- ALCdevice *Device;
- const ALCchar *ExtensionList;
-
- ATOMIC(ALCcontext*) next;
-
- /* Memory space used by the listener (and possibly default effect slot) */
- alignas(16) ALCbyte _listener_mem[];
-};
-
-ALCcontext *GetContextRef(void);
-
-void ALCcontext_DecRef(ALCcontext *context);
-
-void ALCcontext_DeferUpdates(ALCcontext *context);
-void ALCcontext_ProcessUpdates(ALCcontext *context);
-
-void AllocateVoices(ALCcontext *context, ALsizei num_voices, ALsizei old_sends);
-
-
-extern ALint RTPrioLevel;
-void SetRTPriority(void);
-
-void SetDefaultChannelOrder(ALCdevice *device);
-void SetDefaultWFXChannelOrder(ALCdevice *device);
-
-const ALCchar *DevFmtTypeString(enum DevFmtType type);
-const ALCchar *DevFmtChannelsString(enum DevFmtChannels chans);
-
-inline ALint GetChannelIndex(const enum Channel names[MAX_OUTPUT_CHANNELS], enum Channel chan)
-{
- ALint i;
- for(i = 0;i < MAX_OUTPUT_CHANNELS;i++)
- {
- if(names[i] == chan)
- return i;
- }
- return -1;
-}
-/**
- * GetChannelIdxByName
- *
- * Returns the index for the given channel name (e.g. FrontCenter), or -1 if it
- * doesn't exist.
- */
-inline ALint GetChannelIdxByName(const RealMixParams *real, enum Channel chan)
-{ return GetChannelIndex(real->ChannelName, chan); }
-
-
-inline void LockBufferList(ALCdevice *device) { almtx_lock(&device->BufferLock); }
-inline void UnlockBufferList(ALCdevice *device) { almtx_unlock(&device->BufferLock); }
-
-inline void LockEffectList(ALCdevice *device) { almtx_lock(&device->EffectLock); }
-inline void UnlockEffectList(ALCdevice *device) { almtx_unlock(&device->EffectLock); }
-
-inline void LockFilterList(ALCdevice *device) { almtx_lock(&device->FilterLock); }
-inline void UnlockFilterList(ALCdevice *device) { almtx_unlock(&device->FilterLock); }
-
-inline void LockEffectSlotList(ALCcontext *context)
-{ almtx_lock(&context->EffectSlotLock); }
-inline void UnlockEffectSlotList(ALCcontext *context)
-{ almtx_unlock(&context->EffectSlotLock); }
-
-
-int EventThread(void *arg);
-
-
-vector_al_string SearchDataFiles(const char *match, const char *subdir);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/OpenAL32/Include/alSource.h b/OpenAL32/Include/alSource.h
deleted file mode 100644
index 5f07c09d..00000000
--- a/OpenAL32/Include/alSource.h
+++ /dev/null
@@ -1,120 +0,0 @@
-#ifndef _AL_SOURCE_H_
-#define _AL_SOURCE_H_
-
-#include "bool.h"
-#include "alMain.h"
-#include "alu.h"
-#include "hrtf.h"
-#include "atomic.h"
-
-#define MAX_SENDS 16
-#define DEFAULT_SENDS 2
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct ALbuffer;
-struct ALsource;
-
-
-typedef struct ALbufferlistitem {
- ATOMIC(struct ALbufferlistitem*) next;
- ALsizei max_samples;
- ALsizei num_buffers;
- struct ALbuffer *buffers[];
-} ALbufferlistitem;
-
-
-typedef struct ALsource {
- /** Source properties. */
- ALfloat Pitch;
- ALfloat Gain;
- ALfloat OuterGain;
- ALfloat MinGain;
- ALfloat MaxGain;
- ALfloat InnerAngle;
- ALfloat OuterAngle;
- ALfloat RefDistance;
- ALfloat MaxDistance;
- ALfloat RolloffFactor;
- ALfloat Position[3];
- ALfloat Velocity[3];
- ALfloat Direction[3];
- ALfloat Orientation[2][3];
- ALboolean HeadRelative;
- ALboolean Looping;
- enum DistanceModel DistanceModel;
- enum Resampler Resampler;
- ALboolean DirectChannels;
- enum SpatializeMode Spatialize;
-
- ALboolean DryGainHFAuto;
- ALboolean WetGainAuto;
- ALboolean WetGainHFAuto;
- ALfloat OuterGainHF;
-
- ALfloat AirAbsorptionFactor;
- ALfloat RoomRolloffFactor;
- ALfloat DopplerFactor;
-
- /* NOTE: Stereo pan angles are specified in radians, counter-clockwise
- * rather than clockwise.
- */
- ALfloat StereoPan[2];
-
- ALfloat Radius;
-
- /** Direct filter and auxiliary send info. */
- struct {
- ALfloat Gain;
- ALfloat GainHF;
- ALfloat HFReference;
- ALfloat GainLF;
- ALfloat LFReference;
- } Direct;
- struct {
- struct ALeffectslot *Slot;
- ALfloat Gain;
- ALfloat GainHF;
- ALfloat HFReference;
- ALfloat GainLF;
- ALfloat LFReference;
- } *Send;
-
- /**
- * Last user-specified offset, and the offset type (bytes, samples, or
- * seconds).
- */
- ALdouble Offset;
- ALenum OffsetType;
-
- /** Source type (static, streaming, or undetermined) */
- ALint SourceType;
-
- /** Source state (initial, playing, paused, or stopped) */
- ALenum state;
-
- /** Source Buffer Queue head. */
- ALbufferlistitem *queue;
-
- ATOMIC_FLAG PropsClean;
-
- /* Index into the context's Voices array. Lazily updated, only checked and
- * reset when looking up the voice.
- */
- ALint VoiceIdx;
-
- /** Self ID */
- ALuint id;
-} ALsource;
-
-void UpdateAllSourceProps(ALCcontext *context);
-
-ALvoid ReleaseALSources(ALCcontext *Context);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h
deleted file mode 100644
index c572fd71..00000000
--- a/OpenAL32/Include/alu.h
+++ /dev/null
@@ -1,534 +0,0 @@
-#ifndef _ALU_H_
-#define _ALU_H_
-
-#include <limits.h>
-#include <math.h>
-#ifdef HAVE_FLOAT_H
-#include <float.h>
-#endif
-#ifdef HAVE_IEEEFP_H
-#include <ieeefp.h>
-#endif
-
-#include "alMain.h"
-#include "alBuffer.h"
-
-#include "hrtf.h"
-#include "align.h"
-#include "math_defs.h"
-#include "filters/defs.h"
-#include "filters/nfc.h"
-
-
-#define MAX_PITCH (255)
-
-/* Maximum number of samples to pad on either end of a buffer for resampling.
- * Note that both the beginning and end need padding!
- */
-#define MAX_RESAMPLE_PADDING 24
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct BSincTable;
-struct ALsource;
-struct ALbufferlistitem;
-struct ALvoice;
-struct ALeffectslot;
-
-
-#define DITHER_RNG_SEED 22222
-
-
-enum SpatializeMode {
- SpatializeOff = AL_FALSE,
- SpatializeOn = AL_TRUE,
- SpatializeAuto = AL_AUTO_SOFT
-};
-
-enum Resampler {
- PointResampler,
- LinearResampler,
- FIR4Resampler,
- BSinc12Resampler,
- BSinc24Resampler,
-
- ResamplerMax = BSinc24Resampler
-};
-extern enum Resampler ResamplerDefault;
-
-/* The number of distinct scale and phase intervals within the bsinc filter
- * table.
- */
-#define BSINC_SCALE_BITS 4
-#define BSINC_SCALE_COUNT (1<<BSINC_SCALE_BITS)
-#define BSINC_PHASE_BITS 4
-#define BSINC_PHASE_COUNT (1<<BSINC_PHASE_BITS)
-
-/* Interpolator state. Kind of a misnomer since the interpolator itself is
- * stateless. This just keeps it from having to recompute scale-related
- * mappings for every sample.
- */
-typedef struct BsincState {
- ALfloat sf; /* Scale interpolation factor. */
- ALsizei m; /* Coefficient count. */
- ALsizei l; /* Left coefficient offset. */
- /* Filter coefficients, followed by the scale, phase, and scale-phase
- * delta coefficients. Starting at phase index 0, each subsequent phase
- * index follows contiguously.
- */
- const ALfloat *filter;
-} BsincState;
-
-typedef union InterpState {
- BsincState bsinc;
-} InterpState;
-
-typedef const ALfloat* (*ResamplerFunc)(const InterpState *state,
- const ALfloat *restrict src, ALsizei frac, ALint increment,
- ALfloat *restrict dst, ALsizei dstlen
-);
-
-void BsincPrepare(const ALuint increment, BsincState *state, const struct BSincTable *table);
-
-extern const struct BSincTable bsinc12;
-extern const struct BSincTable bsinc24;
-
-
-typedef union aluVector {
- alignas(16) ALfloat v[4];
-} aluVector;
-
-inline void aluVectorSet(aluVector *vector, ALfloat x, ALfloat y, ALfloat z, ALfloat w)
-{
- vector->v[0] = x;
- vector->v[1] = y;
- vector->v[2] = z;
- vector->v[3] = w;
-}
-
-
-typedef union aluMatrixf {
- alignas(16) ALfloat m[4][4];
-} aluMatrixf;
-extern const aluMatrixf IdentityMatrixf;
-
-inline void aluMatrixfSetRow(aluMatrixf *matrix, ALuint row,
- ALfloat m0, ALfloat m1, ALfloat m2, ALfloat m3)
-{
- matrix->m[row][0] = m0;
- matrix->m[row][1] = m1;
- matrix->m[row][2] = m2;
- matrix->m[row][3] = m3;
-}
-
-inline void aluMatrixfSet(aluMatrixf *matrix, ALfloat m00, ALfloat m01, ALfloat m02, ALfloat m03,
- ALfloat m10, ALfloat m11, ALfloat m12, ALfloat m13,
- ALfloat m20, ALfloat m21, ALfloat m22, ALfloat m23,
- ALfloat m30, ALfloat m31, ALfloat m32, ALfloat m33)
-{
- aluMatrixfSetRow(matrix, 0, m00, m01, m02, m03);
- aluMatrixfSetRow(matrix, 1, m10, m11, m12, m13);
- aluMatrixfSetRow(matrix, 2, m20, m21, m22, m23);
- aluMatrixfSetRow(matrix, 3, m30, m31, m32, m33);
-}
-
-
-enum ActiveFilters {
- AF_None = 0,
- AF_LowPass = 1,
- AF_HighPass = 2,
- AF_BandPass = AF_LowPass | AF_HighPass
-};
-
-
-typedef struct MixHrtfParams {
- const ALfloat (*Coeffs)[2];
- ALsizei Delay[2];
- ALfloat Gain;
- ALfloat GainStep;
-} MixHrtfParams;
-
-
-typedef struct DirectParams {
- BiquadFilter LowPass;
- BiquadFilter HighPass;
-
- NfcFilter NFCtrlFilter;
-
- struct {
- HrtfParams Old;
- HrtfParams Target;
- HrtfState State;
- } Hrtf;
-
- struct {
- ALfloat Current[MAX_OUTPUT_CHANNELS];
- ALfloat Target[MAX_OUTPUT_CHANNELS];
- } Gains;
-} DirectParams;
-
-typedef struct SendParams {
- BiquadFilter LowPass;
- BiquadFilter HighPass;
-
- struct {
- ALfloat Current[MAX_OUTPUT_CHANNELS];
- ALfloat Target[MAX_OUTPUT_CHANNELS];
- } Gains;
-} SendParams;
-
-
-struct ALvoiceProps {
- ATOMIC(struct ALvoiceProps*) next;
-
- ALfloat Pitch;
- ALfloat Gain;
- ALfloat OuterGain;
- ALfloat MinGain;
- ALfloat MaxGain;
- ALfloat InnerAngle;
- ALfloat OuterAngle;
- ALfloat RefDistance;
- ALfloat MaxDistance;
- ALfloat RolloffFactor;
- ALfloat Position[3];
- ALfloat Velocity[3];
- ALfloat Direction[3];
- ALfloat Orientation[2][3];
- ALboolean HeadRelative;
- enum DistanceModel DistanceModel;
- enum Resampler Resampler;
- ALboolean DirectChannels;
- enum SpatializeMode SpatializeMode;
-
- ALboolean DryGainHFAuto;
- ALboolean WetGainAuto;
- ALboolean WetGainHFAuto;
- ALfloat OuterGainHF;
-
- ALfloat AirAbsorptionFactor;
- ALfloat RoomRolloffFactor;
- ALfloat DopplerFactor;
-
- ALfloat StereoPan[2];
-
- ALfloat Radius;
-
- /** Direct filter and auxiliary send info. */
- struct {
- ALfloat Gain;
- ALfloat GainHF;
- ALfloat HFReference;
- ALfloat GainLF;
- ALfloat LFReference;
- } Direct;
- struct {
- struct ALeffectslot *Slot;
- ALfloat Gain;
- ALfloat GainHF;
- ALfloat HFReference;
- ALfloat GainLF;
- ALfloat LFReference;
- } Send[];
-};
-
-#define VOICE_IS_STATIC (1<<0)
-#define VOICE_IS_FADING (1<<1) /* Fading sources use gain stepping for smooth transitions. */
-#define VOICE_HAS_HRTF (1<<2)
-#define VOICE_HAS_NFC (1<<3)
-
-typedef struct ALvoice {
- struct ALvoiceProps *Props;
-
- ATOMIC(struct ALvoiceProps*) Update;
-
- ATOMIC(struct ALsource*) Source;
- ATOMIC(bool) Playing;
-
- /**
- * Source offset in samples, relative to the currently playing buffer, NOT
- * the whole queue, and the fractional (fixed-point) offset to the next
- * sample.
- */
- ATOMIC(ALuint) position;
- ATOMIC(ALsizei) position_fraction;
-
- /* Current buffer queue item being played. */
- ATOMIC(struct ALbufferlistitem*) current_buffer;
-
- /* Buffer queue item to loop to at end of queue (will be NULL for non-
- * looping voices).
- */
- ATOMIC(struct ALbufferlistitem*) loop_buffer;
-
- /**
- * Number of channels and bytes-per-sample for the attached source's
- * buffer(s).
- */
- ALsizei NumChannels;
- ALsizei SampleSize;
-
- /** Current target parameters used for mixing. */
- ALint Step;
-
- ResamplerFunc Resampler;
-
- ALuint Flags;
-
- ALuint Offset; /* Number of output samples mixed since starting. */
-
- alignas(16) ALfloat PrevSamples[MAX_INPUT_CHANNELS][MAX_RESAMPLE_PADDING];
-
- InterpState ResampleState;
-
- struct {
- enum ActiveFilters FilterType;
- DirectParams Params[MAX_INPUT_CHANNELS];
-
- ALfloat (*Buffer)[BUFFERSIZE];
- ALsizei Channels;
- ALsizei ChannelsPerOrder[MAX_AMBI_ORDER+1];
- } Direct;
-
- struct {
- enum ActiveFilters FilterType;
- SendParams Params[MAX_INPUT_CHANNELS];
-
- ALfloat (*Buffer)[BUFFERSIZE];
- ALsizei Channels;
- } Send[];
-} ALvoice;
-
-void DeinitVoice(ALvoice *voice);
-
-
-typedef void (*MixerFunc)(const ALfloat *data, ALsizei OutChans,
- ALfloat (*restrict OutBuffer)[BUFFERSIZE], ALfloat *CurrentGains,
- const ALfloat *TargetGains, ALsizei Counter, ALsizei OutPos,
- ALsizei BufferSize);
-typedef void (*RowMixerFunc)(ALfloat *OutBuffer, const ALfloat *gains,
- const ALfloat (*restrict data)[BUFFERSIZE], ALsizei InChans,
- ALsizei InPos, ALsizei BufferSize);
-typedef void (*HrtfMixerFunc)(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
- const ALfloat *data, ALsizei Offset, ALsizei OutPos,
- const ALsizei IrSize, MixHrtfParams *hrtfparams,
- HrtfState *hrtfstate, ALsizei BufferSize);
-typedef void (*HrtfMixerBlendFunc)(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
- const ALfloat *data, ALsizei Offset, ALsizei OutPos,
- const ALsizei IrSize, const HrtfParams *oldparams,
- MixHrtfParams *newparams, HrtfState *hrtfstate,
- ALsizei BufferSize);
-typedef void (*HrtfDirectMixerFunc)(ALfloat *restrict LeftOut, ALfloat *restrict RightOut,
- const ALfloat *data, ALsizei Offset, const ALsizei IrSize,
- const ALfloat (*restrict Coeffs)[2],
- ALfloat (*restrict Values)[2], ALsizei BufferSize);
-
-
-#define GAIN_MIX_MAX (16.0f) /* +24dB */
-
-#define GAIN_SILENCE_THRESHOLD (0.00001f) /* -100dB */
-
-#define SPEEDOFSOUNDMETRESPERSEC (343.3f)
-#define AIRABSORBGAINHF (0.99426f) /* -0.05dB */
-
-/* Target gain for the reverb decay feedback reaching the decay time. */
-#define REVERB_DECAY_GAIN (0.001f) /* -60 dB */
-
-#define FRACTIONBITS (12)
-#define FRACTIONONE (1<<FRACTIONBITS)
-#define FRACTIONMASK (FRACTIONONE-1)
-
-
-inline ALfloat minf(ALfloat a, ALfloat b)
-{ return ((a > b) ? b : a); }
-inline ALfloat maxf(ALfloat a, ALfloat b)
-{ return ((a > b) ? a : b); }
-inline ALfloat clampf(ALfloat val, ALfloat min, ALfloat max)
-{ return minf(max, maxf(min, val)); }
-
-inline ALdouble mind(ALdouble a, ALdouble b)
-{ return ((a > b) ? b : a); }
-inline ALdouble maxd(ALdouble a, ALdouble b)
-{ return ((a > b) ? a : b); }
-inline ALdouble clampd(ALdouble val, ALdouble min, ALdouble max)
-{ return mind(max, maxd(min, val)); }
-
-inline ALuint minu(ALuint a, ALuint b)
-{ return ((a > b) ? b : a); }
-inline ALuint maxu(ALuint a, ALuint b)
-{ return ((a > b) ? a : b); }
-inline ALuint clampu(ALuint val, ALuint min, ALuint max)
-{ return minu(max, maxu(min, val)); }
-
-inline ALint mini(ALint a, ALint b)
-{ return ((a > b) ? b : a); }
-inline ALint maxi(ALint a, ALint b)
-{ return ((a > b) ? a : b); }
-inline ALint clampi(ALint val, ALint min, ALint max)
-{ return mini(max, maxi(min, val)); }
-
-inline ALint64 mini64(ALint64 a, ALint64 b)
-{ return ((a > b) ? b : a); }
-inline ALint64 maxi64(ALint64 a, ALint64 b)
-{ return ((a > b) ? a : b); }
-inline ALint64 clampi64(ALint64 val, ALint64 min, ALint64 max)
-{ return mini64(max, maxi64(min, val)); }
-
-inline ALuint64 minu64(ALuint64 a, ALuint64 b)
-{ return ((a > b) ? b : a); }
-inline ALuint64 maxu64(ALuint64 a, ALuint64 b)
-{ return ((a > b) ? a : b); }
-inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max)
-{ return minu64(max, maxu64(min, val)); }
-
-inline size_t minz(size_t a, size_t b)
-{ return ((a > b) ? b : a); }
-inline size_t maxz(size_t a, size_t b)
-{ return ((a > b) ? a : b); }
-inline size_t clampz(size_t val, size_t min, size_t max)
-{ return minz(max, maxz(min, val)); }
-
-
-inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu)
-{
- return val1 + (val2-val1)*mu;
-}
-inline ALfloat cubic(ALfloat val1, ALfloat val2, ALfloat val3, ALfloat val4, ALfloat mu)
-{
- ALfloat mu2 = mu*mu, mu3 = mu2*mu;
- ALfloat a0 = -0.5f*mu3 + mu2 + -0.5f*mu;
- ALfloat a1 = 1.5f*mu3 + -2.5f*mu2 + 1.0f;
- ALfloat a2 = -1.5f*mu3 + 2.0f*mu2 + 0.5f*mu;
- ALfloat a3 = 0.5f*mu3 + -0.5f*mu2;
- return val1*a0 + val2*a1 + val3*a2 + val4*a3;
-}
-
-
-enum HrtfRequestMode {
- Hrtf_Default = 0,
- Hrtf_Enable = 1,
- Hrtf_Disable = 2,
-};
-
-void aluInit(void);
-
-void aluInitMixer(void);
-
-ResamplerFunc SelectResampler(enum Resampler resampler);
-
-/* aluInitRenderer
- *
- * Set up the appropriate panning method and mixing method given the device
- * properties.
- */
-void aluInitRenderer(ALCdevice *device, ALint hrtf_id, enum HrtfRequestMode hrtf_appreq, enum HrtfRequestMode hrtf_userreq);
-
-void aluInitEffectPanning(struct ALeffectslot *slot);
-
-void aluSelectPostProcess(ALCdevice *device);
-
-/**
- * Calculates ambisonic encoder coefficients using the X, Y, and Z direction
- * components, which must represent a normalized (unit length) vector, and the
- * spread is the angular width of the sound (0...tau).
- *
- * NOTE: The components use ambisonic coordinates. As a result:
- *
- * Ambisonic Y = OpenAL -X
- * Ambisonic Z = OpenAL Y
- * Ambisonic X = OpenAL -Z
- *
- * The components are ordered such that OpenAL's X, Y, and Z are the first,
- * second, and third parameters respectively -- simply negate X and Z.
- */
-void CalcAmbiCoeffs(const ALfloat y, const ALfloat z, const ALfloat x, const ALfloat spread,
- ALfloat coeffs[MAX_AMBI_COEFFS]);
-
-/**
- * CalcDirectionCoeffs
- *
- * Calculates ambisonic coefficients based on an OpenAL direction vector. The
- * vector must be normalized (unit length), and the spread is the angular width
- * of the sound (0...tau).
- */
-inline void CalcDirectionCoeffs(const ALfloat dir[3], ALfloat spread, ALfloat coeffs[MAX_AMBI_COEFFS])
-{
- /* Convert from OpenAL coords to Ambisonics. */
- CalcAmbiCoeffs(-dir[0], dir[1], -dir[2], spread, coeffs);
-}
-
-/**
- * CalcAngleCoeffs
- *
- * Calculates ambisonic coefficients based on azimuth and elevation. The
- * azimuth and elevation parameters are in radians, going right and up
- * respectively.
- */
-inline void CalcAngleCoeffs(ALfloat azimuth, ALfloat elevation, ALfloat spread, ALfloat coeffs[MAX_AMBI_COEFFS])
-{
- ALfloat x = -sinf(azimuth) * cosf(elevation);
- ALfloat y = sinf(elevation);
- ALfloat z = cosf(azimuth) * cosf(elevation);
-
- CalcAmbiCoeffs(x, y, z, spread, coeffs);
-}
-
-/**
- * ScaleAzimuthFront
- *
- * Scales the given azimuth toward the side (+/- pi/2 radians) for positions in
- * front.
- */
-inline float ScaleAzimuthFront(float azimuth, float scale)
-{
- ALfloat sign = copysignf(1.0f, azimuth);
- if(!(fabsf(azimuth) > F_PI_2))
- return minf(fabsf(azimuth) * scale, F_PI_2) * sign;
- return azimuth;
-}
-
-
-void ComputePanningGainsMC(const ChannelConfig *chancoeffs, ALsizei numchans, ALsizei numcoeffs, const ALfloat*restrict coeffs, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
-void ComputePanningGainsBF(const BFChannelConfig *chanmap, ALsizei numchans, const ALfloat*restrict coeffs, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS]);
-
-/**
- * ComputePanGains
- *
- * Computes panning gains using the given channel decoder coefficients and the
- * pre-calculated direction or angle coefficients. For B-Format sources, the
- * coeffs are a 'slice' of a transform matrix for the input channel, used to
- * scale and orient the sound samples.
- */
-inline void ComputePanGains(const MixParams *dry, const ALfloat*restrict coeffs, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
-{
- if(dry->CoeffCount > 0)
- ComputePanningGainsMC(dry->Ambi.Coeffs, dry->NumChannels, dry->CoeffCount,
- coeffs, ingain, gains);
- else
- ComputePanningGainsBF(dry->Ambi.Map, dry->NumChannels, coeffs, ingain, gains);
-}
-
-
-ALboolean MixSource(struct ALvoice *voice, ALuint SourceID, ALCcontext *Context, ALsizei SamplesToDo);
-
-void aluMixData(ALCdevice *device, ALvoid *OutBuffer, ALsizei NumSamples);
-/* Caller must lock the device, and the mixer must not be running. */
-void aluHandleDisconnect(ALCdevice *device, const char *msg, ...) DECL_FORMAT(printf, 2, 3);
-
-void UpdateContextProps(ALCcontext *context);
-
-extern MixerFunc MixSamples;
-extern RowMixerFunc MixRowSamples;
-
-extern ALfloat ConeScale;
-extern ALfloat ZScale;
-extern ALboolean OverrideReverbSpeedOfSound;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/OpenAL32/Include/bs2b.h b/OpenAL32/Include/bs2b.h
deleted file mode 100644
index e845d906..00000000
--- a/OpenAL32/Include/bs2b.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*-
- * Copyright (c) 2005 Boris Mikhaylov
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef BS2B_H
-#define BS2B_H
-
-/* Number of crossfeed levels */
-#define BS2B_CLEVELS 3
-
-/* Normal crossfeed levels */
-#define BS2B_HIGH_CLEVEL 3
-#define BS2B_MIDDLE_CLEVEL 2
-#define BS2B_LOW_CLEVEL 1
-
-/* Easy crossfeed levels */
-#define BS2B_HIGH_ECLEVEL BS2B_HIGH_CLEVEL + BS2B_CLEVELS
-#define BS2B_MIDDLE_ECLEVEL BS2B_MIDDLE_CLEVEL + BS2B_CLEVELS
-#define BS2B_LOW_ECLEVEL BS2B_LOW_CLEVEL + BS2B_CLEVELS
-
-/* Default crossfeed levels */
-#define BS2B_DEFAULT_CLEVEL BS2B_HIGH_ECLEVEL
-/* Default sample rate (Hz) */
-#define BS2B_DEFAULT_SRATE 44100
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-struct bs2b {
- int level; /* Crossfeed level */
- int srate; /* Sample rate (Hz) */
-
- /* Lowpass IIR filter coefficients */
- float a0_lo;
- float b1_lo;
-
- /* Highboost IIR filter coefficients */
- float a0_hi;
- float a1_hi;
- float b1_hi;
-
- /* Buffer of last filtered sample.
- * [0] - first channel, [1] - second channel
- */
- struct t_last_sample {
- float asis;
- float lo;
- float hi;
- } last_sample[2];
-};
-
-/* Clear buffers and set new coefficients with new crossfeed level and sample
- * rate values.
- * level - crossfeed level of *LEVEL values.
- * srate - sample rate by Hz.
- */
-void bs2b_set_params(struct bs2b *bs2b, int level, int srate);
-
-/* Return current crossfeed level value */
-int bs2b_get_level(struct bs2b *bs2b);
-
-/* Return current sample rate value */
-int bs2b_get_srate(struct bs2b *bs2b);
-
-/* Clear buffer */
-void bs2b_clear(struct bs2b *bs2b);
-
-void bs2b_cross_feed(struct bs2b *bs2b, float *restrict Left, float *restrict Right, int SamplesToDo);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif /* __cplusplus */
-
-#endif /* BS2B_H */
diff --git a/OpenAL32/Include/sample_cvt.h b/OpenAL32/Include/sample_cvt.h
deleted file mode 100644
index c041760e..00000000
--- a/OpenAL32/Include/sample_cvt.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef SAMPLE_CVT_H
-#define SAMPLE_CVT_H
-
-#include "AL/al.h"
-#include "alBuffer.h"
-
-extern const ALshort muLawDecompressionTable[256];
-extern const ALshort aLawDecompressionTable[256];
-
-void Convert_ALshort_ALima4(ALshort *dst, const ALubyte *src, ALsizei numchans, ALsizei len,
- ALsizei align);
-void Convert_ALshort_ALmsadpcm(ALshort *dst, const ALubyte *src, ALsizei numchans, ALsizei len,
- ALsizei align);
-
-#endif /* SAMPLE_CVT_H */