#ifndef ALU_H #define ALU_H #include #include #include #include "AL/al.h" #include "alcmain.h" #include "alspan.h" #include "logging.h" struct ALbufferlistitem; struct ALeffectslot; #define MAX_PITCH 255 #define MAX_SENDS 16 using MixerFunc = void(*)(const al::span InSamples, const al::span OutBuffer, float *CurrentGains, const float *TargetGains, const size_t Counter, const size_t OutPos); using RowMixerFunc = void(*)(const al::span OutBuffer, const al::span Gains, const float *InSamples, const size_t InStride); using HrtfDirectMixerFunc = void(*)(FloatBufferLine &LeftOut, FloatBufferLine &RightOut, const al::span InSamples, float2 *AccumSamples, DirectHrtfState *State, const size_t BufferSize); extern MixerFunc MixSamples; extern RowMixerFunc MixRowSamples; #define GAIN_MIX_MAX (1000.0f) /* +60dB */ #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< GetAmbiIdentityRow(size_t i) noexcept { std::array ret{}; ret[i] = 1.0f; return ret; } void aluMixData(ALCdevice *device, ALvoid *OutBuffer, const ALuint NumSamples); /* Caller must lock the device state, and the mixer must not be running. */ void aluHandleDisconnect(ALCdevice *device, const char *msg, ...) DECL_FORMAT(printf, 2, 3); extern const ALfloat ConeScale; extern const ALfloat ZScale; #endif