-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfourdsound_model.hpp
More file actions
83 lines (70 loc) · 1.94 KB
/
fourdsound_model.hpp
File metadata and controls
83 lines (70 loc) · 1.94 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#pragma once
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <string>
#include <vector>
#include <optional>
//////////////////////////////
// 4D Sound data model
//////////////////////////////
namespace spatparse::fourdsound
{
struct speaker
{
std::string id;
int ch;
double x, y, z;
std::string speakerType;
};
struct shape
{
std::string type;
std::string speakers; // Space-separated speaker IDs
};
struct grid
{
std::string name;
std::optional<std::string> speakerType;
std::vector<shape> shapes;
std::optional<double> projectionPoint_x;
std::optional<double> projectionPoint_y;
std::optional<double> projectionPoint_z;
};
struct group
{
std::string name;
std::string channels; // Space-separated channel numbers
};
struct wall
{
std::string name;
std::string channels; // Space-separated channel numbers
};
struct routing
{
std::string value; // Space-separated routing values
};
struct file
{
std::optional<std::string> version;
std::vector<speaker> speakers;
std::vector<grid> grids;
std::vector<group> groups;
std::vector<wall> walls;
std::optional<routing> routing_info;
};
using speaker_t = speaker;
using shape_t = shape;
using grid_t = grid;
using group_t = group;
using wall_t = wall;
using routing_t = routing;
using file_t = file;
}
BOOST_FUSION_ADAPT_STRUCT(spatparse::fourdsound::speaker, id, ch, x, y, z, speakerType)
BOOST_FUSION_ADAPT_STRUCT(spatparse::fourdsound::shape, type, speakers)
BOOST_FUSION_ADAPT_STRUCT(spatparse::fourdsound::grid, name, speakerType, shapes, projectionPoint_x, projectionPoint_y, projectionPoint_z)
BOOST_FUSION_ADAPT_STRUCT(spatparse::fourdsound::group, name, channels)
BOOST_FUSION_ADAPT_STRUCT(spatparse::fourdsound::wall, name, channels)
BOOST_FUSION_ADAPT_STRUCT(spatparse::fourdsound::routing, value)
BOOST_FUSION_ADAPT_STRUCT(spatparse::fourdsound::file, version, speakers, grids, groups, walls, routing_info)