]> git.sesse.net Git - kdenlive/blob - src/simplekeyframes/simpletimelinewidget.h
rotoscoping: Fix keyframes with crop from start > 0
[kdenlive] / src / simplekeyframes / simpletimelinewidget.h
1 /***************************************************************************
2  *   Copyright (C) 2011 by Till Theato (root@ttill.de)                     *
3  *   This file is part of Kdenlive (www.kdenlive.org).                     *
4  *                                                                         *
5  *   Kdenlive is free software: you can redistribute it and/or modify      *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation, either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   Kdenlive is distributed in the hope that it will be useful,           *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with Kdenlive.  If not, see <http://www.gnu.org/licenses/>.     *
17  ***************************************************************************/
18
19 #ifndef SIMPLETIMELINEWIDGET_H
20 #define SIMPLETIMELINEWIDGET_H
21
22 #include <QtCore>
23 #include <QWidget>
24
25 class SimpleTimelineWidget : public QWidget
26 {
27     Q_OBJECT
28
29 public:
30     SimpleTimelineWidget(QWidget* parent = 0);
31     void setKeyframes(QList <int> keyframes);
32     void setDuration(int dur);
33
34 public slots:
35     void slotSetPosition(int pos);
36     void slotRemoveKeyframe(int pos);
37     void slotAddKeyframe(int pos = - 1, int select = false);
38     void slotAddRemove();
39     void slotGoToNext();
40     void slotGoToPrev();
41
42 protected:
43     void paintEvent(QPaintEvent *event);
44     void mousePressEvent(QMouseEvent *event);
45     void mouseReleaseEvent(QMouseEvent *event);
46     void mouseMoveEvent(QMouseEvent *event);
47     void wheelEvent(QWheelEvent *event);
48
49 private:
50     int m_duration;
51     int m_position;
52     int m_currentKeyframe;
53     int m_currentKeyframeOriginal;
54     QList <int> m_keyframes;
55     int m_lineHeight;
56     double m_scale;
57
58 signals:
59     void positionChanged(int pos);
60
61     void keyframeSelected();
62     void keyframeMoving(int oldPos, int currentPos);
63     void keyframeMoved(int oldPos, int newPos);
64     void keyframeAdded(int pos);
65     void keyframeRemoved(int pos);
66 };
67
68 #endif