openal-soft/alc/ambdec.h

49 lines
1.0 KiB
C
Raw Normal View History

2016-03-14 09:04:03 -07:00
#ifndef AMBDEC_H
#define AMBDEC_H
#include <array>
2018-11-03 19:51:23 -07:00
#include <string>
2016-03-14 09:04:03 -07:00
#include "ambidefs.h"
#include "vector.h"
2018-11-03 19:02:11 -07:00
2016-03-14 09:04:03 -07:00
/* Helpers to read .ambdec configuration files. */
2018-11-03 19:51:23 -07:00
enum class AmbDecScale {
N3D,
SN3D,
FuMa,
2016-03-14 09:04:03 -07:00
};
2018-11-03 19:51:23 -07:00
struct AmbDecConf {
std::string Description;
int Version{0}; /* Must be 3 */
2016-03-14 09:04:03 -07:00
unsigned int ChanMask{0u};
unsigned int FreqBands{0u}; /* Must be 1 or 2 */
AmbDecScale CoeffScale{};
2016-03-14 09:04:03 -07:00
float XOverFreq{0.0f};
float XOverRatio{0.0f};
2016-03-14 09:04:03 -07:00
2018-12-09 22:34:21 -08:00
struct SpeakerConf {
2018-11-03 19:51:23 -07:00
std::string Name;
float Distance{0.0f};
float Azimuth{0.0f};
float Elevation{0.0f};
2018-11-03 19:51:23 -07:00
std::string Connection;
};
al::vector<SpeakerConf> Speakers;
2016-03-14 09:04:03 -07:00
using CoeffArray = std::array<float,MAX_AMBI_CHANNELS>;
2016-03-14 09:04:03 -07:00
/* Unused when FreqBands == 1 */
float LFOrderGain[MAX_AMBI_ORDER+1]{};
al::vector<CoeffArray> LFMatrix;
2016-03-14 09:04:03 -07:00
float HFOrderGain[MAX_AMBI_ORDER+1]{};
al::vector<CoeffArray> HFMatrix;
2016-03-14 09:04:03 -07:00
int load(const char *fname) noexcept;
2018-11-03 19:51:23 -07:00
};
2018-11-03 19:02:11 -07:00
2016-03-14 09:04:03 -07:00
#endif /* AMBDEC_H */