1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) 2012-2017 VideoStitch SAS
// Copyright (c) 2018 stitchEm
// Ambisonic decoder coefficients parser
#pragma once
#include "object.hpp"
#include "status.hpp"
#include "audio.hpp"
namespace VideoStitch {
namespace Ptv {
class Value;
}
namespace Audio {
typedef std::map<ChannelMap, std::map<ChannelMap, double>> channelCoefTable_t;
typedef std::map<ChannelLayout, channelCoefTable_t> ambCoefTable_t;
class AmbisonicDecoderDef : public Ptv::Object {
public:
explicit AmbisonicDecoderDef(const Ptv::Value& value);
~AmbisonicDecoderDef();
const ambCoefTable_t& getCoefficients() const;
PotentialValue<channelCoefTable_t> getCoefficientsByLayout(ChannelLayout layout) const;
Ptv::Value* serialize() const;
AmbisonicDecoderDef* clone();
void setCoef(const Ptv::Value& value);
private:
AmbisonicDecoderDef(const ambCoefTable_t& coefs, const std::string& order);
void parseFirstOrderCoef(const Ptv::Value* v, ChannelLayout layout, ChannelMap out);
ambCoefTable_t _coefs;
std::string _order;
bool _isValid;
};
} // namespace Audio
} // namespace VideoStitch