Include fmt 11.0.2
[openal-soft.git] / core / ambdec.h
blob587a30c666ce613e2160b9ae366fcf6ab8c1d391
1 #ifndef CORE_AMBDEC_H
2 #define CORE_AMBDEC_H
4 #include <array>
5 #include <memory>
6 #include <optional>
7 #include <string>
8 #include <vector>
10 #include "alspan.h"
11 #include "core/ambidefs.h"
13 /* Helpers to read .ambdec configuration files. */
15 enum class AmbDecScale {
16 Unset,
17 N3D,
18 SN3D,
19 FuMa,
21 struct AmbDecConf {
22 std::string Description;
23 int Version{0}; /* Must be 3 */
25 unsigned int ChanMask{0u};
26 unsigned int FreqBands{0u}; /* Must be 1 or 2 */
27 AmbDecScale CoeffScale{AmbDecScale::Unset};
29 float XOverFreq{0.0f};
30 float XOverRatio{0.0f};
32 struct SpeakerConf {
33 std::string Name;
34 float Distance{0.0f};
35 float Azimuth{0.0f};
36 float Elevation{0.0f};
37 std::string Connection;
39 std::vector<SpeakerConf> Speakers;
41 using CoeffArray = std::array<float,MaxAmbiChannels>;
42 std::vector<CoeffArray> Matrix;
44 /* Unused when FreqBands == 1 */
45 std::array<float,MaxAmbiOrder+1> LFOrderGain{};
46 al::span<CoeffArray> LFMatrix;
48 std::array<float,MaxAmbiOrder+1> HFOrderGain{};
49 al::span<CoeffArray> HFMatrix;
51 ~AmbDecConf();
53 std::optional<std::string> load(const char *fname) noexcept;
56 #endif /* CORE_AMBDEC_H */