]> git.sesse.net Git - kdenlive/blob - src/smallruler.h
Fix timeline seek sometimes not refreshing on last frame of the seek, small update...
[kdenlive] / src / smallruler.h
1 /***************************************************************************
2  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
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.                                   *
8  *                                                                         *
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.                          *
13  *                                                                         *
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  ***************************************************************************/
19
20
21 #ifndef SMALLRULER_H
22 #define SMALLRULER_H
23
24 #include <KColorScheme>
25 #include <QWidget>
26
27 #include "monitormanager.h"
28
29
30 class SmallRuler : public QWidget
31 {
32     Q_OBJECT
33
34 public:
35     explicit SmallRuler(Monitor *manager, Render *render, QWidget *parent = 0);
36     virtual void mousePressEvent(QMouseEvent * event);
37     virtual void mouseMoveEvent(QMouseEvent * event);
38     virtual void mouseReleaseEvent(QMouseEvent * event);
39     void adjustScale(int maximum);
40     void setZone(int start, int end);
41     void setZoneStart();
42     void setZoneEnd();
43     QPoint zone();
44     void setMarkers(QList < CommentedTime > list);
45     void updatePalette();
46     void refreshRuler();
47
48 protected:
49     virtual void paintEvent(QPaintEvent *e);
50     virtual void resizeEvent(QResizeEvent *);
51     virtual void leaveEvent(QEvent * event);
52
53 private:
54     int m_cursorPosition;
55     int m_cursorFramePosition;
56     double m_scale;
57     int m_medium;
58     int m_small;
59     int m_maxval;
60     int m_zoneStart;
61     int m_zoneEnd;
62     QColor m_zoneColor;
63     QList <CommentedTime> m_markers;
64     QPixmap m_pixmap;
65     Monitor *m_monitor;
66     Render *m_render;
67     int m_lastSeekPosition;
68     QBrush m_cursorColor;
69     void updatePixmap();
70
71 public slots:
72     bool slotNewValue(int value);
73
74 signals:
75     void zoneChanged(QPoint);
76 };
77
78 #endif