Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
automation_editor.h
1// SPDX-FileCopyrightText: © 2024-2025 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "structure/arrangement/editor_settings.h"
7#include "utils/icloneable.h"
8
9#include <nlohmann/json_fwd.hpp>
10
11namespace zrythm::structure::arrangement
12{
13
17class AutomationEditor : public QObject
18{
19 Q_OBJECT
20 QML_ELEMENT
21 Q_PROPERTY (
23 getEditorSettings CONSTANT FINAL)
24 QML_UNCREATABLE ("")
25
26public:
27 AutomationEditor (QObject * parent = nullptr);
28
29 // =========================================================
30 // QML interface
31 // =========================================================
32
33 auto getEditorSettings () const { return editor_settings_.get (); }
34
35 // =========================================================
36
37public:
38 friend void init_from (
39 AutomationEditor &obj,
40 const AutomationEditor &other,
41 utils::ObjectCloneType clone_type)
42
43 {
44 obj.editor_settings_ =
45 utils::clone_unique_qobject (*other.editor_settings_, &obj);
46 }
47
48private:
49 static constexpr auto kEditorSettingsKey = "editorSettings"sv;
50 friend void to_json (nlohmann::json &j, const AutomationEditor &editor);
51 friend void from_json (const nlohmann::json &j, AutomationEditor &editor);
52
53private:
55};
56
57}
A unique pointer for QObject objects that also works with QObject-based ownership.
Definition qt.h:38