2 #include <Process/TimeValue.hpp>
4 #include <Scenario/Document/TimeRuler/TimeRuler.hpp>
6 #include <score/model/ColorReference.hpp>
8 #include <ossia/editor/scenario/time_value.hpp>
10 #include <ossia-qt/time.hpp>
13 #include <QGraphicsItem>
14 #include <QPainterPath>
17 #include <QTextLayout>
19 #include <score_plugin_scenario_export.h>
24 class QGraphicsSceneMouseEvent;
26 class QStyleOptionGraphicsItem;
35 ,
public QGraphicsItem
39 qreal width()
const {
return m_width; }
40 void setWidth(qreal newWidth);
41 void setStartPoint(ossia::time_value dur);
42 virtual void setZoomRatio(
double factor) = 0;
45 void drag(QPointF arg_1, QPointF arg_2) W_SIGNAL(drag, arg_1, arg_2);
46 void rescale() W_SIGNAL(rescale);
49 virtual void createRulerPath() = 0;
50 virtual void computeGraduationSpacing() = 0;
51 QRectF boundingRect()
const final override;
52 void mousePressEvent(QGraphicsSceneMouseEvent*)
final override;
53 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent*)
final override;
54 void mouseMoveEvent(QGraphicsSceneMouseEvent*)
final override;
55 void mouseReleaseEvent(QGraphicsSceneMouseEvent*)
final override;
56 ossia::time_value m_startPoint{};
62 Q_INTERFACES(QGraphicsItem)
76 void paint(QPainter* painter,
const QStyleOptionGraphicsItem* option, QWidget* widget)
79 qreal graduationSpacing()
const
81 return m_intervalsBetweenMark * m_graduationsSpacing;
84 void computeGraduationSpacing()
override;
85 void createRulerPath()
override;
86 void setZoomRatio(
double factor)
final override;
91 std::chrono::nanoseconds time;
95 double m_pixelPerMillis{0.01};
97 std::vector<Mark> m_marks;
99 qreal m_graduationsSpacing{};
100 qreal m_graduationDelta{};
101 qreal m_intervalsBetweenMark{};
102 Format m_timeFormat{};
106 QGraphicsView* m_viewport{};
108 QGlyphRun getGlyphs(std::chrono::nanoseconds);
109 QTextLayout m_layout;
110 std::deque<std::pair<std::chrono::nanoseconds, QGlyphRun>> m_stringCache;
115 Q_INTERFACES(QGraphicsItem)
129 void paint(QPainter* painter,
const QStyleOptionGraphicsItem* option, QWidget* widget)
132 void computeGraduationSpacing()
override;
133 void createRulerPath()
override;
134 void setZoomRatio(
double factor)
final override;
137 QPointer<MusicalGrid> m_grid{};
139 QGraphicsView* m_viewport{};
141 QGlyphRun getGlyphs(ossia::bar_time timings, ossia::bar_time increments);
142 QTextLayout m_layout;
143 std::deque<std::tuple<ossia::bar_time, ossia::bar_time, QGlyphRun>> m_stringCache;
Definition: MusicalGrid.hpp:16
Definition: TimeRuler.hpp:114
Definition: TimeRuler.hpp:36
Definition: TimeRuler.hpp:61
Main plug-in of score.
Definition: score-plugin-dataflow/Dataflow/PortItem.hpp:14