Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
arranger_tool.h
1// SPDX-FileCopyrightText: © 2018-2019, 2024-2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "utils/icloneable.h"
7
8#include <QObject>
9#include <QtQmlIntegration/qqmlintegration.h>
10
11#include <nlohmann/json_fwd.hpp>
12
13namespace zrythm::structure::project
14{
15
16class ArrangerTool : public QObject
17{
18 Q_OBJECT
19 QML_ELEMENT
20 Q_PROPERTY (
21 int toolValue READ toolValue WRITE setToolValue NOTIFY toolValueChanged)
22
23public:
24 enum ToolType : std::uint8_t
25 {
26 Select,
27 Edit,
28 Cut,
29 Eraser,
30 Ramp,
31 Audition,
32 };
33 Q_ENUM (ToolType)
34
35 ArrangerTool (QObject * parent = nullptr);
36 Z_DISABLE_COPY_MOVE (ArrangerTool)
37 ~ArrangerTool () override;
38
39 [[nodiscard]] int toolValue () const;
40 void setToolValue (int tool);
41 Q_SIGNAL void toolValueChanged (int tool);
42
43 friend void init_from (
44 ArrangerTool &obj,
45 const ArrangerTool &other,
46 utils::ObjectCloneType clone_type);
47
48private:
49 friend void to_json (nlohmann::json &j, const ArrangerTool &tool);
50 friend void from_json (const nlohmann::json &j, ArrangerTool &tool);
51
52private:
53 ToolType tool_{ ToolType::Select };
54};
55
56} // namespace zrythm::structure::project