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 explicit MySpinBox(QWidget * parent = 0);
53 void focusInEvent(QFocusEvent*);
54 void focusOutEvent(QFocusEvent*);
57 class ParameterContainer : public QObject
62 explicit ParameterContainer(const QDomElement &effect, const ItemInfo &info, EffectMetaInfo *metaInfo, QWidget * parent = 0);
63 ~ParameterContainer();
64 void updateTimecodeFormat();
65 void updateParameter(const QString &key, const QString &value);
66 /** @brief Returns true of this effect requires an on monitor adjustable effect scene. */
67 bool needsMonitorEffectScene() const;
68 /** @brief Set keyframes for this param. */
69 void setKeyframes(const QString &data, int maximum);
70 /** @brief Update the in / out for the clip. */
71 void setRange(int inPoint, int outPoint);
74 void slotCollectAllParameters();
75 void slotStartFilterJobAction();
78 /** @brief Updates parameter @param name according to new value of dependency.
79 * @param name Name of the parameter which will be updated
80 * @param type Type of the parameter which will be updated
81 * @param value Value of the dependency parameter */
82 void meetDependency(const QString& name, const QString &type, const QString &value);
83 wipeInfo getWipeInfo(QString value);
84 QString getWipeString(wipeInfo info);
85 /** @brief Delete all child widgets */
86 void clearLayout(QLayout *layout);
90 QList<QWidget*> m_uiItems;
91 QMap<QString, QWidget*> m_valueItems;
93 KeyframeEdit *m_keyframeEditor;
94 GeometryWidget *m_geometryWidget;
95 EffectMetaInfo *m_metaInfo;
98 bool m_needsMonitorEffectScene;
101 void parameterChanged(const QDomElement &, const QDomElement&, int);
102 void syncEffectsPos(int);
103 void displayMessage(const QString&, int);
104 void disableCurrentFilter(bool);
105 void checkMonitorPosition(int);
106 void seekTimeline(int);
107 void showComments(bool);
108 /** @brief Start an MLT filter job on this clip. */
109 void startFilterJob(const QString &filterName, const QString &filterParams, const QString &consumer, const QString &consumerParams, const QMap <QString, QString> &extra);
110 /** @brief Request import of keyframes from clip data. */
111 void importClipKeyframes();
112 /** @brief Master clip was resized, update effect. */
113 void updateRange(int inPoint, int outPoint);