14class RegionMixin :
public QObject
41 friend void init_from (
43 const RegionMixin &other,
46 init_from (*obj.bounds_, *other.bounds_, clone_type);
47 init_from (*obj.loop_range_, *other.loop_range_, clone_type);
48 init_from (*obj.name_, *other.name_, clone_type);
49 init_from (*obj.color_, *other.color_, clone_type);
50 init_from (*obj.mute_, *other.mute_, clone_type);
54 static constexpr auto kBoundsKey =
"bounds"sv;
55 static constexpr auto kLoopRangeKey =
"loop_range"sv;
56 static constexpr auto kNameKey =
"name"sv;
57 static constexpr auto kColorKey =
"color"sv;
58 static constexpr auto kMuteKey =
"mute"sv;
59 friend void to_json (nlohmann::json &j,
const RegionMixin ®ion)
61 j[kBoundsKey] = region.bounds_;
62 j[kLoopRangeKey] = region.loop_range_;
63 j[kNameKey] = region.name_;
64 j[kColorKey] = region.color_;
65 j[kMuteKey] = region.mute_;
67 friend void from_json (
const nlohmann::json &j, RegionMixin ®ion)
69 j.at (kBoundsKey).get_to (*region.bounds_);
70 j.at (kLoopRangeKey).get_to (*region.loop_range_);
71 j.at (kNameKey).get_to (*region.name_);
72 j.at (kColorKey).get_to (*region.color_);
73 j.at (kMuteKey).get_to (*region.mute_);
83 BOOST_DESCRIBE_CLASS (
88 (bounds_, loop_range_, mute_, color_, name_))