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 #include "collapsibleeffect.h"
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"
46 #include "rotoscoping/rotowidget.h"
49 #include <QInputDialog>
52 #include <QVBoxLayout>
54 #include <KGlobalSettings>
56 #include <KMessageBox>
57 #include <KStandardDirs>
58 #include <KFileDialog>
59 #include <KUrlRequester>
61 class Boolval: public QWidget, public Ui::Boolval_UI
65 class Listval: public QWidget, public Ui::Listval_UI
69 class Wipeval: public QWidget, public Ui::Wipeval_UI
73 class Urlval: public QWidget, public Ui::Urlval_UI
77 class Keywordval: public QWidget, public Ui::Keywordval_UI
81 class Fontval: public QWidget, public Ui::Fontval_UI
85 QMap<QString, QImage> CollapsibleEffect::iconCache;
87 void clearLayout(QLayout *layout)
90 while((item = layout->takeAt(0))) {
92 clearLayout(item->layout());
93 delete item->layout();
96 delete item->widget();
102 MySpinBox::MySpinBox(QWidget * parent):
105 setFocusPolicy(Qt::StrongFocus);
108 void MySpinBox::focusInEvent(QFocusEvent*)
110 setFocusPolicy(Qt::WheelFocus);
113 void MySpinBox::focusOutEvent(QFocusEvent*)
115 setFocusPolicy(Qt::StrongFocus);
119 CollapsibleEffect::CollapsibleEffect(QDomElement effect, QDomElement original_effect, ItemInfo info, int ix, EffectMetaInfo *metaInfo, bool lastEffect, bool isGroup, QWidget * parent) :
123 m_original_effect(original_effect),
124 m_lastEffect(lastEffect),
129 //setMouseTracking(true);
131 m_info.fromString(effect.attribute("kdenlive_info"));
132 frame->setBackgroundRole(QPalette::Midlight);
133 frame->setAutoFillBackground(true);
134 setFont(KGlobalSettings::smallestReadableFont());
136 buttonUp->setIcon(KIcon("go-up"));
137 buttonUp->setToolTip(i18n("Move effect up"));
139 buttonDown->setIcon(KIcon("go-down"));
140 buttonDown->setToolTip(i18n("Move effect down"));
142 buttonDel->setIcon(KIcon("edit-delete"));
143 buttonDel->setToolTip(i18n("Delete effect"));
145 buttonUp->setVisible(false);
146 buttonDown->setVisible(false);
147 buttonDel->setVisible(false);
149 /*buttonReset->setIcon(KIcon("view-refresh"));
150 buttonReset->setToolTip(i18n("Reset effect"));*/
151 //checkAll->setToolTip(i18n("Enable/Disable all effects"));
152 //buttonShowComments->setIcon(KIcon("help-about"));
153 //buttonShowComments->setToolTip(i18n("Show additional information for the parameters"));
155 m_menu->addAction(KIcon("view-refresh"), i18n("Reset effect"), this, SLOT(slotResetEffect()));
156 m_menu->addAction(KIcon("document-save"), i18n("Save effect"), this, SLOT(slotSaveEffect()));
159 QDomElement namenode = m_effect.firstChildElement("name");
160 if (namenode.isNull()) return;
161 title->setText(i18n(namenode.text().toUtf8().data()));
162 QString type = m_effect.attribute("type", QString());
164 if (type == "audio") icon = KIcon("kdenlive-show-audio");
165 else if (m_effect.attribute("tag") == "region") icon = KIcon("kdenlive-mask-effect");
166 else if (type == "custom") icon = KIcon("kdenlive-custom-effect");
167 else icon = KIcon("kdenlive-show-video");
168 title->setIcon(icon);
169 m_menu->addAction(KIcon("folder-new"), i18n("Create Group"), this, SLOT(slotCreateGroup()));
170 setupWidget(info, ix, metaInfo);
173 setAcceptDrops(true);
174 title->setText(i18n("Effect Group"));
175 title->setIcon(KIcon("folder"));
176 m_menu->addAction(KIcon("list-remove"), i18n("Ungroup"), this, SLOT(slotUnGroup()));
179 title->setMenu(m_menu);
181 if (m_effect.attribute("disable") == "1") {
182 enabledBox->setCheckState(Qt::Unchecked);
183 title->setEnabled(false);
186 enabledBox->setCheckState(Qt::Checked);
189 connect(collapseButton, SIGNAL(clicked()), this, SLOT(slotSwitch()));
190 connect(enabledBox, SIGNAL(toggled(bool)), this, SLOT(slotEnable(bool)));
191 connect(buttonUp, SIGNAL(clicked()), this, SLOT(slotEffectUp()));
192 connect(buttonDown, SIGNAL(clicked()), this, SLOT(slotEffectDown()));
193 connect(buttonDel, SIGNAL(clicked()), this, SLOT(slotDeleteEffect()));
195 Q_FOREACH( QSpinBox * sp, findChildren<QSpinBox*>() ) {
196 sp->installEventFilter( this );
197 sp->setFocusPolicy( Qt::StrongFocus );
199 Q_FOREACH( KComboBox * cb, findChildren<KComboBox*>() ) {
200 cb->installEventFilter( this );
201 cb->setFocusPolicy( Qt::StrongFocus );
203 Q_FOREACH( QProgressBar * cb, findChildren<QProgressBar*>() ) {
204 cb->installEventFilter( this );
205 cb->setFocusPolicy( Qt::StrongFocus );
209 CollapsibleEffect::~CollapsibleEffect()
211 if (m_paramWidget) delete m_paramWidget;
215 void CollapsibleEffect::slotCreateGroup()
217 emit createGroup(effectIndex());
220 void CollapsibleEffect::slotUnGroup()
225 bool CollapsibleEffect::eventFilter( QObject * o, QEvent * e )
227 if (e->type() == QEvent::Wheel) {
228 QWheelEvent *we = static_cast<QWheelEvent *>(e);
229 if (we->modifiers() != Qt::NoModifier) {
233 if (qobject_cast<QAbstractSpinBox*>(o)) {
234 if(qobject_cast<QAbstractSpinBox*>(o)->focusPolicy() == Qt::WheelFocus)
245 if (qobject_cast<KComboBox*>(o)) {
246 if(qobject_cast<KComboBox*>(o)->focusPolicy() == Qt::WheelFocus)
257 if (qobject_cast<QProgressBar*>(o)) {
258 if(qobject_cast<QProgressBar*>(o)->focusPolicy() == Qt::WheelFocus)
270 return QWidget::eventFilter(o, e);
273 QDomElement CollapsibleEffect::effect() const
278 void CollapsibleEffect::setActive(bool activate)
281 frame->setBackgroundRole(m_active ? QPalette::Mid : QPalette::Midlight);
282 frame->setAutoFillBackground(activate);
285 void CollapsibleEffect::mouseDoubleClickEvent ( QMouseEvent * event )
287 if (frame->underMouse() && collapseButton->isEnabled()) slotSwitch();
288 QWidget::mouseDoubleClickEvent(event);
291 void CollapsibleEffect::mousePressEvent ( QMouseEvent *event )
293 if (!m_active && m_paramWidget) emit activateEffect(m_paramWidget->index());
294 QWidget::mousePressEvent(event);
297 void CollapsibleEffect::enterEvent ( QEvent * event )
299 if (m_paramWidget == NULL || m_paramWidget->index() > 0) buttonUp->setVisible(true);
300 if (!m_lastEffect) buttonDown->setVisible(true);
301 buttonDel->setVisible(true);
302 if (!m_active) frame->setBackgroundRole(QPalette::Midlight);
303 frame->setAutoFillBackground(true);
304 QWidget::enterEvent(event);
307 void CollapsibleEffect::leaveEvent ( QEvent * event )
309 buttonUp->setVisible(false);
310 buttonDown->setVisible(false);
311 buttonDel->setVisible(false);
312 if (!m_active) frame->setAutoFillBackground(false);
313 QWidget::leaveEvent(event);
316 void CollapsibleEffect::slotEnable(bool enable)
318 title->setEnabled(enable);
320 QVBoxLayout *vbox = static_cast<QVBoxLayout *>(widgetFrame->layout());
321 if (vbox == NULL) return;
322 for (int i = 0; i < vbox->count(); i++) {
323 CollapsibleEffect *e = static_cast<CollapsibleEffect *>(vbox->itemAt(i)->widget());
324 if (e) e->enabledBox->setChecked(enable);// slotEnable(enable);
327 m_effect.setAttribute("disable", enable ? 0 : 1);
328 if (enable || KdenliveSettings::disable_effect_parameters()) {
329 widgetFrame->setEnabled(enable);
331 emit effectStateChanged(!enable, m_paramWidget->index());
335 void CollapsibleEffect::slotDeleteEffect()
337 if (!m_isGroup) emit deleteEffect(m_effect);
340 void CollapsibleEffect::slotEffectUp()
342 if (!m_isGroup) emit changeEffectPosition(effectIndex(), true);
345 void CollapsibleEffect::slotEffectDown()
347 if (!m_isGroup) emit changeEffectPosition(effectIndex(), false);
350 void CollapsibleEffect::slotSaveEffect()
352 QString name = QInputDialog::getText(this, i18n("Save Effect"), i18n("Name for saved effect: "));
353 if (name.isEmpty()) return;
354 QString path = KStandardDirs::locateLocal("appdata", "effects/", true);
355 path = path + name + ".xml";
356 if (QFile::exists(path)) if (KMessageBox::questionYesNo(this, i18n("File %1 already exists.\nDo you want to overwrite it?", path)) == KMessageBox::No) return;
359 QDomElement effect = m_effect.cloneNode().toElement();
360 doc.appendChild(doc.importNode(effect, true));
361 effect = doc.firstChild().toElement();
362 effect.removeAttribute("kdenlive_ix");
363 effect.setAttribute("id", name);
364 effect.setAttribute("type", "custom");
365 QDomElement effectname = effect.firstChildElement("name");
366 effect.removeChild(effectname);
367 effectname = doc.createElement("name");
368 QDomText nametext = doc.createTextNode(name);
369 effectname.appendChild(nametext);
370 effect.insertBefore(effectname, QDomNode());
371 QDomElement effectprops = effect.firstChildElement("properties");
372 effectprops.setAttribute("id", name);
373 effectprops.setAttribute("type", "custom");
376 if (file.open(QFile::WriteOnly | QFile::Truncate)) {
377 QTextStream out(&file);
378 out << doc.toString();
381 emit reloadEffects();
384 void CollapsibleEffect::slotResetEffect()
386 emit resetEffect(effectIndex());
389 void CollapsibleEffect::slotSwitch()
391 bool enable = !widgetFrame->isVisible();
395 void CollapsibleEffect::slotShow(bool show)
397 widgetFrame->setVisible(show);
399 collapseButton->setArrowType(Qt::DownArrow);
400 m_info.isCollapsed = false;
403 collapseButton->setArrowType(Qt::RightArrow);
404 m_info.isCollapsed = true;
406 m_effect.setAttribute("kdenlive_info", m_info.toString());
407 emit parameterChanged(m_original_effect, m_effect, m_index);
410 void CollapsibleEffect::updateGroupIndex(int groupIndex)
412 m_info.groupIndex = groupIndex;
413 m_effect.setAttribute("kdenlive_info", m_info.toString());
414 emit parameterChanged(m_original_effect, m_effect, m_index);
417 void CollapsibleEffect::setGroupIndex(int ix)
419 m_info.groupIndex = ix;
422 void CollapsibleEffect::addGroupEffect(CollapsibleEffect *effect)
424 QVBoxLayout *vbox = static_cast<QVBoxLayout *>(widgetFrame->layout());
426 vbox = new QVBoxLayout();
427 vbox->setContentsMargins(10, 0, 0, 0);
429 widgetFrame->setLayout(vbox);
431 effect->setGroupIndex(groupIndex());
432 vbox->addWidget(effect);
435 QString CollapsibleEffect::infoString() const
437 return m_info.toString();
440 void CollapsibleEffect::removeGroup(int ix, QVBoxLayout *layout)
442 QVBoxLayout *vbox = static_cast<QVBoxLayout *>(widgetFrame->layout());
443 if (vbox == NULL) return;
445 for (int j = vbox->count() - 1; j >= 0; j--) {
446 QLayoutItem *child = vbox->takeAt(j);
447 CollapsibleEffect *e = static_cast<CollapsibleEffect *>(child->widget());
448 layout->insertWidget(ix, e);
449 e->updateGroupIndex(-1);
454 int CollapsibleEffect::index() const
459 int CollapsibleEffect::groupIndex() const
461 if (m_isGroup) return m_index;
465 int CollapsibleEffect::effectIndex() const
467 if (m_effect.isNull()) return -1;
468 return m_effect.attribute("kdenlive_ix").toInt();
471 void CollapsibleEffect::updateWidget(ItemInfo info, int index, QDomElement effect, EffectMetaInfo *metaInfo)
475 delete m_paramWidget;
476 m_paramWidget = NULL;
479 setupWidget(info, index, metaInfo);
482 void CollapsibleEffect::setupWidget(ItemInfo info, int index, EffectMetaInfo *metaInfo)
484 if (m_effect.isNull()) {
485 // kDebug() << "// EMPTY EFFECT STACK";
489 if (m_effect.attribute("tag") == "region") {
490 QVBoxLayout *vbox = new QVBoxLayout(widgetFrame);
491 vbox->setContentsMargins(0, 0, 0, 0);
493 QDomNodeList effects = m_effect.elementsByTagName("effect");
494 QDomNodeList origin_effects = m_original_effect.elementsByTagName("effect");
495 QWidget *container = new QWidget(widgetFrame);
496 vbox->addWidget(container);
497 m_paramWidget = new ParameterContainer(m_effect.toElement(), info, metaInfo, index, container);
498 for (int i = 0; i < effects.count(); i++) {
499 CollapsibleEffect *coll = new CollapsibleEffect(effects.at(i).toElement(), origin_effects.at(i).toElement(), info, i, metaInfo, container);
500 m_subParamWidgets.append(coll);
501 //container = new QWidget(widgetFrame);
502 vbox->addWidget(coll);
503 //p = new ParameterContainer(effects.at(i).toElement(), info, isEffect, container);
508 m_paramWidget = new ParameterContainer(m_effect, info, metaInfo, index, widgetFrame);
509 if (m_effect.firstChildElement("parameter").isNull()) {
510 // Effect has no parameter, don't allow expand
511 collapseButton->setEnabled(false);
512 widgetFrame->setVisible(false);
515 if (collapseButton->isEnabled() && m_info.isCollapsed) {
516 widgetFrame->setVisible(false);
517 collapseButton->setArrowType(Qt::RightArrow);
520 connect (m_paramWidget, SIGNAL(parameterChanged(const QDomElement, const QDomElement, int)), this, SIGNAL(parameterChanged(const QDomElement, const QDomElement, int)));
522 connect(m_paramWidget, SIGNAL(startFilterJob(QString,QString,QString,QString,QString,QString)), this, SIGNAL(startFilterJob(QString,QString,QString,QString,QString,QString)));
524 connect (this, SIGNAL(syncEffectsPos(int)), m_paramWidget, SIGNAL(syncEffectsPos(int)));
525 connect (this, SIGNAL(effectStateChanged(bool)), m_paramWidget, SIGNAL(effectStateChanged(bool)));
526 connect (m_paramWidget, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
527 connect (m_paramWidget, SIGNAL(seekTimeline(int)), this, SIGNAL(seekTimeline(int)));
532 void CollapsibleEffect::updateTimecodeFormat()
534 m_paramWidget->updateTimecodeFormat();
535 if (!m_subParamWidgets.isEmpty()) {
537 for (int i = 0; i < m_subParamWidgets.count(); i++)
538 m_subParamWidgets.at(i)->updateTimecodeFormat();
542 void CollapsibleEffect::slotSyncEffectsPos(int pos)
544 emit syncEffectsPos(pos);
547 void CollapsibleEffect::dragEnterEvent(QDragEnterEvent *event)
549 if (event->mimeData()->hasFormat("kdenlive/effectslist"))
550 event->acceptProposedAction();
553 void CollapsibleEffect::dropEvent(QDropEvent *event)
555 const QString effects = QString::fromUtf8(event->mimeData()->data("kdenlive/effectslist"));
556 //event->acceptProposedAction();
558 doc.setContent(effects, true);
559 const QDomElement e = doc.documentElement();
560 int ix = e.attribute("kdenlive_ix").toInt();
563 QVBoxLayout *vbox = static_cast<QVBoxLayout *>(widgetFrame->layout());
564 if (vbox == NULL) return;
565 CollapsibleEffect *e = static_cast<CollapsibleEffect *>(vbox->itemAt(vbox->count() -1)->widget());
566 last_index = e->effectIndex();
568 emit moveEffect(ix, this, last_index);
569 event->setDropAction(Qt::MoveAction);
573 ParameterContainer::ParameterContainer(QDomElement effect, ItemInfo info, EffectMetaInfo *metaInfo, int index, QWidget * parent) :
575 m_keyframeEditor(NULL),
576 m_geometryWidget(NULL),
577 m_metaInfo(metaInfo),
580 m_in = info.cropStart.frames(KdenliveSettings::project_fps());
581 m_out = (info.cropStart + info.cropDuration).frames(KdenliveSettings::project_fps()) - 1;
583 QDomNodeList namenode = effect.childNodes(); //elementsByTagName("parameter");
585 QDomElement e = effect.toElement();
586 int minFrame = e.attribute("start").toInt();
587 int maxFrame = e.attribute("end").toInt();
588 // In transitions, maxFrame is in fact one frame after the end of transition
589 if (maxFrame > 0) maxFrame --;
591 bool disable = effect.attribute("disable") == "1" && KdenliveSettings::disable_effect_parameters();
592 parent->setEnabled(!disable);
595 m_vbox = new QVBoxLayout(parent);
596 m_vbox->setContentsMargins(0, 0, 0, 0);
597 m_vbox->setSpacing(2);
599 for (int i = 0; i < namenode.count() ; i++) {
600 QDomElement pa = namenode.item(i).toElement();
601 if (pa.tagName() != "parameter") continue;
602 QDomElement na = pa.firstChildElement("name");
603 QDomElement commentElem = pa.firstChildElement("comment");
604 QString type = pa.attribute("type");
605 QString paramName = na.isNull() ? pa.attribute("name") : i18n(na.text().toUtf8().data());
607 if (!commentElem.isNull())
608 comment = i18n(commentElem.text().toUtf8().data());
609 QWidget * toFillin = new QWidget(parent);
610 QString value = pa.attribute("value").isNull() ?
611 pa.attribute("default") : pa.attribute("value");
614 /** See effects/README for info on the different types */
616 if (type == "double" || type == "constant") {
619 if (pa.attribute("min").contains('%'))
620 min = ProfilesDialog::getStringEval(m_metaInfo->profile, pa.attribute("min"), m_metaInfo->frameSize);
622 min = pa.attribute("min").toDouble();
623 if (pa.attribute("max").contains('%'))
624 max = ProfilesDialog::getStringEval(m_metaInfo->profile, pa.attribute("max"), m_metaInfo->frameSize);
626 max = pa.attribute("max").toDouble();
628 DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, value.toDouble(), min, max,
629 pa.attribute("default").toDouble(), comment, -1, pa.attribute("suffix"), pa.attribute("decimals").toInt(), parent);
630 doubleparam->setFocusPolicy(Qt::StrongFocus);
631 m_vbox->addWidget(doubleparam);
632 m_valueItems[paramName] = doubleparam;
633 connect(doubleparam, SIGNAL(valueChanged(double)), this, SLOT(slotCollectAllParameters()));
634 connect(this, SIGNAL(showComments(bool)), doubleparam, SLOT(slotShowComment(bool)));
635 } else if (type == "list") {
636 Listval *lsval = new Listval;
637 lsval->setupUi(toFillin);
638 lsval->list->setFocusPolicy(Qt::StrongFocus);
639 QStringList listitems = pa.attribute("paramlist").split(';');
640 if (listitems.count() == 1) {
641 // probably custom effect created before change to ';' as separator
642 listitems = pa.attribute("paramlist").split(",");
644 QDomElement list = pa.firstChildElement("paramlistdisplay");
645 QStringList listitemsdisplay;
646 if (!list.isNull()) {
647 listitemsdisplay = i18n(list.text().toUtf8().data()).split(',');
649 listitemsdisplay = i18n(pa.attribute("paramlistdisplay").toUtf8().data()).split(',');
651 if (listitemsdisplay.count() != listitems.count())
652 listitemsdisplay = listitems;
653 lsval->list->setIconSize(QSize(30, 30));
654 for (int i = 0; i < listitems.count(); i++) {
655 lsval->list->addItem(listitemsdisplay.at(i), listitems.at(i));
656 QString entry = listitems.at(i);
657 if (!entry.isEmpty() && (entry.endsWith(".png") || entry.endsWith(".pgm"))) {
658 if (!CollapsibleEffect::iconCache.contains(entry)) {
660 CollapsibleEffect::iconCache[entry] = pix.scaled(30, 30);
662 lsval->list->setItemIcon(i, QPixmap::fromImage(CollapsibleEffect::iconCache[entry]));
665 if (!value.isEmpty()) lsval->list->setCurrentIndex(listitems.indexOf(value));
666 lsval->name->setText(paramName);
667 lsval->labelComment->setText(comment);
668 lsval->widgetComment->setHidden(true);
669 m_valueItems[paramName] = lsval;
670 connect(lsval->list, SIGNAL(currentIndexChanged(int)) , this, SLOT(slotCollectAllParameters()));
671 if (!comment.isEmpty())
672 connect(this, SIGNAL(showComments(bool)), lsval->widgetComment, SLOT(setVisible(bool)));
673 m_uiItems.append(lsval);
674 } else if (type == "bool") {
675 Boolval *bval = new Boolval;
676 bval->setupUi(toFillin);
677 bval->checkBox->setCheckState(value == "0" ? Qt::Unchecked : Qt::Checked);
678 bval->name->setText(paramName);
679 bval->labelComment->setText(comment);
680 bval->widgetComment->setHidden(true);
681 m_valueItems[paramName] = bval;
682 connect(bval->checkBox, SIGNAL(stateChanged(int)) , this, SLOT(slotCollectAllParameters()));
683 if (!comment.isEmpty())
684 connect(this, SIGNAL(showComments(bool)), bval->widgetComment, SLOT(setVisible(bool)));
685 m_uiItems.append(bval);
686 } else if (type == "complex") {
687 ComplexParameter *pl = new ComplexParameter;
688 pl->setupParam(effect, pa.attribute("name"), 0, 100);
689 m_vbox->addWidget(pl);
690 m_valueItems[paramName+"complex"] = pl;
691 connect(pl, SIGNAL(parameterChanged()), this, SLOT(slotCollectAllParameters()));
692 } else if (type == "geometry") {
693 if (KdenliveSettings::on_monitor_effects()) {
694 m_geometryWidget = new GeometryWidget(m_metaInfo->monitor, m_metaInfo->timecode, 0, true, effect.hasAttribute("showrotation"), parent);
695 m_geometryWidget->setFrameSize(m_metaInfo->frameSize);
696 m_geometryWidget->slotShowScene(!disable);
697 // connect this before setupParam to make sure the monitor scene shows up at startup
698 connect(m_geometryWidget, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
699 connect(m_geometryWidget, SIGNAL(parameterChanged()), this, SLOT(slotCollectAllParameters()));
700 if (minFrame == maxFrame)
701 m_geometryWidget->setupParam(pa, m_in, m_out);
703 m_geometryWidget->setupParam(pa, minFrame, maxFrame);
704 m_vbox->addWidget(m_geometryWidget);
705 m_valueItems[paramName+"geometry"] = m_geometryWidget;
706 connect(m_geometryWidget, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
707 connect(this, SIGNAL(syncEffectsPos(int)), m_geometryWidget, SLOT(slotSyncPosition(int)));
708 connect(this, SIGNAL(effectStateChanged(bool)), m_geometryWidget, SLOT(slotShowScene(bool)));
710 Geometryval *geo = new Geometryval(m_metaInfo->profile, m_metaInfo->timecode, m_metaInfo->frameSize, 0);
711 if (minFrame == maxFrame)
712 geo->setupParam(pa, m_in, m_out);
714 geo->setupParam(pa, minFrame, maxFrame);
715 m_vbox->addWidget(geo);
716 m_valueItems[paramName+"geometry"] = geo;
717 connect(geo, SIGNAL(parameterChanged()), this, SLOT(slotCollectAllParameters()));
718 connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
719 connect(this, SIGNAL(syncEffectsPos(int)), geo, SLOT(slotSyncPosition(int)));
721 } else if (type == "addedgeometry") {
722 // this is a parameter that should be linked to the geometry widget, for example rotation, shear, ...
723 if (m_geometryWidget) m_geometryWidget->addParameter(pa);
724 } else if (type == "keyframe" || type == "simplekeyframe") {
725 // keyframe editor widget
726 if (m_keyframeEditor == NULL) {
728 if (pa.attribute("widget") == "corners") {
729 // we want a corners-keyframe-widget
730 CornersWidget *corners = new CornersWidget(m_metaInfo->monitor, pa, m_in, m_out, m_metaInfo->timecode, e.attribute("active_keyframe", "-1").toInt(), parent);
731 corners->slotShowScene(!disable);
732 connect(corners, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
733 connect(this, SIGNAL(effectStateChanged(bool)), corners, SLOT(slotShowScene(bool)));
734 connect(this, SIGNAL(syncEffectsPos(int)), corners, SLOT(slotSyncPosition(int)));
735 geo = static_cast<KeyframeEdit *>(corners);
737 geo = new KeyframeEdit(pa, m_in, m_out, m_metaInfo->timecode, e.attribute("active_keyframe", "-1").toInt());
739 m_vbox->addWidget(geo);
740 m_valueItems[paramName+"keyframe"] = geo;
741 m_keyframeEditor = geo;
742 connect(geo, SIGNAL(parameterChanged()), this, SLOT(slotCollectAllParameters()));
743 connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
744 connect(this, SIGNAL(showComments(bool)), geo, SIGNAL(showComments(bool)));
746 // we already have a keyframe editor, so just add another column for the new param
747 m_keyframeEditor->addParameter(pa);
749 } else if (type == "color") {
750 if (value.startsWith('#'))
751 value = value.replace('#', "0x");
752 ChooseColorWidget *choosecolor = new ChooseColorWidget(paramName, value, parent);
753 m_vbox->addWidget(choosecolor);
754 m_valueItems[paramName] = choosecolor;
755 connect(choosecolor, SIGNAL(displayMessage(const QString&, int)), this, SIGNAL(displayMessage(const QString&, int)));
756 connect(choosecolor, SIGNAL(modified()) , this, SLOT(slotCollectAllParameters()));
757 } else if (type == "position") {
758 int pos = value.toInt();
759 if (effect.attribute("id") == "fadein" || effect.attribute("id") == "fade_from_black") {
761 } else if (effect.attribute("id") == "fadeout" || effect.attribute("id") == "fade_to_black") {
762 // fadeout position starts from clip end
765 PositionEdit *posedit = new PositionEdit(paramName, pos, 0, m_out - m_in, m_metaInfo->timecode);
766 m_vbox->addWidget(posedit);
767 m_valueItems[paramName+"position"] = posedit;
768 connect(posedit, SIGNAL(parameterChanged()), this, SLOT(slotCollectAllParameters()));
769 } else if (type == "curve") {
770 KisCurveWidget *curve = new KisCurveWidget(parent);
771 curve->setMaxPoints(pa.attribute("max").toInt());
772 QList<QPointF> points;
773 int number = EffectsList::parameter(e, pa.attribute("number")).toInt();
774 QString inName = pa.attribute("inpoints");
775 QString outName = pa.attribute("outpoints");
776 int start = pa.attribute("min").toInt();
777 for (int j = start; j <= number; j++) {
779 in.replace("%i", QString::number(j));
780 QString out = outName;
781 out.replace("%i", QString::number(j));
782 points << QPointF(EffectsList::parameter(e, in).toDouble(), EffectsList::parameter(e, out).toDouble());
784 if (!points.isEmpty())
785 curve->setCurve(KisCubicCurve(points));
786 MySpinBox *spinin = new MySpinBox();
787 spinin->setRange(0, 1000);
788 MySpinBox *spinout = new MySpinBox();
789 spinout->setRange(0, 1000);
790 curve->setupInOutControls(spinin, spinout, 0, 1000);
791 m_vbox->addWidget(curve);
792 m_vbox->addWidget(spinin);
793 m_vbox->addWidget(spinout);
795 connect(curve, SIGNAL(modified()), this, SLOT(slotCollectAllParameters()));
796 m_valueItems[paramName] = curve;
798 QString depends = pa.attribute("depends");
799 if (!depends.isEmpty())
800 meetDependency(paramName, type, EffectsList::parameter(e, depends));
801 } else if (type == "bezier_spline") {
802 BezierSplineWidget *widget = new BezierSplineWidget(value, parent);
804 m_vbox->addWidget(widget);
805 m_valueItems[paramName] = widget;
806 connect(widget, SIGNAL(modified()), this, SLOT(slotCollectAllParameters()));
807 QString depends = pa.attribute("depends");
808 if (!depends.isEmpty())
809 meetDependency(paramName, type, EffectsList::parameter(e, depends));
811 } else if (type == "roto-spline") {
812 RotoWidget *roto = new RotoWidget(value, m_metaInfo->monitor, info, m_metaInfo->timecode, parent);
813 roto->slotShowScene(!disable);
814 connect(roto, SIGNAL(valueChanged()), this, SLOT(slotCollectAllParameters()));
815 connect(roto, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
816 connect(roto, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
817 connect(this, SIGNAL(syncEffectsPos(int)), roto, SLOT(slotSyncPosition(int)));
818 connect(this, SIGNAL(effectStateChanged(bool)), roto, SLOT(slotShowScene(bool)));
819 m_vbox->addWidget(roto);
820 m_valueItems[paramName] = roto;
822 } else if (type == "wipe") {
823 Wipeval *wpval = new Wipeval;
824 wpval->setupUi(toFillin);
825 wipeInfo w = getWipeInfo(value);
828 wpval->start_up->setChecked(true);
831 wpval->start_down->setChecked(true);
834 wpval->start_right->setChecked(true);
837 wpval->start_left->setChecked(true);
840 wpval->start_center->setChecked(true);
845 wpval->end_up->setChecked(true);
848 wpval->end_down->setChecked(true);
851 wpval->end_right->setChecked(true);
854 wpval->end_left->setChecked(true);
857 wpval->end_center->setChecked(true);
860 wpval->start_transp->setValue(w.startTransparency);
861 wpval->end_transp->setValue(w.endTransparency);
862 m_valueItems[paramName] = wpval;
863 connect(wpval->end_up, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
864 connect(wpval->end_down, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
865 connect(wpval->end_left, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
866 connect(wpval->end_right, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
867 connect(wpval->end_center, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
868 connect(wpval->start_up, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
869 connect(wpval->start_down, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
870 connect(wpval->start_left, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
871 connect(wpval->start_right, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
872 connect(wpval->start_center, SIGNAL(clicked()), this, SLOT(slotCollectAllParameters()));
873 connect(wpval->start_transp, SIGNAL(valueChanged(int)), this, SLOT(slotCollectAllParameters()));
874 connect(wpval->end_transp, SIGNAL(valueChanged(int)), this, SLOT(slotCollectAllParameters()));
875 //wpval->title->setTitle(na.toElement().text());
876 m_uiItems.append(wpval);
877 } else if (type == "url") {
878 Urlval *cval = new Urlval;
879 cval->setupUi(toFillin);
880 cval->label->setText(paramName);
881 cval->urlwidget->fileDialog()->setFilter(ProjectList::getExtensions());
882 m_valueItems[paramName] = cval;
883 cval->urlwidget->setUrl(KUrl(value));
884 connect(cval->urlwidget, SIGNAL(returnPressed()) , this, SLOT(slotCollectAllParameters()));
885 connect(cval->urlwidget, SIGNAL(urlSelected(const KUrl&)) , this, SLOT(slotCollectAllParameters()));
886 m_uiItems.append(cval);
887 } else if (type == "keywords") {
888 Keywordval* kval = new Keywordval;
889 kval->setupUi(toFillin);
890 kval->label->setText(paramName);
891 kval->lineeditwidget->setText(value);
892 QDomElement klistelem = pa.firstChildElement("keywords");
893 QDomElement kdisplaylistelem = pa.firstChildElement("keywordsdisplay");
894 QStringList keywordlist;
895 QStringList keyworddisplaylist;
896 if (!klistelem.isNull()) {
897 keywordlist = klistelem.text().split(';');
898 keyworddisplaylist = i18n(kdisplaylistelem.text().toUtf8().data()).split(';');
900 if (keyworddisplaylist.count() != keywordlist.count()) {
901 keyworddisplaylist = keywordlist;
903 for (int i = 0; i < keywordlist.count(); i++) {
904 kval->comboboxwidget->addItem(keyworddisplaylist.at(i), keywordlist.at(i));
906 // Add disabled user prompt at index 0
907 kval->comboboxwidget->insertItem(0, i18n("<select a keyword>"), "");
908 kval->comboboxwidget->model()->setData( kval->comboboxwidget->model()->index(0,0), QVariant(Qt::NoItemFlags), Qt::UserRole -1);
909 kval->comboboxwidget->setCurrentIndex(0);
910 m_valueItems[paramName] = kval;
911 connect(kval->lineeditwidget, SIGNAL(editingFinished()) , this, SLOT(collectAllParameters()));
912 connect(kval->comboboxwidget, SIGNAL(activated (const QString&)), this, SLOT(collectAllParameters()));
913 m_uiItems.append(kval);
914 } else if (type == "fontfamily") {
915 Fontval* fval = new Fontval;
916 fval->setupUi(toFillin);
917 fval->name->setText(paramName);
918 fval->fontfamilywidget->setCurrentFont(QFont(value));
919 m_valueItems[paramName] = fval;
920 connect(fval->fontfamilywidget, SIGNAL(currentFontChanged(const QFont &)), this, SLOT(collectAllParameters())) ;
921 m_uiItems.append(fval);
922 } else if (type == "filterjob") {
923 QVBoxLayout *l= new QVBoxLayout(toFillin);
924 QPushButton *button = new QPushButton(paramName, toFillin);
925 l->addWidget(button);
926 m_valueItems[paramName] = button;
927 connect(button, SIGNAL(pressed()), this, SLOT(slotStartFilterJobAction()));
934 m_vbox->addWidget(toFillin);
938 m_vbox->addStretch();
940 if (m_keyframeEditor)
941 m_keyframeEditor->checkVisibleParam();
943 // Make sure all doubleparam spinboxes have the same width, looks much better
944 QList<DoubleParameterWidget *> allWidgets = findChildren<DoubleParameterWidget *>();
946 for (int i = 0; i < allWidgets.count(); i++) {
947 if (minSize < allWidgets.at(i)->spinSize()) minSize = allWidgets.at(i)->spinSize();
949 for (int i = 0; i < allWidgets.count(); i++) {
950 allWidgets.at(i)->setSpinSize(minSize);
954 ParameterContainer::~ParameterContainer()
956 //clearLayout(m_vbox);
960 void ParameterContainer::meetDependency(const QString& name, QString type, QString value)
962 if (type == "curve") {
963 KisCurveWidget *curve = (KisCurveWidget*)m_valueItems[name];
965 int color = value.toInt();
966 curve->setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(curve->size(), (ColorTools::ColorsRGB)(color == 3 ? 4 : color), 0.8)));
968 } else if (type == "bezier_spline") {
969 BezierSplineWidget *widget = (BezierSplineWidget*)m_valueItems[name];
971 widget->setMode((BezierSplineWidget::CurveModes)((int)(value.toDouble() * 10)));
976 wipeInfo ParameterContainer::getWipeInfo(QString value)
979 // Convert old geometry values that used a comma as separator
980 if (value.contains(',')) value.replace(',','/');
981 QString start = value.section(';', 0, 0);
982 QString end = value.section(';', 1, 1).section('=', 1, 1);
983 if (start.startsWith("-100%/0"))
985 else if (start.startsWith("100%/0"))
987 else if (start.startsWith("0%/100%"))
989 else if (start.startsWith("0%/-100%"))
994 if (start.count(':') == 2)
995 info.startTransparency = start.section(':', -1).toInt();
997 info.startTransparency = 100;
999 if (end.startsWith("-100%/0"))
1001 else if (end.startsWith("100%/0"))
1003 else if (end.startsWith("0%/100%"))
1005 else if (end.startsWith("0%/-100%"))
1010 if (end.count(':') == 2)
1011 info.endTransparency = end.section(':', -1).toInt();
1013 info.endTransparency = 100;
1018 void ParameterContainer::updateTimecodeFormat()
1020 if (m_keyframeEditor)
1021 m_keyframeEditor->updateTimecodeFormat();
1023 QDomNodeList namenode = m_effect.elementsByTagName("parameter");
1024 for (int i = 0; i < namenode.count() ; i++) {
1025 QDomNode pa = namenode.item(i);
1026 QDomElement na = pa.firstChildElement("name");
1027 QString type = pa.attributes().namedItem("type").nodeValue();
1028 QString paramName = na.isNull() ? pa.attributes().namedItem("name").nodeValue() : i18n(na.text().toUtf8().data());
1030 if (type == "geometry") {
1031 if (KdenliveSettings::on_monitor_effects()) {
1032 if (m_geometryWidget) m_geometryWidget->updateTimecodeFormat();
1034 Geometryval *geom = ((Geometryval*)m_valueItems[paramName+"geometry"]);
1035 geom->updateTimecodeFormat();
1038 } else if (type == "position") {
1039 PositionEdit *posi = ((PositionEdit*)m_valueItems[paramName+"position"]);
1040 posi->updateTimecodeFormat();
1043 } else if (type == "roto-spline") {
1044 RotoWidget *widget = static_cast<RotoWidget *>(m_valueItems[paramName]);
1045 widget->updateTimecodeFormat();
1051 void ParameterContainer::slotCollectAllParameters()
1053 if (m_valueItems.isEmpty() || m_effect.isNull()) return;
1055 locale.setNumberOptions(QLocale::OmitGroupSeparator);
1056 const QDomElement oldparam = m_effect.cloneNode().toElement();
1057 //QDomElement newparam = oldparam.cloneNode().toElement();
1058 QDomNodeList namenode = m_effect.elementsByTagName("parameter");
1060 for (int i = 0; i < namenode.count() ; i++) {
1061 QDomNode pa = namenode.item(i);
1062 QDomElement na = pa.firstChildElement("name");
1063 QString type = pa.attributes().namedItem("type").nodeValue();
1064 QString paramName = na.isNull() ? pa.attributes().namedItem("name").nodeValue() : i18n(na.text().toUtf8().data());
1065 if (type == "complex")
1066 paramName.append("complex");
1067 else if (type == "position")
1068 paramName.append("position");
1069 else if (type == "geometry")
1070 paramName.append("geometry");
1071 else if (type == "keyframe")
1072 paramName.append("keyframe");
1073 if (type != "simplekeyframe" && type != "fixed" && type != "addedgeometry" && !m_valueItems.contains(paramName)) {
1074 kDebug() << "// Param: " << paramName << " NOT FOUND";
1079 if (type == "double" || type == "constant") {
1080 DoubleParameterWidget *doubleparam = (DoubleParameterWidget*)m_valueItems.value(paramName);
1081 setValue = locale.toString(doubleparam->getValue());
1082 } else if (type == "list") {
1083 KComboBox *box = ((Listval*)m_valueItems.value(paramName))->list;
1084 setValue = box->itemData(box->currentIndex()).toString();
1085 } else if (type == "bool") {
1086 QCheckBox *box = ((Boolval*)m_valueItems.value(paramName))->checkBox;
1087 setValue = box->checkState() == Qt::Checked ? "1" : "0" ;
1088 } else if (type == "color") {
1089 ChooseColorWidget *choosecolor = ((ChooseColorWidget*)m_valueItems.value(paramName));
1090 setValue = choosecolor->getColor();
1091 } else if (type == "complex") {
1092 ComplexParameter *complex = ((ComplexParameter*)m_valueItems.value(paramName));
1093 namenode.item(i) = complex->getParamDesc();
1094 } else if (type == "geometry") {
1095 if (KdenliveSettings::on_monitor_effects()) {
1096 if (m_geometryWidget) namenode.item(i).toElement().setAttribute("value", m_geometryWidget->getValue());
1098 Geometryval *geom = ((Geometryval*)m_valueItems.value(paramName));
1099 namenode.item(i).toElement().setAttribute("value", geom->getValue());
1101 } else if (type == "addedgeometry") {
1102 namenode.item(i).toElement().setAttribute("value", m_geometryWidget->getExtraValue(namenode.item(i).toElement().attribute("name")));
1103 } else if (type == "position") {
1104 PositionEdit *pedit = ((PositionEdit*)m_valueItems.value(paramName));
1105 int pos = pedit->getPosition();
1106 setValue = QString::number(pos);
1107 if (m_effect.attribute("id") == "fadein" || m_effect.attribute("id") == "fade_from_black") {
1108 // Make sure duration is not longer than clip
1109 /*if (pos > m_out) {
1111 pedit->setPosition(pos);
1113 EffectsList::setParameter(m_effect, "in", QString::number(m_in));
1114 EffectsList::setParameter(m_effect, "out", QString::number(m_in + pos));
1116 } else if (m_effect.attribute("id") == "fadeout" || m_effect.attribute("id") == "fade_to_black") {
1117 // Make sure duration is not longer than clip
1118 /*if (pos > m_out) {
1120 pedit->setPosition(pos);
1122 EffectsList::setParameter(m_effect, "in", QString::number(m_out - pos));
1123 EffectsList::setParameter(m_effect, "out", QString::number(m_out));
1126 } else if (type == "curve") {
1127 KisCurveWidget *curve = ((KisCurveWidget*)m_valueItems.value(paramName));
1128 QList<QPointF> points = curve->curve().points();
1129 QString number = pa.attributes().namedItem("number").nodeValue();
1130 QString inName = pa.attributes().namedItem("inpoints").nodeValue();
1131 QString outName = pa.attributes().namedItem("outpoints").nodeValue();
1132 int off = pa.attributes().namedItem("min").nodeValue().toInt();
1133 int end = pa.attributes().namedItem("max").nodeValue().toInt();
1134 EffectsList::setParameter(m_effect, number, QString::number(points.count()));
1135 for (int j = 0; (j < points.count() && j + off <= end); j++) {
1136 QString in = inName;
1137 in.replace("%i", QString::number(j + off));
1138 QString out = outName;
1139 out.replace("%i", QString::number(j + off));
1140 EffectsList::setParameter(m_effect, in, locale.toString(points.at(j).x()));
1141 EffectsList::setParameter(m_effect, out, locale.toString(points.at(j).y()));
1143 QString depends = pa.attributes().namedItem("depends").nodeValue();
1144 if (!depends.isEmpty())
1145 meetDependency(paramName, type, EffectsList::parameter(m_effect, depends));
1146 } else if (type == "bezier_spline") {
1147 BezierSplineWidget *widget = (BezierSplineWidget*)m_valueItems.value(paramName);
1148 setValue = widget->spline();
1149 QString depends = pa.attributes().namedItem("depends").nodeValue();
1150 if (!depends.isEmpty())
1151 meetDependency(paramName, type, EffectsList::parameter(m_effect, depends));
1153 } else if (type == "roto-spline") {
1154 RotoWidget *widget = static_cast<RotoWidget *>(m_valueItems.value(paramName));
1155 setValue = widget->getSpline();
1157 } else if (type == "wipe") {
1158 Wipeval *wp = (Wipeval*)m_valueItems.value(paramName);
1160 if (wp->start_left->isChecked())
1162 else if (wp->start_right->isChecked())
1164 else if (wp->start_up->isChecked())
1166 else if (wp->start_down->isChecked())
1168 else if (wp->start_center->isChecked())
1169 info.start = CENTER;
1172 info.startTransparency = wp->start_transp->value();
1174 if (wp->end_left->isChecked())
1176 else if (wp->end_right->isChecked())
1178 else if (wp->end_up->isChecked())
1180 else if (wp->end_down->isChecked())
1182 else if (wp->end_center->isChecked())
1186 info.endTransparency = wp->end_transp->value();
1188 setValue = getWipeString(info);
1189 } else if ((type == "simplekeyframe" || type == "keyframe") && m_keyframeEditor) {
1190 QDomElement elem = pa.toElement();
1191 QString realName = i18n(na.toElement().text().toUtf8().data());
1192 QString val = m_keyframeEditor->getValue(realName);
1193 elem.setAttribute("keyframes", val);
1195 if (m_keyframeEditor->isVisibleParam(realName))
1196 elem.setAttribute("intimeline", "1");
1197 else if (elem.hasAttribute("intimeline"))
1198 elem.removeAttribute("intimeline");
1199 } else if (type == "url") {
1200 KUrlRequester *req = ((Urlval*)m_valueItems.value(paramName))->urlwidget;
1201 setValue = req->url().path();
1202 } else if (type == "keywords"){
1203 QLineEdit *line = ((Keywordval*)m_valueItems.value(paramName))->lineeditwidget;
1204 QComboBox *combo = ((Keywordval*)m_valueItems.value(paramName))->comboboxwidget;
1205 if(combo->currentIndex())
1207 QString comboval = combo->itemData(combo->currentIndex()).toString();
1208 line->insert(comboval);
1209 combo->setCurrentIndex(0);
1211 setValue = line->text();
1212 } else if (type == "fontfamily") {
1213 QFontComboBox* fontfamily = ((Fontval*)m_valueItems.value(paramName))->fontfamilywidget;
1214 setValue = fontfamily->currentFont().family();
1216 if (!setValue.isNull())
1217 pa.attributes().namedItem("value").setNodeValue(setValue);
1220 emit parameterChanged(oldparam, m_effect, m_index);
1223 QString ParameterContainer::getWipeString(wipeInfo info)
1228 switch (info.start) {
1230 start = "-100%/0%:100%x100%";
1233 start = "100%/0%:100%x100%";
1236 start = "0%/100%:100%x100%";
1239 start = "0%/-100%:100%x100%";
1242 start = "0%/0%:100%x100%";
1245 start.append(':' + QString::number(info.startTransparency));
1249 end = "-100%/0%:100%x100%";
1252 end = "100%/0%:100%x100%";
1255 end = "0%/100%:100%x100%";
1258 end = "0%/-100%:100%x100%";
1261 end = "0%/0%:100%x100%";
1264 end.append(':' + QString::number(info.endTransparency));
1265 return QString(start + ";-1=" + end);
1268 int ParameterContainer::index() const
1273 void ParameterContainer::slotStartFilterJobAction()
1275 QDomNodeList namenode = m_effect.elementsByTagName("parameter");
1276 for (int i = 0; i < namenode.count() ; i++) {
1277 QDomElement pa = namenode.item(i).toElement();
1278 QString type = pa.attribute("type");
1279 if (type == "filterjob") {
1280 emit startFilterJob(pa.attribute("filtertag"), pa.attribute("filterparams"), pa.attribute("finalfilter"), pa.attribute("consumer"), pa.attribute("consumerparams"), pa.attribute("wantedproperties"));
1281 kDebug()<<" - - -PROPS:\n"<<pa.attribute("filtertag")<<"-"<< pa.attribute("filterparams")<<"-"<< pa.attribute("consumer")<<"-"<< pa.attribute("consumerparams")<<"-"<< pa.attribute("wantedproperties");