PatternView.hpp
1 #pragma once
2 #include <State/Message.hpp>
3 
4 #include <Process/LayerView.hpp>
5 
6 namespace Process
7 {
8 class Port;
9 class ControlInlet;
10 class PortFactoryList;
11 }
12 namespace score
13 {
14 struct DocumentContext;
15 class QGraphicsNoteChooser;
16 }
17 namespace Patternist
18 {
19 class ProcessModel;
20 class View final : public Process::LayerView
21 {
22  W_OBJECT(View)
23 public:
24  explicit View(const Patternist::ProcessModel& model, QGraphicsItem* parent);
25  ~View() override;
26 
27  void toggled(int lane, int index) W_SIGNAL(toggled, lane, index);
28  void noteChanged(int lane, int note) W_SIGNAL(noteChanged, lane, note);
29  void noteChangeFinished() W_SIGNAL(noteChangeFinished);
30 
31 private:
32  void updateLanes();
33  void paint_impl(QPainter*) const override;
34 
35  void mousePressEvent(QGraphicsSceneMouseEvent* event) override;
36  void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
37  void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
38  void dropEvent(QGraphicsSceneDragDropEvent* event) override;
39 
40  const Patternist::ProcessModel& m_model;
41 
42  std::vector<score::QGraphicsNoteChooser*> m_lanes;
43  int m_execPosition{-1};
44 };
45 }
Definition: QmlObjects.hpp:114
Definition: PatternModel.hpp:36
Definition: PatternView.hpp:21
Definition: LayerView.hpp:21
Base classes and tools to implement processes and layers.
Definition: JSONVisitor.hpp:1324
Base toolkit upon which the software is built.
Definition: Application.cpp:90