]> git.sesse.net Git - kdenlive/blob - src/rotoscoping/rotowidget.h
First work on rotoscoping GUI
[kdenlive] / src / rotoscoping / rotowidget.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 ROTOWIDGET_H
20 #define ROTOWIDGET_H
21
22 #include "bpoint.h"
23
24 #include <QWidget>
25
26 class Monitor;
27 class MonitorScene;
28 class SplineItem;
29
30 class RotoWidget : public QWidget
31 {
32     Q_OBJECT
33
34 public:
35     RotoWidget(QString data, Monitor *monitor, int in, int out, QWidget* parent = 0);
36     virtual ~RotoWidget();
37
38     QString getSpline();
39
40 public slots:
41     /** @brief Switches from normal monitor to monitor scene according to @param show. */
42     void slotShowScene(bool show = true);
43     /** @brief Updates the on-monitor item.  */
44     void slotSyncPosition(int relTimelinePos);
45
46 signals:
47     void valueChanged();
48     void checkMonitorPosition(int);
49
50
51 private:
52     Monitor *m_monitor;
53     MonitorScene *m_scene;
54     bool m_showScene;
55     QVariant m_data;
56     SplineItem *m_item;
57     int m_in;
58     int m_out;
59     int m_pos;
60
61 private slots:
62     /** @brief Makes sure the monitor effect scene is only visible if the clip this geometry belongs to is visible.
63     * @param renderPos Postion of the Monitor / Timeline cursor */
64     void slotCheckMonitorPosition(int renderPos);
65
66     void slotUpdateData();
67 };
68
69 #endif