Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
audio_clip_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 <QtQmlIntegration>
10
11namespace zrythm::structure::arrangement
12{
18class AudioClipEditor : public QObject
19{
20 Q_OBJECT
21 QML_ELEMENT
22 Q_PROPERTY (
24 getEditorSettings CONSTANT FINAL)
25
26public:
27 AudioClipEditor (QObject * parent = nullptr) : QObject (parent) { }
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 AudioClipEditor &obj,
40 const AudioClipEditor &other,
41 utils::ObjectCloneType clone_type)
42 {
43 obj.editor_settings_ =
44 utils::clone_unique_qobject (*other.editor_settings_, &obj);
45 }
46
47private:
48 static constexpr auto kEditorSettingsKey = "editorSettings"sv;
49 friend void to_json (nlohmann::json &j, const AudioClipEditor &editor)
50 {
51 j[kEditorSettingsKey] = editor.editor_settings_;
52 }
53 friend void from_json (const nlohmann::json &j, AudioClipEditor &editor)
54 {
55 j.at (kEditorSettingsKey).get_to (editor.editor_settings_);
56 }
57
58private:
60 this } };
61};
62
63}
A unique pointer for QObject objects that also works with QObject-based ownership.
Definition qt.h:38