]> git.sesse.net Git - kdenlive/blob - src/customruler.h
Rewrote the handling of timeline in QGraphicsView. Now we use the built in zoom featu...
[kdenlive] / src / customruler.h
1 #ifndef CUSTOMRULER_H
2 #define CUSTOMRULER_H
3
4 #include <KRuler>
5
6 #include "customtrackview.h"
7 #include "timecode.h"
8
9 enum RULER_MOVE { RULER_CURSOR = 0, RULER_START = 1, RULER_MIDDLE = 2, RULER_END = 3 };
10
11 class CustomRuler : public KRuler {
12     Q_OBJECT
13
14 public:
15     CustomRuler(Timecode tc, CustomTrackView *parent);
16     void setPixelPerMark(double rate);
17     static const int comboScale[];
18     int outPoint() const;
19     int inPoint() const;
20     void setDuration(int d);
21
22 protected:
23     virtual void paintEvent(QPaintEvent * /*e*/);
24     virtual void wheelEvent(QWheelEvent * e);
25     virtual void mousePressEvent(QMouseEvent * event);
26     virtual void mouseMoveEvent(QMouseEvent * event);
27
28 private:
29     int m_cursorPosition;
30     Timecode m_timecode;
31     CustomTrackView *m_view;
32     int m_zoneStart;
33     int m_zoneEnd;
34     int m_duration;
35     double m_textSpacing;
36     double m_factor;
37     RULER_MOVE m_moveCursor;
38     QMenu *m_contextMenu;
39
40 public slots:
41     void slotMoveRuler(int newPos);
42     void slotCursorMoved(int oldpos, int newpos);
43 };
44
45 #endif