1 /***************************************************************************
2 * Copyright (C) 2012 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
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 ***************************************************************************/
20 #ifndef PARAMETERCONTAINER_H
21 #define PARAMETERCONTAINER_H
23 #include "keyframeedit.h"
28 struct EffectMetaInfo {
29 MltVideoProfile profile;
36 enum WIPE_DIRECTON { UP = 0, DOWN = 1, LEFT = 2, RIGHT = 3, CENTER = 4 };
41 int startTransparency;
45 class MySpinBox : public QSpinBox
50 MySpinBox(QWidget * parent = 0);
53 virtual void focusInEvent(QFocusEvent*);
54 virtual void focusOutEvent(QFocusEvent*);
57 class ParameterContainer : public QObject
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 /** @brief Set keyframes for this param. */
70 void setKeyframes(const QString &data, int maximum);
71 /** @brief Update the in / out for the clip. */
72 void setRange(int inPoint, int outPoint);
75 void slotCollectAllParameters();
76 void slotStartFilterJobAction();
79 /** @brief Updates parameter @param name according to new value of dependency.
80 * @param name Name of the parameter which will be updated
81 * @param type Type of the parameter which will be updated
82 * @param value Value of the dependency parameter */
83 void meetDependency(const QString& name, QString type, QString value);
84 wipeInfo getWipeInfo(QString value);
85 QString getWipeString(wipeInfo info);
86 /** @brief Delete all child widgets */
87 void clearLayout(QLayout *layout);
91 QList<QWidget*> m_uiItems;
92 QMap<QString, QWidget*> m_valueItems;
94 KeyframeEdit *m_keyframeEditor;
95 GeometryWidget *m_geometryWidget;
96 EffectMetaInfo *m_metaInfo;
99 bool m_needsMonitorEffectScene;
102 void parameterChanged(const QDomElement, const QDomElement, int);
103 void syncEffectsPos(int);
104 void displayMessage(const QString&, int);
105 void disableCurrentFilter(bool);
106 void checkMonitorPosition(int);
107 void seekTimeline(int);
108 void showComments(bool);
109 /** @brief Start an MLT filter job on this clip. */
110 void startFilterJob(QString filterName, QString filterParams, QString consumer, QString consumerParams, const QMap <QString, QString>extra);
111 /** @brief Request import of keyframes from clip data. */
112 void importClipKeyframes();
113 /** @brief Master clip was resized, update effect. */
114 void updateRange(int inPoint, int outPoint);