1 /***************************************************************************
2 * Copyright (C) 2008 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 ***************************************************************************/
21 #ifndef COLLAPSIBLEEFFECT_H
22 #define COLLAPSIBLEEFFECT_H
25 #include "ui_collapsiblewidget_ui.h"
28 #include "keyframeedit.h"
29 #include "effectstackedit.h"
31 #include <QDomElement>
32 #include <QToolButton>
38 struct EffectMetaInfo {
39 MltVideoProfile profile;
46 class MySpinBox : public QSpinBox
51 MySpinBox(QWidget * parent = 0);
54 virtual void focusInEvent(QFocusEvent*);
55 virtual void focusOutEvent(QFocusEvent*);
58 class ParameterContainer : public QObject
63 ParameterContainer(QDomElement effect, ItemInfo info, EffectMetaInfo *metaInfo, int index, QWidget * parent = 0);
64 ~ParameterContainer();
65 void updateTimecodeFormat();
66 void updateProjectFormat(MltVideoProfile profile, Timecode t);
70 void slotCollectAllParameters();
71 void slotStartFilterJobAction();
74 /** @brief Updates parameter @param name according to new value of dependency.
75 * @param name Name of the parameter which will be updated
76 * @param type Type of the parameter which will be updated
77 * @param value Value of the dependency parameter */
78 void meetDependency(const QString& name, QString type, QString value);
79 wipeInfo getWipeInfo(QString value);
80 QString getWipeString(wipeInfo info);
85 QList<QWidget*> m_uiItems;
86 QMap<QString, QWidget*> m_valueItems;
88 KeyframeEdit *m_keyframeEditor;
89 GeometryWidget *m_geometryWidget;
90 EffectMetaInfo *m_metaInfo;
95 void parameterChanged(const QDomElement, const QDomElement, int);
96 void syncEffectsPos(int);
97 void effectStateChanged(bool);
98 void checkMonitorPosition(int);
99 void seekTimeline(int);
100 void showComments(bool);
101 /** @brief Start an MLT filter job on this clip. */
102 void startFilterJob(QString filterName, QString filterParams, QString finalFilterName, QString consumer, QString consumerParams, QString properties);
107 * @class CollapsibleEffect
108 * @brief A dialog for editing markers and guides.
109 * @author Jean-Baptiste Mardelle
112 class CollapsibleEffect : public QWidget, public Ui::CollapsibleWidget_UI
117 CollapsibleEffect(QDomElement effect, QDomElement original_effect, ItemInfo info, int ix, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent = 0);
118 ~CollapsibleEffect();
119 static QMap<QString, QImage> iconCache;
120 void setupWidget(ItemInfo info, int index, EffectMetaInfo *metaInfo);
121 void updateTimecodeFormat();
122 void setActive(bool activate);
123 virtual bool eventFilter( QObject * o, QEvent * e );
124 /** @brief Update effect GUI to reflect parameted changes. */
125 void updateWidget(ItemInfo info, int index, QDomElement effect, EffectMetaInfo *metaInfo);
126 QDomElement effect() const;
129 void slotSyncEffectsPos(int pos);
133 void slotEnable(bool enable);
134 void slotShow(bool show);
135 void slotDeleteEffect();
137 void slotEffectDown();
138 void slotSaveEffect();
139 void slotResetEffect();
142 ParameterContainer *m_paramWidget;
143 QList <CollapsibleEffect *> m_subParamWidgets;
144 QDomElement m_effect;
145 QDomElement m_original_effect;
146 QList <QDomElement> m_subEffects;
155 virtual void mouseDoubleClickEvent ( QMouseEvent * event );
156 virtual void mousePressEvent ( QMouseEvent * event );
157 virtual void enterEvent( QEvent * event );
158 virtual void leaveEvent( QEvent * event );
161 void parameterChanged(const QDomElement, const QDomElement, int);
162 void syncEffectsPos(int);
163 void effectStateChanged(bool, int ix = -1);
164 void deleteEffect(const QDomElement, int);
165 void changeEffectPosition(int, bool);
166 void activateEffect(int);
167 void checkMonitorPosition(int);
168 void seekTimeline(int);
169 /** @brief Start an MLT filter job on this clip. */
170 void startFilterJob(QString filterName, QString filterParams, QString finalFilterName, QString consumer, QString consumerParams, QString properties);
171 /** @brief An effect was saved, trigger effect list reload. */
172 void reloadEffects();
173 void resetEffect(int ix);