]> git.sesse.net Git - kdenlive/blob - src/cornerswidget.h
const'ref. Fix indent
[kdenlive] / src / cornerswidget.h
1 /***************************************************************************
2  *   Copyright (C) 2010 by Till Theato (root@ttill.de)                     *
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 CORNERSWIDGET_H
22 #define CORNERSWIDGET_H
23
24 #include "keyframeedit.h"
25
26
27 class QDomElement;
28 class Monitor;
29 class MonitorScene;
30 class OnMonitorCornersItem;
31
32
33 class CornersWidget : public KeyframeEdit
34 {
35     Q_OBJECT
36 public:
37     /** @brief Sets up the UI and connects it.
38      * @param monitor Project monitor
39      * @param clipPos Position of the clip in timeline
40      * @param isEffect true if used in an effect, false if used in a transition
41      * @param factor Factor by which the parameters differ from the range 0-1
42      * @param parent (optional) Parent widget */
43     explicit CornersWidget(Monitor *monitor, const QDomElement &e, int minFrame, int maxFrame, const Timecode &tc, int activeKeyframe, QWidget* parent = 0);
44     virtual ~CornersWidget();
45
46     virtual void addParameter(const QDomElement &e, int activeKeyframe = -1);
47
48 public slots:
49     /** @brief Updates the on-monitor item.  */
50     void slotSyncPosition(int relTimelinePos);
51
52 private:
53     Monitor *m_monitor;
54     MonitorScene *m_scene;
55     OnMonitorCornersItem *m_item;
56     bool m_showScene;
57     int m_pos;
58
59     /** @brief Returns the corner positions set in the row of @param keyframe. */
60     QList <QPointF> getPoints(QTableWidgetItem *keyframe);
61
62 private slots:
63
64     /** @brief Updates the on-monitor item according to the current timeline position. */
65     void slotUpdateItem();
66     /** @brief Updates the keyframe editor according to the on-monitor item. */
67     void slotUpdateProperties();
68
69     /** @brief Inserts a keyframe at the current (playback) position (m_pos). */
70     void slotInsertKeyframe();
71
72     /** @brief Shows/Hides the lines connecting the corners in the on-monitor item according to @param show. */
73     void slotShowLines(bool show = true);
74
75     /** @brief Shows/Hides additional controls on the monitor according to @param show. */
76     void slotShowControls(bool show = true);
77 };
78
79 #endif