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>
37 struct EffectMetaInfo {
38 MltVideoProfile profile;
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, int index, QWidget * parent = 0);
63 ~ParameterContainer();
64 void updateTimecodeFormat();
65 void updateProjectFormat(MltVideoProfile profile, Timecode t);
69 void slotCollectAllParameters();
70 void slotStartFilterJobAction();
73 /** @brief Updates parameter @param name according to new value of dependency.
74 * @param name Name of the parameter which will be updated
75 * @param type Type of the parameter which will be updated
76 * @param value Value of the dependency parameter */
77 void meetDependency(const QString& name, QString type, QString value);
78 wipeInfo getWipeInfo(QString value);
79 QString getWipeString(wipeInfo info);
84 QList<QWidget*> m_uiItems;
85 QMap<QString, QWidget*> m_valueItems;
87 KeyframeEdit *m_keyframeEditor;
88 GeometryWidget *m_geometryWidget;
89 EffectMetaInfo *m_metaInfo;
94 void parameterChanged(const QDomElement, const QDomElement, int);
95 void syncEffectsPos(int);
96 void effectStateChanged(bool);
97 void checkMonitorPosition(int);
98 void seekTimeline(int);
99 void showComments(bool);
100 /** @brief Start an MLT filter job on this clip. */
101 void startFilterJob(QString filterName, QString filterParams, QString finalFilterName, QString consumer, QString consumerParams, QString properties);
106 * @class CollapsibleEffect
107 * @brief A dialog for editing markers and guides.
108 * @author Jean-Baptiste Mardelle
111 class CollapsibleEffect : public QWidget, public Ui::CollapsibleWidget_UI
116 CollapsibleEffect(QDomElement effect, QDomElement original_effect, ItemInfo info, int ix, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent = 0);
117 ~CollapsibleEffect();
118 static QMap<QString, QImage> iconCache;
119 void setupWidget(ItemInfo info, int index, EffectMetaInfo *metaInfo);
120 void updateTimecodeFormat();
121 void setActive(bool activate);
122 virtual bool eventFilter( QObject * o, QEvent * e );
125 void slotSyncEffectsPos(int pos);
129 void slotEnable(bool enable);
130 void slotShow(bool show);
131 void slotDeleteEffect();
133 void slotEffectDown();
136 ParameterContainer *m_paramWidget;
137 QList <CollapsibleEffect *> m_subParamWidgets;
138 QDomElement m_effect;
139 QDomElement m_original_effect;
140 QList <QDomElement> m_subEffects;
141 bool m_lastEffect; int m_in;
146 virtual void mouseDoubleClickEvent ( QMouseEvent * event );
147 virtual void mousePressEvent ( QMouseEvent * event );
148 virtual void enterEvent( QEvent * event );
149 virtual void leaveEvent( QEvent * event );
152 void parameterChanged(const QDomElement, const QDomElement, int);
153 void syncEffectsPos(int);
154 void effectStateChanged(bool, int ix = -1);
155 void deleteEffect(const QDomElement, int);
156 void changeEffectPosition(int, bool);
157 void activateEffect(int);
158 void checkMonitorPosition(int);
159 void seekTimeline(int);
160 /** @brief Start an MLT filter job on this clip. */
161 void startFilterJob(QString filterName, QString filterParams, QString finalFilterName, QString consumer, QString consumerParams, QString properties);