6#include "dsp/chord_descriptor.h"
7#include "gui/dsp/arranger_object.h"
8#include "gui/dsp/muteable_object.h"
9#include "gui/dsp/region_owned_object.h"
10#include "utils/icloneable.h"
18using namespace zrythm;
41 public MuteableObject,
42 public RegionOwnedObject,
43 public ICloneable<ChordObject>
49 ChordDescriptor * chordDescriptor READ getChordDescriptor WRITE
50 setChordDescriptor NOTIFY chordDescriptorChanged)
53 using RegionT = ChordRegion;
56 static constexpr int WIDGET_TRIANGLE_WIDTH = 10;
59 DECLARE_FINAL_ARRANGER_OBJECT_CONSTRUCTORS (
ChordObject)
65 ChordDescriptor * getChordDescriptor ()
const;
67 void setChordDescriptor (ChordDescriptor * descr);
68 Q_SIGNAL
void chordDescriptorChanged (ChordDescriptor *);
72 void set_chord_descriptor (
int index);
74 ArrangerObjectPtrVariant
83 return static_cast<const ArrangerObject &
> (lhs)
84 ==
static_cast<const ArrangerObject &
> (rhs)
86 &&
static_cast<const RegionOwnedObject &
> (lhs)
87 ==
static_cast<const RegionOwnedObject &
> (rhs)
88 &&
static_cast<const MuteableObject &
> (lhs)
89 ==
static_cast<const MuteableObject &
> (rhs);
99 static constexpr std::string_view kChordIndexKey =
"chordIndex";
100 friend void to_json (nlohmann::json &j,
const ChordObject &co)
102 to_json (j,
static_cast<const ArrangerObject &
> (co));
103 to_json (j,
static_cast<const MuteableObject &
> (co));
104 to_json (j,
static_cast<const RegionOwnedObject &
> (co));
107 friend void from_json (
const nlohmann::json &j,
ChordObject &co)
Base class for all objects in the arranger.
auto get_position() const
Getter.
The ChordObject class represents a chord inside a ChordRegion.
utils::Utf8String gen_human_friendly_name() const override
Generates a human readable name for the object.
ArrangerObjectPtrVariant insert_clone_to_project() const override
Inserts the object where it belongs in the project (eg, a Track).
void init_after_cloning(const ChordObject &other, ObjectCloneType clone_type) override
Initializes the cloned object.
ArrangerObjectPtrVariant add_clone_to_project(bool fire_events) const override
Appends the ArrangerObject to where it belongs in the project (eg, a Track), without taking into acco...
bool validate(bool is_project, dsp::FramesPerTick frames_per_tick) const override
Validates the arranger object.
int chord_index_
The index of the chord it belongs to (0 topmost).
A ChordDescriptor describes a chord and is not linked to any specific object by itself.
Lightweight UTF-8 string wrapper with safe conversions.
#define DEFINE_OBJECT_FORMATTER(obj_type, function_prefix, formatter_func)
Defines a formatter for the given object type.