2016-03-14 09:04:03 -07:00
|
|
|
#ifndef AMBDEC_H
|
|
|
|
#define AMBDEC_H
|
|
|
|
|
2018-12-15 02:42:04 -08:00
|
|
|
#include <array>
|
2018-11-03 19:51:23 -07:00
|
|
|
#include <string>
|
2016-03-14 09:04:03 -07:00
|
|
|
|
2018-12-15 03:30:47 -08:00
|
|
|
#include "ambidefs.h"
|
2018-12-15 02:42:04 -08:00
|
|
|
#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;
|
2018-12-15 03:30:47 -08:00
|
|
|
int Version{0}; /* Must be 3 */
|
2016-03-14 09:04:03 -07:00
|
|
|
|
2018-12-15 03:30:47 -08:00
|
|
|
unsigned int ChanMask{0u};
|
|
|
|
unsigned int FreqBands{0u}; /* Must be 1 or 2 */
|
|
|
|
AmbDecScale CoeffScale{};
|
2016-03-14 09:04:03 -07:00
|
|
|
|
2018-12-15 03:30:47 -08: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;
|
2018-12-15 02:42:04 -08:00
|
|
|
float Distance{0.0f};
|
|
|
|
float Azimuth{0.0f};
|
|
|
|
float Elevation{0.0f};
|
2018-11-03 19:51:23 -07:00
|
|
|
std::string Connection;
|
2018-12-15 02:42:04 -08:00
|
|
|
};
|
|
|
|
al::vector<SpeakerConf> Speakers;
|
2016-03-14 09:04:03 -07:00
|
|
|
|
2019-02-19 15:39:33 -08:00
|
|
|
using CoeffArray = std::array<float,MAX_AMBI_CHANNELS>;
|
2016-03-14 09:04:03 -07:00
|
|
|
/* Unused when FreqBands == 1 */
|
2018-12-15 03:30:47 -08:00
|
|
|
float LFOrderGain[MAX_AMBI_ORDER+1]{};
|
2018-12-15 02:42:04 -08:00
|
|
|
al::vector<CoeffArray> LFMatrix;
|
2016-03-14 09:04:03 -07:00
|
|
|
|
2018-12-15 03:30:47 -08:00
|
|
|
float HFOrderGain[MAX_AMBI_ORDER+1]{};
|
2018-12-15 02:42:04 -08:00
|
|
|
al::vector<CoeffArray> HFMatrix;
|
2016-03-14 09:04:03 -07:00
|
|
|
|
2018-11-11 20:40:37 -08: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 */
|