Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
region_link_group.h
1// SPDX-FileCopyrightText: © 2020-2021, 2024-2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "structure/arrangement/arranger_object.h"
7
8namespace zrythm::structure::arrangement
9{
10
11class Region;
12
16class RegionLinkGroup final
17{
18public:
19 RegionLinkGroup (int idx) : group_idx_ (idx) { }
20 void add_region (Region &region);
21
29 Region &region,
30 bool autoremove_last_region_and_group,
31 bool update_identifier);
32
33 bool contains_region (const Region &region) const;
34
40 void update (const Region &region);
41
42private:
43 static constexpr auto kIdsKey = "ids"sv;
44 friend void to_json (nlohmann::json &j, const RegionLinkGroup &group)
45 {
46 j[kIdsKey] = group.ids_;
47 }
48 friend void from_json (const nlohmann::json &j, RegionLinkGroup &group)
49 {
50 j.at (kIdsKey).get_to (group.ids_);
51 }
52
53public:
56
58 std::vector<ArrangerObject::Uuid> ids_;
59
60 BOOST_DESCRIBE_CLASS (RegionLinkGroup, (), (group_idx_, ids_), (), ())
61};
62
63} // namespace zrythm::structure::arrangement
std::vector< ArrangerObject::Uuid > ids_
Identifiers for regions in this link group.
void remove_region(Region &region, bool autoremove_last_region_and_group, bool update_identifier)
Remove the region from the link group.
void update(const Region &region)
Updates all other regions in the link group.