diff options
author | Chris Robinson <[email protected]> | 2016-03-14 09:04:03 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-03-14 20:13:50 -0700 |
commit | 919b35295e1b05293fd9f99a9a3f6d3f07a9c370 (patch) | |
tree | 1bdd8623d20f048123726775bc68deafd59de6e7 /Alc/ambdec.h | |
parent | 0220404a9152d2cb3024308655d4f0e6119167fa (diff) |
Add a loader for ambdec files
Diffstat (limited to 'Alc/ambdec.h')
-rw-r--r-- | Alc/ambdec.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Alc/ambdec.h b/Alc/ambdec.h new file mode 100644 index 00000000..8a3befc1 --- /dev/null +++ b/Alc/ambdec.h @@ -0,0 +1,46 @@ +#ifndef AMBDEC_H +#define AMBDEC_H + +#include "alstring.h" +#include "alMain.h" + +/* Helpers to read .ambdec configuration files. */ + +enum AmbDecScaleType { + ADS_N3D, + ADS_SN3D, + ADS_FuMa, +}; +typedef struct AmbDecConf { + al_string Description; + ALuint Version; /* Must be 3 */ + + ALuint ChanMask; + ALuint FreqBands; /* Must be 1 or 2 */ + ALuint NumSpeakers; + enum AmbDecScaleType CoeffScale; + + ALfloat XOverFreq; + ALfloat XOverRatio; + + struct { + al_string Name; + ALfloat Distance; + ALfloat Azimuth; + ALfloat Elevation; + al_string Connection; + } Speakers[MAX_OUTPUT_CHANNELS]; + + /* Unused when FreqBands == 1 */ + ALfloat LFOrderGain[MAX_AMBI_ORDER+1]; + ALfloat LFMatrix[MAX_OUTPUT_CHANNELS][MAX_AMBI_COEFFS]; + + ALfloat HFOrderGain[MAX_AMBI_ORDER+1]; + ALfloat HFMatrix[MAX_OUTPUT_CHANNELS][MAX_AMBI_COEFFS]; +} AmbDecConf; + +void ambdec_init(AmbDecConf *conf); +void ambdec_deinit(AmbDecConf *conf); +int ambdec_load(AmbDecConf *conf, const char *fname); + +#endif /* AMBDEC_H */ |