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-2025 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
11namespace zrythm::gui::backend
12{
13
14class ArrangerTool : public QObject
15{
16 Q_OBJECT
17 QML_ELEMENT
18 Q_PROPERTY (
19 int toolValue READ toolValue WRITE setToolValue NOTIFY toolValueChanged)
20
21public:
22 enum ToolType : std::uint8_t
23 {
24 Select,
25 Edit,
26 Cut,
27 Eraser,
28 Ramp,
29 Audition,
30 };
31 Q_ENUM (ToolType)
32
33 ArrangerTool (QObject * parent = nullptr);
34 Z_DISABLE_COPY_MOVE (ArrangerTool)
35 ~ArrangerTool () override;
36
37 [[nodiscard]] int toolValue () const;
38 void setToolValue (int tool);
39 Q_SIGNAL void toolValueChanged (int tool);
40
41 friend void init_from (
42 ArrangerTool &obj,
43 const ArrangerTool &other,
44 utils::ObjectCloneType clone_type);
45
46private:
47 friend void to_json (nlohmann::json &j, const ArrangerTool &tool);
48 friend void from_json (const nlohmann::json &j, ArrangerTool &tool);
49
50private:
51 ToolType tool_{ ToolType::Select };
52};
53
54}; // namespace zrythm::gui::backend