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);
53 virtual void paintEvent(QPaintEvent * /*e*/);
54 virtual void wheelEvent(QWheelEvent * e);
55 virtual void mousePressEvent(QMouseEvent * event);
56 virtual void mouseReleaseEvent(QMouseEvent * event);
57 virtual void mouseMoveEvent(QMouseEvent * event);
61 CustomTrackView *m_view;
72 RULER_MOVE m_moveCursor;
75 QAction *m_deleteGuide;
77 /** Used for zooming through vertical move */
81 MOUSE_MOVE m_mouseMove;
86 void slotMoveRuler(int newPos);
87 void slotCursorMoved(int oldpos, int newpos);
91 void slotDeleteGuide();
92 void slotGoToGuide(QAction *act);
95 void zoneMoved(int, int);