1 /***************************************************************************
2 effecstackview.cpp2 - description
5 copyright : (C) 2008 by Marco Gittler (g.marco@freenet.de)
6 copyright : (C) 2012 by Jean-Baptiste Mardelle (jb@kdenlive.org)
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
19 #include "effectstackview2.h"
20 #include "effectslist.h"
22 #include "mainwindow.h"
23 #include "docclipbase.h"
24 #include "projectlist.h"
26 #include "monitoreditwidget.h"
27 #include "monitorscene.h"
28 #include "kdenlivesettings.h"
29 #include "collapsibleeffect.h"
30 #include "collapsiblegroup.h"
34 #include <KMessageBox>
35 #include <KStandardDirs>
36 #include <KFileDialog>
37 #include <KColorScheme>
40 #include <QTextStream>
42 #include <QInputDialog>
46 EffectStackView2::EffectStackView2(Monitor *monitor, QWidget *parent) :
50 m_draggedEffect(NULL),
54 m_effectMetaInfo.trackMode = false;
55 m_effectMetaInfo.monitor = monitor;
56 m_effects = QList <CollapsibleEffect*>();
59 setFont(KGlobalSettings::smallestReadableFont());
60 m_ui.checkAll->setToolTip(i18n("Enable/Disable all effects"));
61 m_ui.buttonShowComments->setIcon(KIcon("help-about"));
62 m_ui.buttonShowComments->setToolTip(i18n("Show additional information for the parameters"));
64 connect(m_ui.checkAll, SIGNAL(stateChanged(int)), this, SLOT(slotCheckAll(int)));
65 connect(m_ui.buttonShowComments, SIGNAL(clicked()), this, SLOT(slotShowComments()));
66 m_ui.labelComment->setHidden(true);
71 setStyleSheet(CollapsibleEffect::getStyleSheet());
74 EffectStackView2::~EffectStackView2()
78 void EffectStackView2::updatePalette()
80 setStyleSheet(CollapsibleEffect::getStyleSheet());
83 void EffectStackView2::slotRenderPos(int pos)
85 if (m_effects.isEmpty()) return;
86 if (!m_effectMetaInfo.trackMode && m_clipref) pos = pos - m_clipref->startPos().frames(KdenliveSettings::project_fps());
88 for (int i = 0; i< m_effects.count(); i++)
89 m_effects.at(i)->slotSyncEffectsPos(pos);
92 void EffectStackView2::slotClipItemSelected(ClipItem* c, int ix)
94 if (c && !c->isEnabled()) return;
95 if (c && c == m_clipref) {
100 QString cname = m_clipref->clipName();
101 if (cname.length() > 30) {
102 m_ui.checkAll->setToolTip(i18n("Effects for %1").arg(cname));
104 m_ui.checkAll->setText(i18n("Effects for %1").arg(cname) + "...");
106 m_ui.checkAll->setToolTip(QString());
107 m_ui.checkAll->setText(i18n("Effects for %1").arg(cname));
109 m_ui.checkAll->setEnabled(true);
110 ix = c->selectedEffectIndex();
111 QString size = c->baseClip()->getProperty("frame_size");
112 double factor = c->baseClip()->getProperty("aspect_ratio").toDouble();
113 m_effectMetaInfo.frameSize = QPoint((int)(size.section('x', 0, 0).toInt() * factor + 0.5), size.section('x', 1, 1).toInt());
118 if (m_clipref == NULL) {
119 //TODO: clear list, reset paramdesc and info
121 //m_effectedit->transferParamDesc(QDomElement(), info);
126 m_effectMetaInfo.trackMode = false;
127 m_currentEffectList = m_clipref->effectList();
131 void EffectStackView2::slotTrackItemSelected(int ix, const TrackInfo info)
134 m_effectMetaInfo.trackMode = true;
135 m_currentEffectList = info.effectsList;
138 m_ui.checkAll->setToolTip(QString());
139 m_ui.checkAll->setText(i18n("Effects for track %1").arg(info.trackName.isEmpty() ? QString::number(ix) : info.trackName));
145 void EffectStackView2::setupListView(int ix)
148 m_draggedEffect = NULL;
149 m_draggedGroup = NULL;
150 disconnect(m_effectMetaInfo.monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
153 QWidget *view = m_ui.container->takeWidget();
158 view = new QWidget(m_ui.container);
159 m_ui.container->setWidget(view);
161 QVBoxLayout *vbox1 = new QVBoxLayout(view);
162 vbox1->setContentsMargins(0, 0, 0, 0);
163 vbox1->setSpacing(0);
165 if (m_currentEffectList.isEmpty()) m_ui.labelComment->setHidden(true);
167 for (int i = 0; i < m_currentEffectList.count(); i++) {
168 QDomElement d = m_currentEffectList.at(i).cloneNode().toElement();
170 kDebug() << " . . . . WARNING, NULL EFFECT IN STACK!!!!!!!!!";
174 CollapsibleGroup *group = NULL;
175 EffectInfo effectInfo;
176 effectInfo.fromString(d.attribute("kdenlive_info"));
177 if (effectInfo.groupIndex >= 0) {
178 // effect is in a group
180 for (int j = 0; j < vbox1->count(); j++) {
181 CollapsibleGroup *eff = static_cast<CollapsibleGroup *>(vbox1->itemAt(j)->widget());
182 if (eff->isGroup() && eff->groupIndex() == effectInfo.groupIndex) {
189 group = new CollapsibleGroup(effectInfo.groupIndex, i == 0, i == m_currentEffectList.count() - 1, effectInfo.groupName, m_ui.container->widget());
190 connect(group, SIGNAL(moveEffect(int,int,int,QString)), this, SLOT(slotMoveEffect(int,int,int,QString)));
191 connect(group, SIGNAL(unGroup(CollapsibleGroup*)), this , SLOT(slotUnGroup(CollapsibleGroup*)));
192 connect(group, SIGNAL(groupRenamed(CollapsibleGroup *)), this, SLOT(slotRenameGroup(CollapsibleGroup*)));
193 connect(group, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
194 connect(group, SIGNAL(deleteGroup(int, QDomDocument)), this , SLOT(slotDeleteGroup(int,QDomDocument)));
195 vbox1->addWidget(group);
196 group->installEventFilter( this );
198 if (effectInfo.groupIndex >= m_groupIndex) m_groupIndex = effectInfo.groupIndex + 1;
202 doc.appendChild(doc.importNode(d, true));
203 kDebug() << "IMPORTED STK: " << doc.toString();*/
206 if (m_effectMetaInfo.trackMode) {
207 info.track = m_trackInfo.type;
208 info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
209 info.cropStart = GenTime(0);
210 info.startPos = GenTime(-1);
213 else info = m_clipref->info();
215 CollapsibleEffect *currentEffect = new CollapsibleEffect(d, m_currentEffectList.at(i), info, &m_effectMetaInfo, i == m_currentEffectList.count() - 1, view);
216 m_effects.append(currentEffect);
218 group->addGroupEffect(currentEffect);
220 vbox1->addWidget(currentEffect);
222 if (currentEffect->effectIndex() == ix) currentEffect->setActive(true);
225 currentEffect->installEventFilter( this );
227 connect(currentEffect, SIGNAL(parameterChanged(const QDomElement, const QDomElement, int)), this , SLOT(slotUpdateEffectParams(const QDomElement, const QDomElement, int)));
228 connect(currentEffect, SIGNAL(startFilterJob(QString,QString,QString,QString,QString,QString)), this , SLOT(slotStartFilterJob(QString,QString,QString,QString,QString,QString)));
229 connect(currentEffect, SIGNAL(deleteEffect(const QDomElement)), this , SLOT(slotDeleteEffect(const QDomElement)));
230 connect(currentEffect, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
231 connect(currentEffect, SIGNAL(resetEffect(int)), this , SLOT(slotResetEffect(int)));
232 connect(currentEffect, SIGNAL(changeEffectPosition(int,bool)), this , SLOT(slotMoveEffectUp(int , bool)));
233 connect(currentEffect, SIGNAL(effectStateChanged(bool, int)), this, SLOT(slotUpdateEffectState(bool, int)));
234 connect(currentEffect, SIGNAL(activateEffect(int)), this, SLOT(slotSetCurrentEffect(int)));
235 connect(currentEffect, SIGNAL(checkMonitorPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
236 connect(currentEffect, SIGNAL(seekTimeline(int)), this , SLOT(slotSeekTimeline(int)));
237 connect(currentEffect, SIGNAL(createGroup(int)), this , SLOT(slotCreateGroup(int)));
238 connect(currentEffect, SIGNAL(moveEffect(int,int,int,QString)), this , SLOT(slotMoveEffect(int,int,int,QString)));
239 connect(currentEffect, SIGNAL(addEffect(QDomElement)), this , SLOT(slotAddEffect(QDomElement)));
241 //ui.title->setPixmap(icon.pixmap(QSize(12, 12)));
243 vbox1->addStretch(10);
244 slotUpdateCheckAllButton();
245 connect(m_effectMetaInfo.monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
247 // Wait a little bit for the new layout to be ready, then check if we have a scrollbar
248 QTimer::singleShot(200, this, SLOT(slotCheckWheelEventFilter()));
252 void EffectStackView2::slotCheckWheelEventFilter()
254 // If the effect stack widget has no scrollbar, we will not filter the
255 // mouse wheel events, so that user can easily adjust effect params
256 bool filterWheelEvent = false;
257 if (m_ui.container->verticalScrollBar() && m_ui.container->verticalScrollBar()->isVisible()) {
258 // widget has scroll bar,
259 filterWheelEvent = true;
261 for (int i = 0; i < m_effects.count(); i++) {
262 m_effects.at(i)->filterWheelEvent = filterWheelEvent;
266 void EffectStackView2::resizeEvent ( QResizeEvent * event )
268 slotCheckWheelEventFilter();
269 QWidget::resizeEvent(event);
272 bool EffectStackView2::eventFilter( QObject * o, QEvent * e )
274 // Check if user clicked in an effect's top bar to start dragging it
275 if (e->type() == QEvent::MouseButtonPress) {
276 m_draggedEffect = qobject_cast<CollapsibleEffect*>(o);
277 if (m_draggedEffect) {
278 QMouseEvent *me = static_cast<QMouseEvent *>(e);
279 if (me->button() == Qt::LeftButton && (m_draggedEffect->frame->underMouse() || m_draggedEffect->title->underMouse())) {
280 m_clickPoint = me->globalPos();
283 m_clickPoint = QPoint();
284 m_draggedEffect = NULL;
289 m_draggedGroup = qobject_cast<CollapsibleGroup*>(o);
290 if (m_draggedGroup) {
291 QMouseEvent *me = static_cast<QMouseEvent *>(e);
292 if (me->button() == Qt::LeftButton && (m_draggedGroup->framegroup->underMouse() || m_draggedGroup->title()->underMouse()))
293 m_clickPoint = me->globalPos();
295 m_clickPoint = QPoint();
296 m_draggedGroup = NULL;
302 /*if (e->type() == QEvent::MouseMove) {
303 if (qobject_cast<CollapsibleEffect*>(o)) {
304 QMouseEvent *me = static_cast<QMouseEvent *>(e);
305 if (me->buttons() != Qt::LeftButton) {
315 return QWidget::eventFilter(o, e);
318 void EffectStackView2::mouseMoveEvent(QMouseEvent * event)
320 if (m_draggedEffect || m_draggedGroup) {
321 if ((event->buttons() & Qt::LeftButton) && (m_clickPoint != QPoint()) && ((event->globalPos() - m_clickPoint).manhattanLength() >= QApplication::startDragDistance())) {
327 void EffectStackView2::mouseReleaseEvent(QMouseEvent * event)
329 m_draggedEffect = NULL;
330 m_draggedGroup = NULL;
331 QWidget::mouseReleaseEvent(event);
334 void EffectStackView2::startDrag()
336 // The data to be transferred by the drag and drop operation is contained in a QMimeData object
339 if (m_draggedEffect) {
340 QDomElement effect = m_draggedEffect->effect().cloneNode().toElement();
341 doc.appendChild(doc.importNode(effect, true));
342 pixmap = QPixmap::grabWidget(m_draggedEffect->title);
344 else if (m_draggedGroup) {
345 doc = m_draggedGroup->effectsData();
346 pixmap = QPixmap::grabWidget(m_draggedGroup->title());
349 QDrag *drag = new QDrag(this);
350 drag->setPixmap(pixmap);
351 QMimeData *mime = new QMimeData;
353 data.append(doc.toString().toUtf8());
354 mime->setData("kdenlive/effectslist", data);
356 // Assign ownership of the QMimeData object to the QDrag object.
357 drag->setMimeData(mime);
358 // Start the drag and drop operation
359 drag->exec(Qt::CopyAction | Qt::MoveAction, Qt::CopyAction);
363 void EffectStackView2::slotUpdateEffectState(bool disable, int index)
365 if (m_effectMetaInfo.trackMode)
366 emit changeEffectState(NULL, m_trackindex, index, disable);
368 emit changeEffectState(m_clipref, -1, index, disable);
369 slotUpdateCheckAllButton();
373 void EffectStackView2::raiseWindow(QWidget* dock)
375 if ((m_clipref || m_effectMetaInfo.trackMode) && dock)
380 void EffectStackView2::slotSeekTimeline(int pos)
382 if (m_effectMetaInfo.trackMode) {
383 emit seekTimeline(pos);
384 } else if (m_clipref) {
385 emit seekTimeline(m_clipref->startPos().frames(KdenliveSettings::project_fps()) + pos);
390 /*void EffectStackView2::slotRegionChanged()
392 if (!m_trackMode) emit updateClipRegion(m_clipref, m_ui.effectlist->currentRow(), m_ui.region_url->text());
395 void EffectStackView2::slotCheckMonitorPosition(int renderPos)
397 if (m_effectMetaInfo.trackMode || (m_clipref && renderPos >= m_clipref->startPos().frames(KdenliveSettings::project_fps()) && renderPos <= m_clipref->endPos().frames(KdenliveSettings::project_fps()))) {
398 if (!m_effectMetaInfo.monitor->getEffectEdit()->getScene()->views().at(0)->isVisible())
399 m_effectMetaInfo.monitor->slotEffectScene(true);
401 m_effectMetaInfo.monitor->slotEffectScene(false);
405 int EffectStackView2::isTrackMode(bool *ok) const
407 *ok = m_effectMetaInfo.trackMode;
411 void EffectStackView2::clear()
414 QWidget *view = m_ui.container->takeWidget();
418 m_ui.checkAll->setToolTip(QString());
419 m_ui.checkAll->setText(QString());
420 m_ui.checkAll->setEnabled(false);
421 m_ui.labelComment->setText(QString());
425 void EffectStackView2::slotCheckAll(int state)
429 m_ui.checkAll->blockSignals(true);
430 m_ui.checkAll->setCheckState(Qt::Checked);
431 m_ui.checkAll->blockSignals(false);
434 bool disabled = (state != 2);
435 for (int i = 0; i < m_effects.count(); i++) {
436 if (!m_effects.at(i)->isGroup()) {
437 m_effects.at(i)->slotEnable(!disabled);
442 void EffectStackView2::slotUpdateCheckAllButton()
444 bool hasEnabled = false;
445 bool hasDisabled = false;
447 for (int i = 0; i < m_effects.count(); i++) {
448 if (m_effects.at(i)->enabledBox->isChecked()) hasEnabled = true;
449 else hasDisabled = true;
452 m_ui.checkAll->blockSignals(true);
453 if (hasEnabled && hasDisabled)
454 m_ui.checkAll->setCheckState(Qt::PartiallyChecked);
456 m_ui.checkAll->setCheckState(Qt::Checked);
458 m_ui.checkAll->setCheckState(Qt::Unchecked);
459 m_ui.checkAll->blockSignals(false);
462 void EffectStackView2::deleteCurrentEffect()
464 for (int i = 0; i < m_effects.count(); i++) {
465 if (m_effects.at(i)->isActive()) {
466 slotDeleteEffect(m_effects.at(i)->effect());
472 void EffectStackView2::updateProjectFormat(MltVideoProfile profile, Timecode t)
474 m_effectMetaInfo.profile = profile;
475 m_effectMetaInfo.timecode = t;
478 void EffectStackView2::updateTimecodeFormat()
480 for (int i = 0; i< m_effects.count(); i++)
481 m_effects.at(i)->updateTimecodeFormat();
484 CollapsibleEffect *EffectStackView2::getEffectByIndex(int ix)
486 for (int i = 0; i< m_effects.count(); i++) {
487 if (m_effects.at(i)->effectIndex() == ix) {
488 return m_effects.at(i);
494 void EffectStackView2::slotUpdateEffectParams(const QDomElement old, const QDomElement e, int ix)
496 if (m_effectMetaInfo.trackMode)
497 emit updateEffect(NULL, m_trackindex, old, e, ix,false);
498 else if (m_clipref) {
499 emit updateEffect(m_clipref, -1, old, e, ix, false);
500 // Make sure the changed effect is currently displayed
501 slotSetCurrentEffect(ix);
503 QTimer::singleShot(200, this, SLOT(slotCheckWheelEventFilter()));
506 void EffectStackView2::slotSetCurrentEffect(int ix)
508 if (m_clipref && ix != m_clipref->selectedEffectIndex())
509 m_clipref->setSelectedEffect(ix);
510 for (int i = 0; i < m_effects.count(); i++) {
511 if (m_effects.at(i)->effectIndex() == ix) {
512 m_effects.at(i)->setActive(true);
513 m_ui.labelComment->setText(i18n(m_effects.at(i)->effect().firstChildElement("description").firstChildElement("full").text().toUtf8().data()));
514 m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
516 else m_effects.at(i)->setActive(false);
520 void EffectStackView2::slotDeleteGroup(int groupIndex, QDomDocument doc)
522 QDomNodeList effects = doc.elementsByTagName("effect");
523 ClipItem * clip = NULL;
525 if (m_effectMetaInfo.trackMode) {
533 for (int i = 0; i < effects.count(); i++)
534 emit removeEffect(clip, ix, effects.at(i).toElement());
537 void EffectStackView2::slotDeleteEffect(const QDomElement effect)
539 if (m_effectMetaInfo.trackMode)
540 emit removeEffect(NULL, m_trackindex, effect);
542 emit removeEffect(m_clipref, -1, effect);
545 void EffectStackView2::slotAddEffect(QDomElement effect)
547 emit addEffect(m_clipref, effect);
550 void EffectStackView2::slotMoveEffectUp(int index, bool up)
552 if (up && index <= 1) return;
553 if (!up && index >= m_currentEffectList.count()) return;
561 if (m_effectMetaInfo.trackMode) emit changeEffectPosition(NULL, m_trackindex, index, endPos);
562 else emit changeEffectPosition(m_clipref, -1, index, endPos);
565 void EffectStackView2::slotStartFilterJob(const QString&filterName, const QString&filterParams, const QString&finalFilterName, const QString&consumer, const QString&consumerParams, const QString&properties)
567 if (!m_clipref) return;
568 emit startFilterJob(m_clipref->info(), m_clipref->clipProducer(), filterName, filterParams, finalFilterName, consumer, consumerParams, properties);
571 void EffectStackView2::slotResetEffect(int ix)
573 QDomElement old = m_currentEffectList.itemFromIndex(ix);
575 QString effectId = old.attribute("id");
576 QMap<QString, EffectsList*> effectLists;
577 effectLists["audio"] = &MainWindow::audioEffects;
578 effectLists["video"] = &MainWindow::videoEffects;
579 effectLists["custom"] = &MainWindow::customEffects;
580 foreach(const QString &type, effectLists.keys()) {
581 EffectsList *list = effectLists[type];
582 dom = list->getEffectByTag(QString(), effectId).cloneNode().toElement();
583 if (!dom.isNull()) break;
586 dom.setAttribute("kdenlive_ix", old.attribute("kdenlive_ix"));
587 if (m_effectMetaInfo.trackMode) {
588 EffectsList::setParameter(dom, "in", QString::number(0));
589 EffectsList::setParameter(dom, "out", QString::number(m_trackInfo.duration));
591 info.track = m_trackInfo.type;
592 info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
593 info.cropStart = GenTime(0);
594 info.startPos = GenTime(-1);
596 m_effects.at(ix)->updateWidget(info, dom, &m_effectMetaInfo);
597 emit updateEffect(NULL, m_trackindex, old, dom, ix,false);
599 m_clipref->initEffect(dom);
600 for (int i = 0; i < m_effects.count(); i++) {
601 if (m_effects.at(i)->effectIndex() == ix) {
602 m_effects.at(i)->updateWidget(m_clipref->info(), dom, &m_effectMetaInfo);
606 //m_ui.region_url->setUrl(KUrl(dom.attribute("region")));
607 emit updateEffect(m_clipref, -1, old, dom, ix,false);
611 emit showComments(m_ui.buttonShowComments->isChecked());
612 m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
615 void EffectStackView2::slotShowComments()
617 m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
618 emit showComments(m_ui.buttonShowComments->isChecked());
621 void EffectStackView2::slotCreateGroup(int ix)
623 QDomElement oldeffect = m_currentEffectList.itemFromIndex(ix);
624 QDomElement neweffect = oldeffect.cloneNode().toElement();
625 EffectInfo effectinfo;
626 effectinfo.fromString(oldeffect.attribute("kdenlive_info"));
627 effectinfo.groupIndex = m_groupIndex;
628 neweffect.setAttribute("kdenlive_info", effectinfo.toString());
631 if (m_effectMetaInfo.trackMode) {
632 info.track = m_trackInfo.type;
633 info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
634 info.cropStart = GenTime(0);
635 info.startPos = GenTime(-1);
637 emit updateEffect(NULL, m_trackindex, oldeffect, neweffect, ix, false);
639 emit updateEffect(m_clipref, -1, oldeffect, neweffect, ix, false);
642 QVBoxLayout *l = static_cast<QVBoxLayout *>(m_ui.container->widget()->layout());
644 CollapsibleEffect *effectToMove = NULL;
645 for (int i = 0; i < m_effects.count(); i++) {
646 if (m_effects.at(i)->effectIndex() == ix) {
647 effectToMove = m_effects.at(i);
648 groupPos = l->indexOf(effectToMove);
649 l->removeWidget(effectToMove);
654 CollapsibleGroup *group = new CollapsibleGroup(m_groupIndex, ix == 1, ix == m_currentEffectList.count() - 2, QString(), m_ui.container->widget());
656 connect(group, SIGNAL(moveEffect(int,int,int,QString)), this , SLOT(slotMoveEffect(int,int,int,QString)));
657 connect(group, SIGNAL(unGroup(CollapsibleGroup*)), this , SLOT(slotUnGroup(CollapsibleGroup*)));
658 connect(group, SIGNAL(groupRenamed(CollapsibleGroup *)), this , SLOT(slotRenameGroup(CollapsibleGroup*)));
659 connect(group, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
660 connect(group, SIGNAL(deleteGroup(int, QDomDocument)), this , SLOT(slotDeleteGroup(int,QDomDocument)));
661 l->insertWidget(groupPos, group);
662 group->installEventFilter( this );
663 group->addGroupEffect(effectToMove);
666 void EffectStackView2::slotMoveEffect(int currentIndex, int newIndex, int groupIndex, QString groupName)
668 CollapsibleEffect *effectToMove = getEffectByIndex(currentIndex);
669 if (effectToMove == NULL) return;
671 QDomElement oldeffect = effectToMove->effect();
672 QDomElement neweffect = oldeffect.cloneNode().toElement();
674 EffectInfo effectinfo;
675 effectinfo.fromString(oldeffect.attribute("kdenlive_info"));
676 effectinfo.groupIndex = groupIndex;
677 effectinfo.groupName = groupName;
678 neweffect.setAttribute("kdenlive_info", effectinfo.toString());
681 if (m_effectMetaInfo.trackMode) {
682 info.track = m_trackInfo.type;
683 info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
684 info.cropStart = GenTime(0);
685 info.startPos = GenTime(-1);
687 emit updateEffect(NULL, m_trackindex, oldeffect, neweffect, effectToMove->effectIndex(),false);
689 emit updateEffect(m_clipref, -1, oldeffect, neweffect, effectToMove->effectIndex(),false);
691 //if (currentIndex == newIndex) return;
692 // Update effect index with new position
693 if (m_effectMetaInfo.trackMode) {
694 emit changeEffectPosition(NULL, m_trackindex, currentIndex, newIndex);
697 emit changeEffectPosition(m_clipref, -1, currentIndex, newIndex);
701 void EffectStackView2::slotUnGroup(CollapsibleGroup* group)
703 QVBoxLayout *l = static_cast<QVBoxLayout *>(m_ui.container->widget()->layout());
704 int ix = l->indexOf(group);
705 group->removeGroup(ix, l);
706 group->deleteLater();
709 void EffectStackView2::slotRenameGroup(CollapsibleGroup *group)
711 QList <CollapsibleEffect*> effects = group->effects();
712 for (int i = 0; i < effects.count(); i++) {
713 QDomElement origin = effects.at(i)->effect();
714 QDomElement changed = origin.cloneNode().toElement();
715 changed.setAttribute("kdenlive_info", effects.at(i)->infoString());
716 if (m_effectMetaInfo.trackMode) {
717 emit updateEffect(NULL, m_trackindex, origin, changed, effects.at(i)->effectIndex(),false);
719 emit updateEffect(m_clipref, -1, origin, changed, effects.at(i)->effectIndex(),false);
724 #include "effectstackview2.moc"