1 /***************************************************************************
2 * Copyright (C) 2010 by Till Theato (root@ttill.de) *
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. *
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. *
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 ***************************************************************************/
21 #ifndef CORNERSWIDGET_H
22 #define CORNERSWIDGET_H
24 #include "keyframeedit.h"
30 class OnMonitorCornersItem;
31 class MonitorSceneControlWidget;
34 class CornersWidget : public KeyframeEdit
38 /** @brief Sets up the UI and connects it.
39 * @param monitor Project monitor
40 * @param clipPos Position of the clip in timeline
41 * @param isEffect true if used in an effect, false if used in a transition
42 * @param factor Factor by which the parameters differ from the range 0-1
43 * @param parent (optional) Parent widget */
44 CornersWidget(Monitor *monitor, QDomElement e, int minFrame, int maxFrame, Timecode tc, int activeKeyframe, QWidget* parent = 0);
45 virtual ~CornersWidget();
47 virtual void addParameter(QDomElement e, int activeKeyframe = -1);
50 /** @brief Switches from normal monitor to monitor scene according to @param show. */
51 void slotShowScene(bool show = true);
55 MonitorScene *m_scene;
56 OnMonitorCornersItem *m_item;
58 MonitorSceneControlWidget *m_config;
61 /** @brief Makes sure the monitor effect scene is only visible if the clip this geometry belongs to is visible.
62 * @param renderPos Postion of the Monitor / Timeline cursor */
63 void slotCheckMonitorPosition(int renderPos);
65 /** @brief Updates the on-monitor item according current values in the keyframe editor. */
66 void slotUpdateItem();
67 /** @brief Updates the keyframe editor according to the on-monitor item. */
68 void slotUpdateProperties();
70 /** @brief Shows/Hides the lines connecting the corners in the on-monitor item according to @param show. */
71 void slotShowLines(bool show = true);
73 /** @brief Shows/Hides additional controls on the monitor according to @param show. */
74 void slotShowControls(bool show = true);
77 void checkMonitorPosition(int);