Loading...
Searching...
No Matches
score-plugin-media/Media/Step/View.hpp
1#pragma once
2#include <Process/LayerView.hpp>
3
4#include <Media/Step/Commands.hpp>
5
6#include <score/command/Dispatchers/SingleOngoingCommandDispatcher.hpp>
7#include <score/graphics/RectItem.hpp>
8
9#include <QGraphicsSceneMouseEvent>
10#include <QPainter>
11
12#include <verdigris>
13
14namespace Process
15{
16struct Context;
17}
18namespace Media::Step
19{
20class Model;
21
22class View final : public Process::LayerView
23{
24 W_OBJECT(View)
25public:
26 explicit View(const Model&, QGraphicsItem* parent);
27 ~View();
28
29 void setBarWidth(double v);
30
31public:
32 void change(int arg_1, float arg_2) W_SIGNAL(change, arg_1, arg_2);
33
34private:
35 void paint_impl(QPainter* p) const override;
36
37 void mousePressEvent(QGraphicsSceneMouseEvent* ev) override;
38 void mouseMoveEvent(QGraphicsSceneMouseEvent* ev) override;
39 void mouseReleaseEvent(QGraphicsSceneMouseEvent* ev) override;
40
41private:
42 const Model& m_model;
43 double m_barWidth{};
44};
45
46class Item final : public score::EmptyRectItem
47{
48 W_OBJECT(Item)
49public:
50 explicit Item(const Model&, const Process::Context& ctx, QGraphicsItem* parent);
51 ~Item();
52
53 void setBarWidth(double v);
54
55public:
56 void change(int arg_1, float arg_2) W_SIGNAL(change, arg_1, arg_2);
57
58private:
59 void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
60 final override;
61
62 void mousePressEvent(QGraphicsSceneMouseEvent* ev) override;
63 void mouseMoveEvent(QGraphicsSceneMouseEvent* ev) override;
64 void mouseReleaseEvent(QGraphicsSceneMouseEvent* ev) override;
65
66private:
67 const Model& m_model;
69};
70
71void updateSteps(
73 std::size_t num, float v);
74
75}
Definition score-plugin-media/Media/Step/View.hpp:47
Definition score-plugin-media/Media/Step/Model.hpp:23
Definition score-plugin-media/Media/Step/View.hpp:23
Definition LayerView.hpp:21
The SingleOngoingCommandDispatcher class.
Definition SingleOngoingCommandDispatcher.hpp:17
Definition RectItem.hpp:64
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1324
Definition ProcessContext.hpp:12