Zrythm v2.0.0-alpha.1
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
chord_clip_canvas_item.h
1// SPDX-FileCopyrightText: © 2026 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "gui/qquick/clip_canvas_item_base.h"
7
8#include <QColor>
9#include <QFont>
10#include <QPointer>
11
12namespace zrythm::structure::arrangement
13{
14class ChordClip;
15}
16
17namespace zrythm::gui::qquick
18{
19
21
29class ChordClipCanvasItem : public ClipCanvasItemBase
30{
31 Q_OBJECT
32 QML_NAMED_ELEMENT (ChordClipCanvas)
33
34 Q_PROPERTY (
35 zrythm::structure::arrangement::ChordClip * chordClip READ chordClip WRITE
36 setChordClip NOTIFY chordClipChanged)
37 Q_PROPERTY (
38 QColor textColor READ textColor WRITE setTextColor NOTIFY textColorChanged)
39 Q_PROPERTY (QFont font READ font WRITE setFont NOTIFY fontChanged)
40
41public:
42 explicit ChordClipCanvasItem (QQuickItem * parent = nullptr);
43
44 QCanvasPainterItemRenderer * createItemRenderer () const override;
45
46 structure::arrangement::ChordClip * chordClip () const { return chord_clip_; }
47 void setChordClip (structure::arrangement::ChordClip * clip);
48
49 QColor textColor () const { return text_color_; }
50 void setTextColor (const QColor &color);
51
52 QFont font () const { return font_; }
53 void setFont (const QFont &font);
54
55Q_SIGNALS:
56 void chordClipChanged ();
57 void textColorChanged ();
58 void fontChanged ();
59
60private:
61 QPointer<structure::arrangement::ChordClip> chord_clip_;
62 QColor text_color_;
63 QFont font_;
64 std::vector<QMetaObject::Connection> clip_connections_;
65};
66
67} // namespace zrythm::gui::qquick
Renders chord clip content (colored cells, separator lines, chord names with LOD).