Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
marker.h
1// SPDX-FileCopyrightText: © 2019-2021, 2024-2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "structure/arrangement/arranger_object.h"
7#include "utils/icloneable.h"
8
9#include <nlohmann/json_fwd.hpp>
10
11namespace zrythm::structure::arrangement
12{
13
17class Marker final : public ArrangerObject
18{
19 Q_OBJECT
20 Q_PROPERTY (Marker::MarkerType markerType READ markerType CONSTANT)
21 QML_ELEMENT
22 QML_UNCREATABLE ("")
23
24public:
28 enum class MarkerType : std::uint8_t
29 {
36 };
37 Q_ENUM (MarkerType)
38
39 Marker (
40 const dsp::TempoMap &tempo_map,
41 MarkerType type,
42 QObject * parent = nullptr);
43
44 // ========================================================================
45 // QML Interface
46 // ========================================================================
47
48 auto markerType () const { return marker_type_; }
49
50 Q_INVOKABLE bool isStartMarker () const
51 {
52 return marker_type_ == MarkerType::Start;
53 }
54 Q_INVOKABLE bool isEndMarker () const
55 {
56 return marker_type_ == MarkerType::End;
57 }
58
59 // ========================================================================
60
61private:
62 friend void
63 init_from (Marker &obj, const Marker &other, utils::ObjectCloneType clone_type);
64
65 static constexpr auto kMarkerTypeKey = "markerType"sv;
66 friend void to_json (nlohmann::json &j, const Marker &m);
67 friend void from_json (const nlohmann::json &j, Marker &m);
68
69private:
71 MarkerType marker_type_ = MarkerType::Custom;
72
73 BOOST_DESCRIBE_CLASS (Marker, (ArrangerObject), (), (), (marker_type_))
74};
75
76} // namespace zrythm::structure::arrangement
ArrangerObject(Type type, const dsp::TempoMap &tempo_map, ArrangerObjectFeatures features, QObject *parent=nullptr) noexcept
Construct a new ArrangerObject.
Marker for the MarkerTrack.
Definition marker.h:18
@ End
Song end Marker that cannot be deleted.
Definition marker.h:33
@ Start
Song start Marker that cannot be deleted.
Definition marker.h:31