Zrythm v2.0.0-DEV
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 ArrangerObjectRegistry &object_registry,
27 dsp::FileAudioSourceRegistry &file_audio_source_registry,
28 QObject * parent = nullptr);
29
30 // ========================================================================
31 // QML Interface
32 // ========================================================================
33
34 // ========================================================================
35
36 std::string
37 get_field_name_for_serialization (const ChordObject *) const override
38 {
39 return "chordObjects";
40 }
41
42private:
43 friend void init_from (
44 ChordRegion &obj,
45 const ChordRegion &other,
46 utils::ObjectCloneType clone_type);
47
48 friend void to_json (nlohmann::json &j, const ChordRegion &region)
49 {
50 to_json (j, static_cast<const ArrangerObject &> (region));
51 to_json (j, static_cast<const ArrangerObjectOwner &> (region));
52 }
53 friend void from_json (const nlohmann::json &j, ChordRegion &region)
54 {
55 from_json (j, static_cast<ArrangerObject &> (region));
56 from_json (j, static_cast<ArrangerObjectOwner &> (region));
57 }
58
59private:
60 BOOST_DESCRIBE_CLASS (
62 (ArrangerObject, ArrangerObjectOwner<ChordObject>),
63 (),
64 (),
65 ())
66};
67
68}
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.