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