-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathease_model.hpp
More file actions
50 lines (43 loc) · 1.08 KB
/
ease_model.hpp
File metadata and controls
50 lines (43 loc) · 1.08 KB
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
45
46
47
48
49
50
#pragma once
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <string>
#include <vector>
//////////////////////////////
// Our data model
//////////////////////////////
namespace spatparse::ease
{
struct file_header
{
std::string file_type;
double format{};
std::string length_unit;
};
struct loudspeaker
{
std::string label;
double x, y, z;
double ver, hor, rot;
std::string speaker;
int delay;
int align;
std::vector<int>
db_1m; // always 21 but boost.spirit does not support parsing into std::array
int phase;
int watts;
};
struct file
{
file_header header;
std::vector<loudspeaker> loudspeakers;
};
using file_header_t = file_header;
using loudspeaker_t = loudspeaker;
using file_t = file;
}
BOOST_FUSION_ADAPT_STRUCT(spatparse::ease::file_header, file_type, format, length_unit)
BOOST_FUSION_ADAPT_STRUCT(
spatparse::ease::loudspeaker, label, x, y, z, ver, hor, rot, speaker, delay, align,
db_1m, phase, watts)
BOOST_FUSION_ADAPT_STRUCT(spatparse::ease::file, header, loudspeakers)