Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
chord_region.h
1// SPDX-FileCopyrightText: © 2019-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_owner.h"
7#include "structure/arrangement/chord_object.h"
8
9namespace zrythm::structure::arrangement
10{
11class ChordRegion final
12 : public ArrangerObject,
13 public ArrangerObjectOwner<ChordObject>
14{
15 Q_OBJECT
16 DEFINE_ARRANGER_OBJECT_OWNER_QML_PROPERTIES (
18 chordObjects,
20 QML_ELEMENT
21 QML_UNCREATABLE ("")
22
23public:
25 const dsp::TempoMap &tempo_map,
26 utils::IObjectRegistry &registry,
27 QObject * parent = nullptr);
28
29 // ========================================================================
30 // QML Interface
31 // ========================================================================
32
33 // ========================================================================
34
35 std::string
36 get_field_name_for_serialization (const ChordObject *) const override
37 {
38 return "chordObjects";
39 }
40
41 std::vector<ArrangerObjectListModel *> get_child_list_models () const override
42 {
43 return { ArrangerObjectOwner<ChordObject>::get_model () };
44 }
45
46private:
47 friend void init_from (
48 ChordRegion &obj,
49 const ChordRegion &other,
50 utils::ObjectCloneType clone_type);
51
52 friend void to_json (nlohmann::json &j, const ChordRegion &region)
53 {
54 to_json (j, static_cast<const ArrangerObject &> (region));
55 to_json (j, static_cast<const ArrangerObjectOwner &> (region));
56 }
57 friend void from_json (const nlohmann::json &j, ChordRegion &region)
58 {
59 from_json (j, static_cast<ArrangerObject &> (region));
60 from_json (j, static_cast<ArrangerObjectOwner &> (region));
61 }
62
63private:
64 BOOST_DESCRIBE_CLASS (
66 (ArrangerObject, ArrangerObjectOwner<ChordObject>),
67 (),
68 (),
69 ())
70};
71
72}
ArrangerObject(Type type, const dsp::TempoMap &tempo_map, ArrangerObjectFeatures features, QObject *parent=nullptr) noexcept
Construct a new ArrangerObject.
The ChordObject class represents a chord inside the chord editor.
Abstract interface for a UUID-keyed object registry.