1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
22 * @author Jean-Baptiste Mardelle
23 * @brief Manages the timeline ruler.
31 #include "customtrackview.h"
34 enum RULER_MOVE { RULER_CURSOR = 0, RULER_START = 1, RULER_MIDDLE = 2, RULER_END = 3 };
35 enum MOUSE_MOVE { NO_MOVE = 0, HORIZONTAL_MOVE = 1, VERTICAL_MOVE = 2 };
37 class CustomRuler : public QWidget
42 CustomRuler(Timecode tc, CustomTrackView *parent);
43 void setPixelPerMark(int rate);
44 static const int comboScale[];
47 void setDuration(int d);
48 void setZone(QPoint p);
50 void updateProjectFps(Timecode t);
51 void updateFrameSize();
55 virtual void paintEvent(QPaintEvent * /*e*/);
56 virtual void wheelEvent(QWheelEvent * e);
57 virtual void mousePressEvent(QMouseEvent * event);
58 virtual void mouseReleaseEvent(QMouseEvent * event);
59 virtual void mouseMoveEvent(QMouseEvent * event);
60 virtual void leaveEvent(QEvent * event);
64 CustomTrackView *m_view;
73 int m_lastSeekPosition;
74 RULER_MOVE m_moveCursor;
77 QAction *m_deleteGuide;
79 /** Used for zooming through vertical move */
83 MOUSE_MOVE m_mouseMove;
89 void slotMoveRuler(int newPos);
90 void slotCursorMoved(int oldpos, int newpos);
95 void slotDeleteGuide();
96 void slotGoToGuide(QAction *act);
99 void zoneMoved(int, int);
100 void adjustZoom(int);