🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.0 KiB

  1. #ifndef AMBDEC_H
  2. #define AMBDEC_H
  3. #include <array>
  4. #include <string>
  5. #include "ambidefs.h"
  6. #include "vector.h"
  7. /* Helpers to read .ambdec configuration files. */
  8. enum class AmbDecScale {
  9. N3D,
  10. SN3D,
  11. FuMa,
  12. };
  13. struct AmbDecConf {
  14. std::string Description;
  15. int Version{0}; /* Must be 3 */
  16. unsigned int ChanMask{0u};
  17. unsigned int FreqBands{0u}; /* Must be 1 or 2 */
  18. AmbDecScale CoeffScale{};
  19. float XOverFreq{0.0f};
  20. float XOverRatio{0.0f};
  21. struct SpeakerConf {
  22. std::string Name;
  23. float Distance{0.0f};
  24. float Azimuth{0.0f};
  25. float Elevation{0.0f};
  26. std::string Connection;
  27. };
  28. al::vector<SpeakerConf> Speakers;
  29. using CoeffArray = std::array<float,MAX_AMBI_CHANNELS>;
  30. /* Unused when FreqBands == 1 */
  31. float LFOrderGain[MAX_AMBI_ORDER+1]{};
  32. al::vector<CoeffArray> LFMatrix;
  33. float HFOrderGain[MAX_AMBI_ORDER+1]{};
  34. al::vector<CoeffArray> HFMatrix;
  35. int load(const char *fname) noexcept;
  36. };
  37. #endif /* AMBDEC_H */