]> git.sesse.net Git - kdenlive/blob - src/effectstack/parametercontainer.h
Cleanup effect stack (part 2) - show monitor scene when required
[kdenlive] / src / effectstack / parametercontainer.h
1 /***************************************************************************
2  *   Copyright (C) 2012 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 #ifndef PARAMETERCONTAINER_H
21 #define PARAMETERCONTAINER_H
22
23 #include "keyframeedit.h"
24
25 class GeometryWidget;
26 class Monitor;
27
28 struct EffectMetaInfo {
29     MltVideoProfile profile;
30     Timecode timecode;
31     Monitor *monitor;
32     QPoint frameSize;
33     bool trackMode;
34 };
35
36 enum WIPE_DIRECTON { UP = 0, DOWN = 1, LEFT = 2, RIGHT = 3, CENTER = 4 };
37
38 struct wipeInfo {
39     WIPE_DIRECTON start;
40     WIPE_DIRECTON end;
41     int startTransparency;
42     int endTransparency;
43 };
44
45 class MySpinBox : public QSpinBox
46 {
47     Q_OBJECT
48
49 public:
50     MySpinBox(QWidget * parent = 0);
51     
52 protected:
53     virtual void focusInEvent(QFocusEvent*);
54     virtual void focusOutEvent(QFocusEvent*);
55 };
56
57 class ParameterContainer : public QObject
58 {
59     Q_OBJECT
60
61 public:
62     ParameterContainer(QDomElement effect, ItemInfo info, EffectMetaInfo *metaInfo, QWidget * parent = 0);
63     ~ParameterContainer();
64     void updateTimecodeFormat();
65     void updateProjectFormat(MltVideoProfile profile, Timecode t);
66     void updateParameter(const QString &key, const QString &value);
67     /** @brief Returns true of this effect requires an on monitor adjustable effect scene. */
68     bool needsMonitorEffectScene() const;
69
70 private slots:
71     void slotCollectAllParameters();
72     void slotStartFilterJobAction();
73
74 private:
75         /** @brief Updates parameter @param name according to new value of dependency.
76     * @param name Name of the parameter which will be updated
77     * @param type Type of the parameter which will be updated
78     * @param value Value of the dependency parameter */
79     void meetDependency(const QString& name, QString type, QString value);
80     wipeInfo getWipeInfo(QString value);
81     QString getWipeString(wipeInfo info);
82     /** @brief Delete all child widgets */
83     void clearLayout(QLayout *layout);
84     
85     int m_in;
86     int m_out;
87     QList<QWidget*> m_uiItems;
88     QMap<QString, QWidget*> m_valueItems;
89     Timecode m_timecode;
90     KeyframeEdit *m_keyframeEditor;
91     GeometryWidget *m_geometryWidget;
92     EffectMetaInfo *m_metaInfo;
93     QDomElement m_effect;
94     QVBoxLayout *m_vbox;
95     bool m_needsMonitorEffectScene;
96
97 signals:
98     void parameterChanged(const QDomElement, const QDomElement, int);
99     void syncEffectsPos(int);
100     void effectStateChanged(bool);
101     void checkMonitorPosition(int);
102     void seekTimeline(int);
103     void showComments(bool);    
104     /** @brief Start an MLT filter job on this clip. */
105     void startFilterJob(QString filterName, QString filterParams, QString finalFilterName, QString consumer, QString consumerParams, QString properties);
106     
107 };
108
109 #endif
110