2014-02-24 05:11:01 +00:00
|
|
|
#ifndef ALC_HRTF_H
|
|
|
|
#define ALC_HRTF_H
|
|
|
|
|
|
|
|
#include "AL/al.h"
|
|
|
|
#include "AL/alc.h"
|
|
|
|
|
2015-09-20 11:10:21 +00:00
|
|
|
#include "alstring.h"
|
|
|
|
|
2014-02-24 05:11:01 +00:00
|
|
|
enum DevFmtChannels;
|
|
|
|
|
|
|
|
struct Hrtf;
|
|
|
|
|
2015-10-06 07:23:11 +00:00
|
|
|
typedef struct HrtfEntry {
|
|
|
|
al_string name;
|
|
|
|
al_string filename;
|
2015-10-06 11:01:53 +00:00
|
|
|
|
|
|
|
const struct Hrtf *hrtf;
|
2015-10-06 07:23:11 +00:00
|
|
|
} HrtfEntry;
|
|
|
|
TYPEDEF_VECTOR(HrtfEntry, vector_HrtfEntry)
|
|
|
|
|
2014-02-24 05:11:01 +00:00
|
|
|
#define HRIR_BITS (7)
|
|
|
|
#define HRIR_LENGTH (1<<HRIR_BITS)
|
|
|
|
#define HRIR_MASK (HRIR_LENGTH-1)
|
|
|
|
#define HRTFDELAY_BITS (20)
|
|
|
|
#define HRTFDELAY_FRACONE (1<<HRTFDELAY_BITS)
|
|
|
|
#define HRTFDELAY_MASK (HRTFDELAY_FRACONE-1)
|
|
|
|
|
2015-10-06 07:23:11 +00:00
|
|
|
vector_HrtfEntry EnumerateHrtf(const_al_string devname);
|
|
|
|
void FreeHrtfList(vector_HrtfEntry *list);
|
|
|
|
|
2015-09-20 11:10:21 +00:00
|
|
|
const struct Hrtf *GetHrtf(const_al_string devname, enum DevFmtChannels chans, ALCuint srate);
|
|
|
|
ALCboolean FindHrtfFormat(const_al_string devname, enum DevFmtChannels *chans, ALCuint *srate);
|
2014-02-24 05:11:01 +00:00
|
|
|
|
|
|
|
void FreeHrtfs(void);
|
|
|
|
|
|
|
|
ALuint GetHrtfIrSize(const struct Hrtf *Hrtf);
|
2014-11-23 18:49:54 +00:00
|
|
|
void GetLerpedHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat dirfact, ALfloat gain, ALfloat (*coeffs)[2], ALuint *delays);
|
|
|
|
ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth, ALfloat dirfact, ALfloat gain, ALfloat delta, ALint counter, ALfloat (*coeffs)[2], ALuint *delays, ALfloat (*coeffStep)[2], ALint *delayStep);
|
2015-02-10 19:22:28 +00:00
|
|
|
void GetBFormatHrtfCoeffs(const struct Hrtf *Hrtf, const ALuint num_chans, ALfloat (**coeffs_list)[2], ALuint **delay_list);
|
2014-02-24 05:11:01 +00:00
|
|
|
|
|
|
|
#endif /* ALC_HRTF_H */
|