]> git.sesse.net Git - kdenlive/blob - src/smallruler.h
Merge branch 'master' into audioAlign
[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     SmallRuler(MonitorManager *manager, QWidget *parent = 0);
36     virtual void mousePressEvent(QMouseEvent * event);
37     virtual void mouseMoveEvent(QMouseEvent * event);
38     virtual void leaveEvent( QEvent * event );
39     void adjustScale(int maximum);
40     void setZone(int start, int end);
41     QPoint zone();
42     void setMarkers(QList < int > list);
43     int position() const;
44     void updatePalette();
45
46 protected:
47     virtual void paintEvent(QPaintEvent *e);
48     virtual void resizeEvent(QResizeEvent *);
49
50 private:
51     int m_cursorPosition;
52     int m_cursorFramePosition;
53     double m_scale;
54     int m_medium;
55     int m_small;
56     int m_maxval;
57     int m_zoneStart;
58     int m_zoneEnd;
59     KStatefulBrush m_zoneBrush;
60     QList <int> m_markers;
61     QPixmap m_pixmap;
62     MonitorManager *m_manager;
63     /** @brief True is mouse is over the ruler cursor. */
64     bool m_overCursor;
65     void updatePixmap();
66
67 public slots:
68     bool slotNewValue(int value);
69
70 signals:
71     void seekRenderer(int);
72     void zoneChanged(QPoint);
73 };
74
75 #endif