]> git.sesse.net Git - kdenlive/blob - src/effectstack/collapsibleeffect.cpp
Fix newly introduced effect types
[kdenlive] / src / effectstack / collapsibleeffect.cpp
1 /***************************************************************************
2  *   Copyright (C) 2008 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
21 #include "collapsibleeffect.h"
22
23 #include "ui_listval_ui.h"
24 #include "ui_boolval_ui.h"
25 #include "ui_wipeval_ui.h"
26 #include "ui_urlval_ui.h"
27 #include "ui_keywordval_ui.h"
28 #include "ui_fontval_ui.h"
29 #include "complexparameter.h"
30 #include "geometryval.h"
31 #include "positionedit.h"
32 #include "projectlist.h"
33 #include "effectslist.h"
34 #include "kdenlivesettings.h"
35 #include "profilesdialog.h"
36 #include "kis_curve_widget.h"
37 #include "kis_cubic_curve.h"
38 #include "choosecolorwidget.h"
39 #include "geometrywidget.h"
40 #include "colortools.h"
41 #include "doubleparameterwidget.h"
42 #include "cornerswidget.h"
43 #include "dragvalue.h"
44 #include "beziercurve/beziersplinewidget.h"
45 #ifdef USE_QJSON
46 #include "rotoscoping/rotowidget.h"
47 #endif
48
49
50 #include <QDialog>
51 #include <QVBoxLayout>
52 #include <KDebug>
53 #include <KGlobalSettings>
54 #include <KLocale>
55 #include <KFileDialog>
56 #include <KUrlRequester>
57
58 class Boolval: public QWidget, public Ui::Boolval_UI
59 {
60 };
61
62 class Listval: public QWidget, public Ui::Listval_UI
63 {
64 };
65
66 class Wipeval: public QWidget, public Ui::Wipeval_UI
67 {
68 };
69
70 class Urlval: public QWidget, public Ui::Urlval_UI
71 {
72 };
73
74 class Keywordval: public QWidget, public Ui::Keywordval_UI
75 {
76 };
77
78 class Fontval: public QWidget, public Ui::Fontval_UI
79 {
80 };
81
82 QMap<QString, QImage> CollapsibleEffect::iconCache;
83
84 void clearLayout(QLayout *layout)
85 {
86     QLayoutItem *item;
87     while((item = layout->takeAt(0))) {
88         if (item->layout()) {
89             clearLayout(item->layout());
90             delete item->layout();
91         }
92         if (item->widget()) {
93             delete item->widget();
94         }
95         delete item;
96     }
97 }
98
99 MySpinBox::MySpinBox(QWidget * parent):
100     QSpinBox(parent)
101 {
102     setFocusPolicy(Qt::StrongFocus);
103 }
104
105 void MySpinBox::focusInEvent(QFocusEvent*)
106 {
107      setFocusPolicy(Qt::WheelFocus);
108 }
109
110 void MySpinBox::focusOutEvent(QFocusEvent*)
111 {
112      setFocusPolicy(Qt::StrongFocus);
113 }
114
115 CollapsibleEffect::CollapsibleEffect(QDomElement effect, QDomElement original_effect, ItemInfo info, int ix, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent) :
116         QWidget(parent),
117         m_paramWidget(NULL),
118         m_effect(effect),
119         m_original_effect(original_effect),
120         m_lastEffect(lastEffect),
121         m_active(false)
122 {
123     //setMouseTracking(true);
124     setupUi(this);
125     frame->setBackgroundRole(QPalette::Midlight);
126     frame->setAutoFillBackground(true);
127     setFont(KGlobalSettings::smallestReadableFont());
128     QDomElement namenode = m_effect.firstChildElement("name");
129     if (namenode.isNull()) return;
130     QString type = m_effect.attribute("type", QString());
131     KIcon icon;
132     if (type == "audio") icon = KIcon("kdenlive-show-audio");
133     else if (m_effect.attribute("tag") == "region") icon = KIcon("kdenlive-mask-effect");
134     else if (type == "custom") icon = KIcon("kdenlive-custom-effect");
135     else icon = KIcon("kdenlive-show-video");
136    
137     buttonUp->setIcon(KIcon("go-up"));
138     buttonUp->setToolTip(i18n("Move effect up"));
139     if (!lastEffect) {
140         buttonDown->setIcon(KIcon("go-down"));
141         buttonDown->setToolTip(i18n("Move effect down"));
142     }
143     buttonDel->setIcon(KIcon("edit-delete"));
144     buttonDel->setToolTip(i18n("Delete effect"));
145     buttonSave->setIcon(KIcon("document-save"));
146     buttonSave->setToolTip(i18n("Save effect"));
147
148     buttonUp->setVisible(false);
149     buttonDown->setVisible(false);
150     buttonSave->setVisible(false);
151     buttonDel->setVisible(false);
152     
153     /*buttonReset->setIcon(KIcon("view-refresh"));
154     buttonReset->setToolTip(i18n("Reset effect"));*/
155     //checkAll->setToolTip(i18n("Enable/Disable all effects"));
156     //buttonShowComments->setIcon(KIcon("help-about"));
157     //buttonShowComments->setToolTip(i18n("Show additional information for the parameters"));
158             
159     title->setText(i18n(namenode.text().toUtf8().data()));
160     effectIcon->setPixmap(icon.pixmap(QSize(16,16)));
161     
162     //QLabel *lab = new QLabel("HEllo", widgetFrame);
163     //m_vbox->addWidget(lab);
164     if (m_effect.attribute("disable") == "1") {
165         enabledBox->setCheckState(Qt::Unchecked);
166         title->setEnabled(false);
167     }
168     else {
169         enabledBox->setCheckState(Qt::Checked);
170     }
171
172     connect(collapseButton, SIGNAL(clicked()), this, SLOT(slotSwitch()));
173     connect(enabledBox, SIGNAL(toggled(bool)), this, SLOT(slotEnable(bool)));
174     connect(buttonUp, SIGNAL(clicked()), this, SLOT(slotEffectUp()));
175     connect(buttonDown, SIGNAL(clicked()), this, SLOT(slotEffectDown()));
176     connect(buttonDel, SIGNAL(clicked()), this, SLOT(slotDeleteEffect()));
177     setupWidget(info, ix, metaInfo);
178     Q_FOREACH( QSpinBox * sp, findChildren<QSpinBox*>() ) {
179         sp->installEventFilter( this );
180         sp->setFocusPolicy( Qt::StrongFocus );
181     }
182     Q_FOREACH( KComboBox * cb, findChildren<KComboBox*>() ) {
183         cb->installEventFilter( this );
184         cb->setFocusPolicy( Qt::StrongFocus );
185     }
186     Q_FOREACH( QProgressBar * cb, findChildren<QProgressBar*>() ) {
187         cb->installEventFilter( this );
188         cb->setFocusPolicy( Qt::StrongFocus );
189     }
190     
191 }
192
193 CollapsibleEffect::~CollapsibleEffect()
194 {
195     if (m_paramWidget) delete m_paramWidget;
196 }
197
198 bool CollapsibleEffect::eventFilter( QObject * o, QEvent * e ) 
199 {
200     if(e->type() == QEvent::Wheel) {
201         if (qobject_cast<QAbstractSpinBox*>(o)) {
202             if(qobject_cast<QAbstractSpinBox*>(o)->focusPolicy() == Qt::WheelFocus)
203             {
204                 e->accept();
205                 return false;
206             }
207             else
208             {
209                 e->ignore();
210                 return true;
211             }
212         }
213         if (qobject_cast<KComboBox*>(o)) {
214             if(qobject_cast<KComboBox*>(o)->focusPolicy() == Qt::WheelFocus)
215             {
216                 e->accept();
217                 return false;
218             }
219             else
220             {
221                 e->ignore();
222                 return true;
223             }
224         }
225         if (qobject_cast<QProgressBar*>(o)) {
226             if(qobject_cast<QProgressBar*>(o)->focusPolicy() == Qt::WheelFocus)
227             {
228                 e->accept();
229                 return false;
230             }
231             else
232             {
233                 e->ignore();
234                 return true;
235             }
236         }
237     }
238     return QWidget::eventFilter(o, e);
239 }
240
241
242 void CollapsibleEffect::setActive(bool activate)
243 {
244     m_active = activate;
245     frame->setBackgroundRole(m_active ? QPalette::Mid : QPalette::Midlight);
246     frame->setAutoFillBackground(activate);
247 }
248
249 void CollapsibleEffect::mouseDoubleClickEvent ( QMouseEvent * event )
250 {
251     if (frame->underMouse() && collapseButton->isEnabled()) slotSwitch();
252     QWidget::mouseDoubleClickEvent(event);
253 }
254
255 void CollapsibleEffect::mousePressEvent ( QMouseEvent *event )
256 {
257     if (!m_active) emit activateEffect(m_paramWidget->index());
258     QWidget::mousePressEvent(event);
259 }
260
261 void CollapsibleEffect::enterEvent ( QEvent * event )
262 {
263     if (m_paramWidget->index() > 0) buttonUp->setVisible(true);
264     if (!m_lastEffect) buttonDown->setVisible(true);
265     buttonSave->setVisible(true);
266     buttonDel->setVisible(true);
267     if (!m_active) frame->setBackgroundRole(QPalette::Midlight);
268     frame->setAutoFillBackground(true);
269     QWidget::enterEvent(event);
270 }
271
272 void CollapsibleEffect::leaveEvent ( QEvent * event )
273 {
274     buttonUp->setVisible(false);
275     buttonDown->setVisible(false);
276     buttonSave->setVisible(false);
277     buttonDel->setVisible(false);
278     if (!m_active) frame->setAutoFillBackground(false);
279     QWidget::leaveEvent(event);
280 }
281
282 void CollapsibleEffect::slotEnable(bool enable)
283 {
284     title->setEnabled(enable);
285     m_effect.setAttribute("disable", enable ? 0 : 1);
286     if (enable || KdenliveSettings::disable_effect_parameters()) {
287         widgetFrame->setEnabled(enable);
288     }
289     emit effectStateChanged(!enable, m_paramWidget->index());
290 }
291
292 void CollapsibleEffect::slotDeleteEffect()
293 {
294     emit deleteEffect(m_effect, m_paramWidget->index());
295 }
296
297 void CollapsibleEffect::slotEffectUp()
298 {
299     emit changeEffectPosition(m_paramWidget->index(), true);
300 }
301
302 void CollapsibleEffect::slotEffectDown()
303 {
304     emit changeEffectPosition(m_paramWidget->index(), false);
305 }
306
307 void CollapsibleEffect::slotSwitch()
308 {
309     bool enable = !widgetFrame->isVisible();
310     slotShow(enable);
311 }
312
313 void CollapsibleEffect::slotShow(bool show)
314 {
315     widgetFrame->setVisible(show);
316     if (show) {
317         collapseButton->setArrowType(Qt::DownArrow);
318         m_original_effect.removeAttribute("k_collapsed");
319     }
320     else {
321         collapseButton->setArrowType(Qt::RightArrow);
322         m_original_effect.setAttribute("k_collapsed", 1);
323     }
324 }
325
326
327 void CollapsibleEffect::setupWidget(ItemInfo info, int index, EffectMetaInfo *metaInfo)
328 {
329     if (m_effect.isNull()) {
330 //         kDebug() << "// EMPTY EFFECT STACK";
331         return;
332     }
333     if (m_effect.attribute("tag") == "region") {
334         QVBoxLayout *vbox = new QVBoxLayout(widgetFrame);
335         vbox->setContentsMargins(0, 0, 0, 0);
336         vbox->setSpacing(2);
337         QDomNodeList effects =  m_effect.elementsByTagName("effect");
338         QDomNodeList origin_effects =  m_original_effect.elementsByTagName("effect");
339         QWidget *container = new QWidget(widgetFrame);
340         vbox->addWidget(container);
341         m_paramWidget = new ParameterContainer(m_effect.toElement(), info, metaInfo, index, container);
342         for (int i = 0; i < effects.count(); i++) {
343             CollapsibleEffect *coll = new CollapsibleEffect(effects.at(i).toElement(), origin_effects.at(i).toElement(), info, i, metaInfo, container);
344             m_subParamWidgets.append(coll);
345             //container = new QWidget(widgetFrame);
346             vbox->addWidget(coll);
347             //p = new ParameterContainer(effects.at(i).toElement(), info, isEffect, container);
348         }
349         
350     }
351     else {
352         m_paramWidget = new ParameterContainer(m_effect, info, metaInfo, index, widgetFrame);
353         if (m_effect.firstChildElement("parameter").isNull()) {
354             // Effect has no parameter, don't allow expand
355             collapseButton->setEnabled(false);
356             widgetFrame->setVisible(false);            
357         }
358     }
359     if (collapseButton->isEnabled()) slotShow(!m_effect.hasAttribute("k_collapsed"));
360     connect (m_paramWidget, SIGNAL(parameterChanged(const QDomElement, const QDomElement, int)), this, SIGNAL(parameterChanged(const QDomElement, const QDomElement, int)));
361     
362     connect(m_paramWidget, SIGNAL(startFilterJob(QString,QString,QString,QString,QString,QString)), this, SIGNAL(startFilterJob(QString,QString,QString,QString,QString,QString)));
363     
364     connect (this, SIGNAL(syncEffectsPos(int)), m_paramWidget, SIGNAL(syncEffectsPos(int)));
365     connect (this, SIGNAL(effectStateChanged(bool)), m_paramWidget, SIGNAL(effectStateChanged(bool)));
366     connect (m_paramWidget, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
367     connect (m_paramWidget, SIGNAL(seekTimeline(int)), this, SIGNAL(seekTimeline(int)));
368     
369     
370 }
371
372 void CollapsibleEffect::updateTimecodeFormat()
373 {
374     m_paramWidget->updateTimecodeFormat();
375     if (!m_subParamWidgets.isEmpty()) {
376         // we have a group
377         for (int i = 0; i < m_subParamWidgets.count(); i++)
378             m_subParamWidgets.at(i)->updateTimecodeFormat();
379     }
380 }
381
382 void CollapsibleEffect::slotSyncEffectsPos(int pos)
383 {
384     emit syncEffectsPos(pos);
385 }
386
387
388
389 ParameterContainer::ParameterContainer(QDomElement effect, ItemInfo info, EffectMetaInfo *metaInfo, int index, QWidget * parent) :
390         m_index(index),
391         m_keyframeEditor(NULL),
392         m_geometryWidget(NULL),
393         m_metaInfo(metaInfo),
394         m_effect(effect)
395 {
396     m_in = info.cropStart.frames(KdenliveSettings::project_fps());
397     m_out = (info.cropStart + info.cropDuration).frames(KdenliveSettings::project_fps()) - 1;
398
399     QDomNodeList namenode = effect.childNodes(); //elementsByTagName("parameter");
400     
401     QDomElement e = effect.toElement();
402     int minFrame = e.attribute("start").toInt();
403     int maxFrame = e.attribute("end").toInt();
404     // In transitions, maxFrame is in fact one frame after the end of transition
405     if (maxFrame > 0) maxFrame --;
406
407     bool disable = effect.attribute("disable") == "1" && KdenliveSettings::disable_effect_parameters();
408     parent->setEnabled(!disable);
409
410     bool stretch = true;
411     m_vbox = new QVBoxLayout(parent);
412     m_vbox->setContentsMargins(0, 0, 0, 0);
413     m_vbox->setSpacing(2);
414
415     for (int i = 0; i < namenode.count() ; i++) {
416         QDomElement pa = namenode.item(i).toElement();
417         if (pa.tagName() != "parameter") continue;
418         QDomElement na = pa.firstChildElement("name");
419         QDomElement commentElem = pa.firstChildElement("comment");
420         QString type = pa.attribute("type");
421         QString paramName = na.isNull() ? pa.attribute("name") : i18n(na.text().toUtf8().data());
422         QString comment;
423         if (!commentElem.isNull())
424             comment = i18n(commentElem.text().toUtf8().data());
425         QWidget * toFillin = new QWidget(parent);
426         QString value = pa.attribute("value").isNull() ?
427                         pa.attribute("default") : pa.attribute("value");
428
429
430         /** See effects/README for info on the different types */
431
432         if (type == "double" || type == "constant") {
433             double min;
434             double max;
435             if (pa.attribute("min").contains('%'))
436                 min = ProfilesDialog::getStringEval(m_metaInfo->profile, pa.attribute("min"), m_metaInfo->frameSize);
437             else
438                 min = pa.attribute("min").toDouble();
439             if (pa.attribute("max").contains('%'))
440                 max = ProfilesDialog::getStringEval(m_metaInfo->profile, pa.attribute("max"), m_metaInfo->frameSize);
441             else
442                 max = pa.attribute("max").toDouble();
443
444             DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, value.toDouble(), min, max,
445                     pa.attribute("default").toDouble(), comment, -1, pa.attribute("suffix"), pa.attribute("decimals").toInt(), parent);
446             doubleparam->setFocusPolicy(Qt::StrongFocus);
447             m_vbox->addWidget(doubleparam);
448             m_valueItems[paramName] = doubleparam;
449             connect(doubleparam, SIGNAL(valueChanged(double)), this, SLOT(slotCollectAllParameters()));
450             connect(this, SIGNAL(showComments(bool)), doubleparam, SLOT(slotShowComment(bool)));
451         } else if (type == "list") {
452             Listval *lsval = new Listval;
453             lsval->setupUi(toFillin);
454             lsval->list->setFocusPolicy(Qt::StrongFocus);
455             QStringList listitems = pa.attribute("paramlist").split(';');
456             if (listitems.count() == 1) {
457                 // probably custom effect created before change to ';' as separator
458                 listitems = pa.attribute("paramlist").split(",");
459             }
460             QDomElement list = pa.firstChildElement("paramlistdisplay");
461             QStringList listitemsdisplay;
462             if (!list.isNull()) {
463                 listitemsdisplay = i18n(list.text().toUtf8().data()).split(',');
464             } else {
465                 listitemsdisplay = i18n(pa.attribute("paramlistdisplay").toUtf8().data()).split(',');
466             }
467             if (listitemsdisplay.count() != listitems.count())
468                 listitemsdisplay = listitems;
469             lsval->list->setIconSize(QSize(30, 30));
470             for (int i = 0; i < listitems.count(); i++) {
471                 lsval->list->addItem(listitemsdisplay.at(i), listitems.at(i));
472                 QString entry = listitems.at(i);
473                 if (!entry.isEmpty() && (entry.endsWith(".png") || entry.endsWith(".pgm"))) {
474                     if (!CollapsibleEffect::iconCache.contains(entry)) {
475                         QImage pix(entry);
476                         CollapsibleEffect::iconCache[entry] = pix.scaled(30, 30);
477                     }
478                     lsval->list->setItemIcon(i, QPixmap::fromImage(CollapsibleEffect::iconCache[entry]));
479                 }
480             }
481             if (!value.isEmpty()) lsval->list->setCurrentIndex(listitems.indexOf(value));
482             lsval->name->setText(paramName);
483             lsval->labelComment->setText(comment);
484             lsval->widgetComment->setHidden(true);
485             m_valueItems[paramName] = lsval;
486             connect(lsval->list, SIGNAL(currentIndexChanged(int)) , this, SLOT(slotCollectAllParameters()));
487             if (!comment.isEmpty())
488                 connect(this, SIGNAL(showComments(bool)), lsval->widgetComment, SLOT(setVisible(bool)));
489             m_uiItems.append(lsval);
490         } else if (type == "bool") {
491             Boolval *bval = new Boolval;
492             bval->setupUi(toFillin);
493             bval->checkBox->setCheckState(value == "0" ? Qt::Unchecked : Qt::Checked);
494             bval->name->setText(paramName);
495             bval->labelComment->setText(comment);
496             bval->widgetComment->setHidden(true);
497             m_valueItems[paramName] = bval;
498             connect(bval->checkBox, SIGNAL(stateChanged(int)) , this, SLOT(slotCollectAllParameters()));
499             if (!comment.isEmpty())
500                 connect(this, SIGNAL(showComments(bool)), bval->widgetComment, SLOT(setVisible(bool)));
501             m_uiItems.append(bval);
502         } else if (type == "complex") {
503             ComplexParameter *pl = new ComplexParameter;
504             pl->setupParam(effect, pa.attribute("name"), 0, 100);
505             m_vbox->addWidget(pl);
506             m_valueItems[paramName+"complex"] = pl;
507             connect(pl, SIGNAL(parameterChanged()), this, SLOT(slotCollectAllParameters()));
508         } else if (type == "geometry") {
509             if (KdenliveSettings::on_monitor_effects()) {
510                 m_geometryWidget = new GeometryWidget(m_metaInfo->monitor, m_metaInfo->timecode, 0, true, effect.hasAttribute("showrotation"), parent);
511                 m_geometryWidget->setFrameSize(m_metaInfo->frameSize);
512                 m_geometryWidget->slotShowScene(!disable);
513                 // connect this before setupParam to make sure the monitor scene shows up at startup
514                 connect(m_geometryWidget, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
515                 connect(m_geometryWidget, SIGNAL(parameterChanged()), this, SLOT(slotCollectAllParameters()));
516                 if (minFrame == maxFrame)
517                     m_geometryWidget->setupParam(pa, m_in, m_out);
518                 else
519                     m_geometryWidget->setupParam(pa, minFrame, maxFrame);
520                 m_vbox->addWidget(m_geometryWidget);
521                 m_valueItems[paramName+"geometry"] = m_geometryWidget;
522                 connect(m_geometryWidget, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
523                 connect(this, SIGNAL(syncEffectsPos(int)), m_geometryWidget, SLOT(slotSyncPosition(int)));
524                 connect(this, SIGNAL(effectStateChanged(bool)), m_geometryWidget, SLOT(slotShowScene(bool)));
525             } else {
526                 Geometryval *geo = new Geometryval(m_metaInfo->profile, m_metaInfo->timecode, m_metaInfo->frameSize, 0);
527                 if (minFrame == maxFrame)
528                     geo->setupParam(pa, m_in, m_out);
529                 else
530                     geo->setupParam(pa, minFrame, maxFrame);
531                 m_vbox->addWidget(geo);
532                 m_valueItems[paramName+"geometry"] = geo;
533                 connect(geo, SIGNAL(parameterChanged()), this, SLOT(slotCollectAllParameters()));
534                 connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
535                 connect(this, SIGNAL(syncEffectsPos(int)), geo, SLOT(slotSyncPosition(int)));
536             }
537         } else if (type == "addedgeometry") {
538             // this is a parameter that should be linked to the geometry widget, for example rotation, shear, ...
539             if (m_geometryWidget) m_geometryWidget->addParameter(pa);
540         } else if (type == "keyframe" || type == "simplekeyframe") {
541             // keyframe editor widget
542             if (m_keyframeEditor == NULL) {
543                 KeyframeEdit *geo;
544                 if (pa.attribute("widget") == "corners") {
545                     // we want a corners-keyframe-widget
546                     CornersWidget *corners = new CornersWidget(m_metaInfo->monitor, pa, m_in, m_out, m_metaInfo->timecode, e.attribute("active_keyframe", "-1").toInt(), parent);
547                     corners->slotShowScene(!disable);
548                     connect(corners, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
549                     connect(this, SIGNAL(effectStateChanged(bool)), corners, SLOT(slotShowScene(bool)));
550                     connect(this, SIGNAL(syncEffectsPos(int)), corners, SLOT(slotSyncPosition(int)));
551                     geo = static_cast<KeyframeEdit *>(corners);
552                 } else {
553                     geo = new KeyframeEdit(pa, m_in, m_out, m_metaInfo->timecode, e.attribute("active_keyframe", "-1").toInt());
554                 }
555                 m_vbox->addWidget(geo);
556                 m_valueItems[paramName+"keyframe"] = geo;
557                 m_keyframeEditor = geo;
558                 connect(geo, SIGNAL(parameterChanged()), this, SLOT(slotCollectAllParameters()));
559                 connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
560                 connect(this, SIGNAL(showComments(bool)), geo, SIGNAL(showComments(bool)));
561             } else {
562                 // we already have a keyframe editor, so just add another column for the new param
563                 m_keyframeEditor->addParameter(pa);
564             }
565         } else if (type == "color") {
566             if (value.startsWith('#'))
567                 value = value.replace('#', "0x");
568             ChooseColorWidget *choosecolor = new ChooseColorWidget(paramName, value, parent);
569             m_vbox->addWidget(choosecolor);
570             m_valueItems[paramName] = choosecolor;
571             connect(choosecolor, SIGNAL(displayMessage(const QString&, int)), this, SIGNAL(displayMessage(const QString&, int)));
572             connect(choosecolor, SIGNAL(modified()) , this, SLOT(slotCollectAllParameters()));
573         } else if (type == "position") {
574             int pos = value.toInt();
575             if (effect.attribute("id") == "fadein" || effect.attribute("id") == "fade_from_black") {
576                 pos = pos - m_in;
577             } else if (effect.attribute("id") == "fadeout" || effect.attribute("id") == "fade_to_black") {
578                 // fadeout position starts from clip end
579                 pos = m_out - pos;
580             }
581             PositionEdit *posedit = new PositionEdit(paramName, pos, 0, m_out - m_in, m_metaInfo->timecode);
582             m_vbox->addWidget(posedit);
583             m_valueItems[paramName+"position"] = posedit;
584             connect(posedit, SIGNAL(parameterChanged()), this, SLOT(slotCollectAllParameters()));
585         } else if (type == "curve") {
586             KisCurveWidget *curve = new KisCurveWidget(parent);
587             curve->setMaxPoints(pa.attribute("max").toInt());
588             QList<QPointF> points;
589             int number = EffectsList::parameter(e, pa.attribute("number")).toInt();
590             QString inName = pa.attribute("inpoints");
591             QString outName = pa.attribute("outpoints");
592             int start = pa.attribute("min").toInt();
593             for (int j = start; j <= number; j++) {
594                 QString in = inName;
595                 in.replace("%i", QString::number(j));
596                 QString out = outName;
597                 out.replace("%i", QString::number(j));
598                 points << QPointF(EffectsList::parameter(e, in).toDouble(), EffectsList::parameter(e, out).toDouble());
599             }
600             if (!points.isEmpty())
601                 curve->setCurve(KisCubicCurve(points));
602             MySpinBox *spinin = new MySpinBox();
603             spinin->setRange(0, 1000);
604             MySpinBox *spinout = new MySpinBox();
605             spinout->setRange(0, 1000);
606             curve->setupInOutControls(spinin, spinout, 0, 1000);
607             m_vbox->addWidget(curve);
608             m_vbox->addWidget(spinin);
609             m_vbox->addWidget(spinout);
610
611             connect(curve, SIGNAL(modified()), this, SLOT(slotCollectAllParameters()));
612             m_valueItems[paramName] = curve;
613
614             QString depends = pa.attribute("depends");
615             if (!depends.isEmpty())
616                 meetDependency(paramName, type, EffectsList::parameter(e, depends));
617         } else if (type == "bezier_spline") {
618             BezierSplineWidget *widget = new BezierSplineWidget(value, parent);
619             stretch = false;
620             m_vbox->addWidget(widget);
621             m_valueItems[paramName] = widget;
622             connect(widget, SIGNAL(modified()), this, SLOT(slotCollectAllParameters()));
623             QString depends = pa.attribute("depends");
624             if (!depends.isEmpty())
625                 meetDependency(paramName, type, EffectsList::parameter(e, depends));
626 #ifdef USE_QJSON
627         } else if (type == "roto-spline") {
628             RotoWidget *roto = new RotoWidget(value, m_metaInfo->monitor, info, m_metaInfo->timecode, parent);
629             roto->slotShowScene(!disable);
630             connect(roto, SIGNAL(valueChanged()), this, SLOT(slotCollectAllParameters()));
631             connect(roto, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
632             connect(roto, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
633             connect(this, SIGNAL(syncEffectsPos(int)), roto, SLOT(slotSyncPosition(int)));
634             connect(this, SIGNAL(effectStateChanged(bool)), roto, SLOT(slotShowScene(bool)));
635             m_vbox->addWidget(roto);
636             m_valueItems[paramName] = roto;
637 #endif
638         } else if (type == "wipe") {
639             Wipeval *wpval = new Wipeval;
640             wpval->setupUi(toFillin);
641             wipeInfo w = getWipeInfo(value);
642             switch (w.start) {
643             case UP:
644                 wpval->start_up->setChecked(true);
645                 break;
646             case DOWN:
647                 wpval->start_down->setChecked(true);
648                 break;
649             case RIGHT:
650                 wpval->start_right->setChecked(true);
651                 break;
652             case LEFT:
653                 wpval->start_left->setChecked(true);
654                 break;
655             default:
656                 wpval->start_center->setChecked(true);
657                 break;
658             }
659             switch (w.end) {
660             case UP:
661                 wpval->end_up->setChecked(true);
662                 break;
663             case DOWN:
664                 wpval->end_down->setChecked(true);
665                 break;
666             case RIGHT:
667                 wpval->end_right->setChecked(true);
668                 break;
669             case LEFT:
670                 wpval->end_left->setChecked(true);
671                 break;
672             default:
673                 wpval->end_center->setChecked(true);
674                 break;
675             }
676             wpval->start_transp->setValue(w.startTransparency);
677             wpval->end_transp->setValue(w.endTransparency);
678             m_valueItems[paramName] = wpval;
679             connect(wpval->end_up, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
680             connect(wpval->end_down, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
681             connect(wpval->end_left, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
682             connect(wpval->end_right, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
683             connect(wpval->end_center, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
684             connect(wpval->start_up, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
685             connect(wpval->start_down, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
686             connect(wpval->start_left, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
687             connect(wpval->start_right, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
688             connect(wpval->start_center, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
689             connect(wpval->start_transp, SIGNAL(valueChanged(int)), this, SLOT(slotCollectAllParameters()));
690             connect(wpval->end_transp, SIGNAL(valueChanged(int)), this, SLOT(slotCollectAllParameters()));
691             //wpval->title->setTitle(na.toElement().text());
692             m_uiItems.append(wpval);
693         } else if (type == "url") {
694             Urlval *cval = new Urlval;
695             cval->setupUi(toFillin);
696             cval->label->setText(paramName);
697             cval->urlwidget->fileDialog()->setFilter(ProjectList::getExtensions());
698             m_valueItems[paramName] = cval;
699             cval->urlwidget->setUrl(KUrl(value));
700             connect(cval->urlwidget, SIGNAL(returnPressed()) , this, SLOT(slotCollectAllParameters()));
701             connect(cval->urlwidget, SIGNAL(urlSelected(const KUrl&)) , this, SLOT(slotCollectAllParameters()));
702             m_uiItems.append(cval);
703         } else if (type == "keywords") {
704             Keywordval* kval = new Keywordval;
705             kval->setupUi(toFillin);
706             kval->label->setText(paramName);
707             kval->lineeditwidget->setText(value);
708             QDomElement klistelem = pa.firstChildElement("keywords");
709             QDomElement kdisplaylistelem = pa.firstChildElement("keywordsdisplay");
710             QStringList keywordlist;
711             QStringList keyworddisplaylist;
712             if (!klistelem.isNull()) {
713                 keywordlist = klistelem.text().split(';');
714                 keyworddisplaylist = i18n(kdisplaylistelem.text().toUtf8().data()).split(';');
715             }
716             if (keyworddisplaylist.count() != keywordlist.count()) {
717                 keyworddisplaylist = keywordlist;
718             }
719             for (int i = 0; i < keywordlist.count(); i++) {
720                 kval->comboboxwidget->addItem(keyworddisplaylist.at(i), keywordlist.at(i));
721             }
722             // Add disabled user prompt at index 0
723             kval->comboboxwidget->insertItem(0, i18n("<select a keyword>"), "");
724             kval->comboboxwidget->model()->setData( kval->comboboxwidget->model()->index(0,0), QVariant(Qt::NoItemFlags), Qt::UserRole -1);
725             kval->comboboxwidget->setCurrentIndex(0);
726             m_valueItems[paramName] = kval;
727             connect(kval->lineeditwidget, SIGNAL(editingFinished()) , this, SLOT(collectAllParameters()));
728             connect(kval->comboboxwidget, SIGNAL(activated (const QString&)), this, SLOT(collectAllParameters()));
729             m_uiItems.append(kval);
730         } else if (type == "fontfamily") {
731             Fontval* fval = new Fontval;
732             fval->setupUi(toFillin);
733             fval->name->setText(paramName);
734             fval->fontfamilywidget->setCurrentFont(QFont(value));
735             m_valueItems[paramName] = fval;
736             connect(fval->fontfamilywidget, SIGNAL(currentFontChanged(const QFont &)), this, SLOT(collectAllParameters())) ;
737             m_uiItems.append(fval);
738         } else if (type == "filterjob") {
739             QVBoxLayout *l= new QVBoxLayout(toFillin);
740             QPushButton *button = new QPushButton(paramName, toFillin);
741             l->addWidget(button);
742             m_valueItems[paramName] = button;
743             connect(button, SIGNAL(pressed()), this, SLOT(slotStartFilterJobAction()));   
744         } else {
745             delete toFillin;
746             toFillin = NULL;
747         }
748
749         if (toFillin)
750             m_vbox->addWidget(toFillin);
751     }
752
753     if (stretch)
754         m_vbox->addStretch();
755
756     if (m_keyframeEditor)
757         m_keyframeEditor->checkVisibleParam();
758
759     // Make sure all doubleparam spinboxes have the same width, looks much better
760     QList<DoubleParameterWidget *> allWidgets = findChildren<DoubleParameterWidget *>();
761     int minSize = 0;
762     for (int i = 0; i < allWidgets.count(); i++) {
763         if (minSize < allWidgets.at(i)->spinSize()) minSize = allWidgets.at(i)->spinSize();
764     }
765     for (int i = 0; i < allWidgets.count(); i++) {
766         allWidgets.at(i)->setSpinSize(minSize);
767     }
768 }
769
770 ParameterContainer::~ParameterContainer()
771 {
772     clearLayout(m_vbox);
773     delete m_vbox;
774 }
775
776 void ParameterContainer::meetDependency(const QString& name, QString type, QString value)
777 {
778     if (type == "curve") {
779         KisCurveWidget *curve = (KisCurveWidget*)m_valueItems[name];
780         if (curve) {
781             int color = value.toInt();
782             curve->setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(curve->size(), (ColorTools::ColorsRGB)(color == 3 ? 4 : color), 0.8)));
783         }
784     } else if (type == "bezier_spline") {
785         BezierSplineWidget *widget = (BezierSplineWidget*)m_valueItems[name];
786         if (widget) {
787             widget->setMode((BezierSplineWidget::CurveModes)((int)(value.toDouble() * 10)));
788         }
789     }
790 }
791
792 wipeInfo ParameterContainer::getWipeInfo(QString value)
793 {
794     wipeInfo info;
795     // Convert old geometry values that used a comma as separator
796     if (value.contains(',')) value.replace(',','/');
797     QString start = value.section(';', 0, 0);
798     QString end = value.section(';', 1, 1).section('=', 1, 1);
799     if (start.startsWith("-100%/0"))
800         info.start = LEFT;
801     else if (start.startsWith("100%/0"))
802         info.start = RIGHT;
803     else if (start.startsWith("0%/100%"))
804         info.start = DOWN;
805     else if (start.startsWith("0%/-100%"))
806         info.start = UP;
807     else
808         info.start = CENTER;
809
810     if (start.count(':') == 2)
811         info.startTransparency = start.section(':', -1).toInt();
812     else
813         info.startTransparency = 100;
814
815     if (end.startsWith("-100%/0"))
816         info.end = LEFT;
817     else if (end.startsWith("100%/0"))
818         info.end = RIGHT;
819     else if (end.startsWith("0%/100%"))
820         info.end = DOWN;
821     else if (end.startsWith("0%/-100%"))
822         info.end = UP;
823     else
824         info.end = CENTER;
825
826     if (end.count(':') == 2)
827         info.endTransparency = end.section(':', -1).toInt();
828     else
829         info.endTransparency = 100;
830
831     return info;
832 }
833
834 void ParameterContainer::updateTimecodeFormat()
835 {
836     if (m_keyframeEditor)
837         m_keyframeEditor->updateTimecodeFormat();
838
839     QDomNodeList namenode = m_effect.elementsByTagName("parameter");
840     for (int i = 0; i < namenode.count() ; i++) {
841         QDomNode pa = namenode.item(i);
842         QDomElement na = pa.firstChildElement("name");
843         QString type = pa.attributes().namedItem("type").nodeValue();
844         QString paramName = na.isNull() ? pa.attributes().namedItem("name").nodeValue() : i18n(na.text().toUtf8().data());
845
846         if (type == "geometry") {
847             if (KdenliveSettings::on_monitor_effects()) {
848                 if (m_geometryWidget) m_geometryWidget->updateTimecodeFormat();
849             } else {
850                 Geometryval *geom = ((Geometryval*)m_valueItems[paramName+"geometry"]);
851                 geom->updateTimecodeFormat();
852             }
853             break;
854         } else if (type == "position") {
855             PositionEdit *posi = ((PositionEdit*)m_valueItems[paramName+"position"]);
856             posi->updateTimecodeFormat();
857             break;
858 #ifdef USE_QJSON
859         } else if (type == "roto-spline") {
860             RotoWidget *widget = static_cast<RotoWidget *>(m_valueItems[paramName]);
861             widget->updateTimecodeFormat();
862 #endif
863         }
864     }
865 }
866
867 void ParameterContainer::slotCollectAllParameters()
868 {
869     if (m_valueItems.isEmpty() || m_effect.isNull()) return;
870     QLocale locale;
871     locale.setNumberOptions(QLocale::OmitGroupSeparator);
872     const QDomElement oldparam = m_effect.cloneNode().toElement();
873     QDomElement newparam = oldparam.cloneNode().toElement();
874     QDomNodeList namenode = newparam.elementsByTagName("parameter");
875
876     for (int i = 0; i < namenode.count() ; i++) {
877         QDomNode pa = namenode.item(i);
878         QDomElement na = pa.firstChildElement("name");
879         QString type = pa.attributes().namedItem("type").nodeValue();
880         QString paramName = na.isNull() ? pa.attributes().namedItem("name").nodeValue() : i18n(na.text().toUtf8().data());
881         if (type == "complex")
882             paramName.append("complex");
883         else if (type == "position")
884             paramName.append("position");
885         else if (type == "geometry")
886             paramName.append("geometry");
887         else if (type == "keyframe")
888             paramName.append("keyframe");
889         if (type != "simplekeyframe" && type != "fixed" && type != "addedgeometry" && !m_valueItems.contains(paramName)) {
890             kDebug() << "// Param: " << paramName << " NOT FOUND";
891             continue;
892         }
893
894         QString setValue;
895         if (type == "double" || type == "constant") {
896             DoubleParameterWidget *doubleparam = (DoubleParameterWidget*)m_valueItems.value(paramName);
897             setValue = locale.toString(doubleparam->getValue());
898         } else if (type == "list") {
899             KComboBox *box = ((Listval*)m_valueItems.value(paramName))->list;
900             setValue = box->itemData(box->currentIndex()).toString();
901         } else if (type == "bool") {
902             QCheckBox *box = ((Boolval*)m_valueItems.value(paramName))->checkBox;
903             setValue = box->checkState() == Qt::Checked ? "1" : "0" ;
904         } else if (type == "color") {
905             ChooseColorWidget *choosecolor = ((ChooseColorWidget*)m_valueItems.value(paramName));
906             setValue = choosecolor->getColor();
907         } else if (type == "complex") {
908             ComplexParameter *complex = ((ComplexParameter*)m_valueItems.value(paramName));
909             namenode.item(i) = complex->getParamDesc();
910         } else if (type == "geometry") {
911             if (KdenliveSettings::on_monitor_effects()) {
912                 if (m_geometryWidget) namenode.item(i).toElement().setAttribute("value", m_geometryWidget->getValue());
913             } else {
914                 Geometryval *geom = ((Geometryval*)m_valueItems.value(paramName));
915                 namenode.item(i).toElement().setAttribute("value", geom->getValue());
916             }
917         } else if (type == "addedgeometry") {
918             namenode.item(i).toElement().setAttribute("value", m_geometryWidget->getExtraValue(namenode.item(i).toElement().attribute("name")));
919         } else if (type == "position") {
920             PositionEdit *pedit = ((PositionEdit*)m_valueItems.value(paramName));
921             int pos = pedit->getPosition();
922             setValue = QString::number(pos);
923             if (newparam.attribute("id") == "fadein" || newparam.attribute("id") == "fade_from_black") {
924                 // Make sure duration is not longer than clip
925                 /*if (pos > m_out) {
926                     pos = m_out;
927                     pedit->setPosition(pos);
928                 }*/
929                 EffectsList::setParameter(newparam, "in", QString::number(m_in));
930                 EffectsList::setParameter(newparam, "out", QString::number(m_in + pos));
931                 setValue.clear();
932             } else if (newparam.attribute("id") == "fadeout" || newparam.attribute("id") == "fade_to_black") {
933                 // Make sure duration is not longer than clip
934                 /*if (pos > m_out) {
935                     pos = m_out;
936                     pedit->setPosition(pos);
937                 }*/
938                 EffectsList::setParameter(newparam, "in", QString::number(m_out - pos));
939                 EffectsList::setParameter(newparam, "out", QString::number(m_out));
940                 setValue.clear();
941             }
942         } else if (type == "curve") {
943             KisCurveWidget *curve = ((KisCurveWidget*)m_valueItems.value(paramName));
944             QList<QPointF> points = curve->curve().points();
945             QString number = pa.attributes().namedItem("number").nodeValue();
946             QString inName = pa.attributes().namedItem("inpoints").nodeValue();
947             QString outName = pa.attributes().namedItem("outpoints").nodeValue();
948             int off = pa.attributes().namedItem("min").nodeValue().toInt();
949             int end = pa.attributes().namedItem("max").nodeValue().toInt();
950             EffectsList::setParameter(newparam, number, QString::number(points.count()));
951             for (int j = 0; (j < points.count() && j + off <= end); j++) {
952                 QString in = inName;
953                 in.replace("%i", QString::number(j + off));
954                 QString out = outName;
955                 out.replace("%i", QString::number(j + off));
956                 EffectsList::setParameter(newparam, in, locale.toString(points.at(j).x()));
957                 EffectsList::setParameter(newparam, out, locale.toString(points.at(j).y()));
958             }
959             QString depends = pa.attributes().namedItem("depends").nodeValue();
960             if (!depends.isEmpty())
961                 meetDependency(paramName, type, EffectsList::parameter(newparam, depends));
962         } else if (type == "bezier_spline") {
963             BezierSplineWidget *widget = (BezierSplineWidget*)m_valueItems.value(paramName);
964             setValue = widget->spline();
965             QString depends = pa.attributes().namedItem("depends").nodeValue();
966             if (!depends.isEmpty())
967                 meetDependency(paramName, type, EffectsList::parameter(newparam, depends));
968 #ifdef USE_QJSON
969         } else if (type == "roto-spline") {
970             RotoWidget *widget = static_cast<RotoWidget *>(m_valueItems.value(paramName));
971             setValue = widget->getSpline();
972 #endif
973         } else if (type == "wipe") {
974             Wipeval *wp = (Wipeval*)m_valueItems.value(paramName);
975             wipeInfo info;
976             if (wp->start_left->isChecked())
977                 info.start = LEFT;
978             else if (wp->start_right->isChecked())
979                 info.start = RIGHT;
980             else if (wp->start_up->isChecked())
981                 info.start = UP;
982             else if (wp->start_down->isChecked())
983                 info.start = DOWN;
984             else if (wp->start_center->isChecked())
985                 info.start = CENTER;
986             else
987                 info.start = LEFT;
988             info.startTransparency = wp->start_transp->value();
989
990             if (wp->end_left->isChecked())
991                 info.end = LEFT;
992             else if (wp->end_right->isChecked())
993                 info.end = RIGHT;
994             else if (wp->end_up->isChecked())
995                 info.end = UP;
996             else if (wp->end_down->isChecked())
997                 info.end = DOWN;
998             else if (wp->end_center->isChecked())
999                 info.end = CENTER;
1000             else
1001                 info.end = RIGHT;
1002             info.endTransparency = wp->end_transp->value();
1003
1004             setValue = getWipeString(info);
1005         } else if ((type == "simplekeyframe" || type == "keyframe") && m_keyframeEditor) {
1006             QDomElement elem = pa.toElement();
1007             QString realName = i18n(na.toElement().text().toUtf8().data());
1008             QString val = m_keyframeEditor->getValue(realName);
1009             elem.setAttribute("keyframes", val);
1010
1011             if (m_keyframeEditor->isVisibleParam(realName))
1012                 elem.setAttribute("intimeline", "1");
1013             else if (elem.hasAttribute("intimeline"))
1014                 elem.removeAttribute("intimeline");
1015         } else if (type == "url") {
1016             KUrlRequester *req = ((Urlval*)m_valueItems.value(paramName))->urlwidget;
1017             setValue = req->url().path();
1018         } else if (type == "keywords"){
1019             QLineEdit *line = ((Keywordval*)m_valueItems.value(paramName))->lineeditwidget;
1020             QComboBox *combo = ((Keywordval*)m_valueItems.value(paramName))->comboboxwidget;
1021             if(combo->currentIndex())
1022             {
1023                 QString comboval = combo->itemData(combo->currentIndex()).toString();
1024                 line->insert(comboval);
1025                 combo->setCurrentIndex(0);
1026             }
1027             setValue = line->text();
1028         } else if (type == "fontfamily") {
1029             QFontComboBox* fontfamily = ((Fontval*)m_valueItems.value(paramName))->fontfamilywidget;
1030             setValue = fontfamily->currentFont().family();
1031         }
1032         if (!setValue.isNull())
1033             pa.attributes().namedItem("value").setNodeValue(setValue);
1034
1035     }
1036     emit parameterChanged(oldparam, newparam, m_index);
1037 }
1038
1039 QString ParameterContainer::getWipeString(wipeInfo info)
1040 {
1041
1042     QString start;
1043     QString end;
1044     switch (info.start) {
1045     case LEFT:
1046         start = "-100%/0%:100%x100%";
1047         break;
1048     case RIGHT:
1049         start = "100%/0%:100%x100%";
1050         break;
1051     case DOWN:
1052         start = "0%/100%:100%x100%";
1053         break;
1054     case UP:
1055         start = "0%/-100%:100%x100%";
1056         break;
1057     default:
1058         start = "0%/0%:100%x100%";
1059         break;
1060     }
1061     start.append(':' + QString::number(info.startTransparency));
1062
1063     switch (info.end) {
1064     case LEFT:
1065         end = "-100%/0%:100%x100%";
1066         break;
1067     case RIGHT:
1068         end = "100%/0%:100%x100%";
1069         break;
1070     case DOWN:
1071         end = "0%/100%:100%x100%";
1072         break;
1073     case UP:
1074         end = "0%/-100%:100%x100%";
1075         break;
1076     default:
1077         end = "0%/0%:100%x100%";
1078         break;
1079     }
1080     end.append(':' + QString::number(info.endTransparency));
1081     return QString(start + ";-1=" + end);
1082 }
1083
1084 int ParameterContainer::index()
1085 {
1086     return m_index;
1087 }
1088
1089 void ParameterContainer::slotStartFilterJobAction()
1090 {
1091     QDomNodeList namenode = m_effect.elementsByTagName("parameter");
1092     for (int i = 0; i < namenode.count() ; i++) {
1093         QDomElement pa = namenode.item(i).toElement();
1094         QString type = pa.attribute("type");
1095         if (type == "filterjob") {
1096             emit startFilterJob(pa.attribute("filtertag"), pa.attribute("filterparams"), pa.attribute("finalfilter"), pa.attribute("consumer"), pa.attribute("consumerparams"), pa.attribute("wantedproperties"));
1097             kDebug()<<" - - -PROPS:\n"<<pa.attribute("filtertag")<<"-"<< pa.attribute("filterparams")<<"-"<< pa.attribute("consumer")<<"-"<< pa.attribute("consumerparams")<<"-"<< pa.attribute("wantedproperties");
1098             break;
1099         }
1100     }
1101 }