22class ClipEditor :
public QObject
25 Q_PROPERTY (QVariant region READ region NOTIFY regionChanged)
26 Q_PROPERTY (QVariant track READ track NOTIFY regionChanged)
32 getChordEditor CONSTANT FINAL)
35 getAudioClipEditor CONSTANT FINAL)
38 getAutomationEditor CONSTANT FINAL)
42 using TrackUuid = structure::tracks::TrackUuid;
55 return piano_roll_.get ();
59 return chord_editor_.get ();
63 return audio_clip_editor_.get ();
67 return automation_editor_.get ();
70 QVariant region ()
const;
71 QVariant track ()
const;
72 Q_INVOKABLE
void setRegion (QVariant region, QVariant track);
73 Q_INVOKABLE
void unsetRegion ();
74 Q_SIGNAL
void regionChanged (QVariant region);
93 bool has_region ()
const {
return region_id_.has_value (); }
95 std::optional<std::pair<ArrangerObject *, Track *>>
96 get_region_and_track ()
const;
98 friend void init_from (
104 static constexpr auto kRegionIdKey =
"regionId"sv;
105 static constexpr auto kPianoRollKey =
"pianoRoll"sv;
106 static constexpr auto kAutomationEditorKey =
"automationEditor"sv;
107 static constexpr auto kChordEditorKey =
"chordEditor"sv;
108 static constexpr auto kAudioClipEditorKey =
"audioClipEditor"sv;
109 friend void to_json (nlohmann::json &j,
const ClipEditor &editor);
110 friend void from_json (
const nlohmann::json &j,
ClipEditor &editor);
116 std::optional<std::pair<ArrangerObject::Uuid, TrackUuid>> region_id_;