Avoid function calls to get the HRTF sample rate and IR size
[openal-soft.git] / Alc / hrtf.h
blobe9f04d4979db0eb2adc40c947155cf52b3a4d266
1 #ifndef ALC_HRTF_H
2 #define ALC_HRTF_H
4 #include "AL/al.h"
5 #include "AL/alc.h"
7 #include "alstring.h"
10 struct Hrtf {
11 ALuint sampleRate;
12 ALuint irSize;
13 ALubyte evCount;
15 const ALubyte *azCount;
16 const ALushort *evOffset;
17 const ALshort *coeffs;
18 const ALubyte *delays;
20 const char *filename;
21 struct Hrtf *next;
24 typedef struct HrtfEntry {
25 al_string name;
27 const struct Hrtf *hrtf;
28 } HrtfEntry;
29 TYPEDEF_VECTOR(HrtfEntry, vector_HrtfEntry)
31 #define HRIR_BITS (7)
32 #define HRIR_LENGTH (1<<HRIR_BITS)
33 #define HRIR_MASK (HRIR_LENGTH-1)
34 #define HRTFDELAY_BITS (20)
35 #define HRTFDELAY_FRACONE (1<<HRTFDELAY_BITS)
36 #define HRTFDELAY_MASK (HRTFDELAY_FRACONE-1)
38 void FreeHrtfs(void);
40 vector_HrtfEntry EnumerateHrtf(const_al_string devname);
41 void FreeHrtfList(vector_HrtfEntry *list);
43 void GetLerpedHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat spread, ALfloat gain, ALfloat (*coeffs)[2], ALuint *delays);
45 #endif /* ALC_HRTF_H */