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(palette()));
74 EffectStackView2::~EffectStackView2()
79 void EffectStackView2::slotRenderPos(int pos)
81 if (m_effects.isEmpty()) return;
82 if (!m_effectMetaInfo.trackMode && m_clipref) pos = pos - m_clipref->startPos().frames(KdenliveSettings::project_fps());
84 for (int i = 0; i< m_effects.count(); i++)
85 m_effects.at(i)->slotSyncEffectsPos(pos);
88 void EffectStackView2::slotClipItemSelected(ClipItem* c, int ix)
90 if (c && !c->isEnabled()) return;
91 if (c && c == m_clipref) {
96 QString cname = m_clipref->clipName();
97 if (cname.length() > 30) {
98 m_ui.checkAll->setToolTip(i18n("Effects for %1").arg(cname));
100 m_ui.checkAll->setText(i18n("Effects for %1").arg(cname) + "...");
102 m_ui.checkAll->setToolTip(QString());
103 m_ui.checkAll->setText(i18n("Effects for %1").arg(cname));
105 m_ui.checkAll->setEnabled(true);
106 ix = c->selectedEffectIndex();
107 QString size = c->baseClip()->getProperty("frame_size");
108 double factor = c->baseClip()->getProperty("aspect_ratio").toDouble();
109 m_effectMetaInfo.frameSize = QPoint((int)(size.section('x', 0, 0).toInt() * factor + 0.5), size.section('x', 1, 1).toInt());
114 if (m_clipref == NULL) {
115 //TODO: clear list, reset paramdesc and info
117 //m_effectedit->transferParamDesc(QDomElement(), info);
122 m_effectMetaInfo.trackMode = false;
123 m_currentEffectList = m_clipref->effectList();
127 void EffectStackView2::slotTrackItemSelected(int ix, const TrackInfo info)
130 m_effectMetaInfo.trackMode = true;
131 m_currentEffectList = info.effectsList;
134 m_ui.checkAll->setToolTip(QString());
135 m_ui.checkAll->setText(i18n("Effects for track %1").arg(info.trackName.isEmpty() ? QString::number(ix) : info.trackName));
141 void EffectStackView2::setupListView(int ix)
144 m_draggedEffect = NULL;
145 m_draggedGroup = NULL;
146 disconnect(m_effectMetaInfo.monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
149 QWidget *view = m_ui.container->takeWidget();
154 view = new QWidget(m_ui.container);
155 m_ui.container->setWidget(view);
157 QVBoxLayout *vbox1 = new QVBoxLayout(view);
158 vbox1->setContentsMargins(0, 0, 0, 0);
159 vbox1->setSpacing(0);
161 if (m_currentEffectList.isEmpty()) m_ui.labelComment->setHidden(true);
163 for (int i = 0; i < m_currentEffectList.count(); i++) {
164 QDomElement d = m_currentEffectList.at(i).cloneNode().toElement();
166 kDebug() << " . . . . WARNING, NULL EFFECT IN STACK!!!!!!!!!";
170 CollapsibleGroup *group = NULL;
171 EffectInfo effectInfo;
172 effectInfo.fromString(d.attribute("kdenlive_info"));
173 if (effectInfo.groupIndex >= 0) {
174 // effect is in a group
176 for (int j = 0; j < vbox1->count(); j++) {
177 CollapsibleGroup *eff = static_cast<CollapsibleGroup *>(vbox1->itemAt(j)->widget());
178 if (eff->isGroup() && eff->groupIndex() == effectInfo.groupIndex) {
185 group = new CollapsibleGroup(effectInfo.groupIndex, i == 0, i == m_currentEffectList.count() - 1, effectInfo.groupName, m_ui.container->widget());
186 connect(group, SIGNAL(moveEffect(int,int,int,QString)), this, SLOT(slotMoveEffect(int,int,int,QString)));
187 connect(group, SIGNAL(unGroup(CollapsibleGroup*)), this , SLOT(slotUnGroup(CollapsibleGroup*)));
188 connect(group, SIGNAL(groupRenamed(CollapsibleGroup *)), this, SLOT(slotRenameGroup(CollapsibleGroup*)));
189 connect(group, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
190 connect(group, SIGNAL(deleteGroup(int, QDomDocument)), this , SLOT(slotDeleteGroup(int,QDomDocument)));
191 vbox1->addWidget(group);
192 group->installEventFilter( this );
194 if (effectInfo.groupIndex >= m_groupIndex) m_groupIndex = effectInfo.groupIndex + 1;
198 doc.appendChild(doc.importNode(d, true));
199 kDebug() << "IMPORTED STK: " << doc.toString();*/
202 if (m_effectMetaInfo.trackMode) {
203 info.track = m_trackInfo.type;
204 info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
205 info.cropStart = GenTime(0);
206 info.startPos = GenTime(-1);
209 else info = m_clipref->info();
211 CollapsibleEffect *currentEffect = new CollapsibleEffect(d, m_currentEffectList.at(i), info, &m_effectMetaInfo, i == m_currentEffectList.count() - 1, view);
212 m_effects.append(currentEffect);
214 group->addGroupEffect(currentEffect);
216 vbox1->addWidget(currentEffect);
218 if (currentEffect->effectIndex() == ix) currentEffect->setActive(true);
221 currentEffect->installEventFilter( this );
223 connect(currentEffect, SIGNAL(parameterChanged(const QDomElement, const QDomElement, int)), this , SLOT(slotUpdateEffectParams(const QDomElement, const QDomElement, int)));
224 connect(currentEffect, SIGNAL(startFilterJob(QString,QString,QString,QString,QString,QString)), this , SLOT(slotStartFilterJob(QString,QString,QString,QString,QString,QString)));
225 connect(currentEffect, SIGNAL(deleteEffect(const QDomElement)), this , SLOT(slotDeleteEffect(const QDomElement)));
226 connect(currentEffect, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
227 connect(currentEffect, SIGNAL(resetEffect(int)), this , SLOT(slotResetEffect(int)));
228 connect(currentEffect, SIGNAL(changeEffectPosition(int,bool)), this , SLOT(slotMoveEffectUp(int , bool)));
229 connect(currentEffect, SIGNAL(effectStateChanged(bool, int)), this, SLOT(slotUpdateEffectState(bool, int)));
230 connect(currentEffect, SIGNAL(activateEffect(int)), this, SLOT(slotSetCurrentEffect(int)));
231 connect(currentEffect, SIGNAL(checkMonitorPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
232 connect(currentEffect, SIGNAL(seekTimeline(int)), this , SLOT(slotSeekTimeline(int)));
233 connect(currentEffect, SIGNAL(createGroup(int)), this , SLOT(slotCreateGroup(int)));
234 connect(currentEffect, SIGNAL(moveEffect(int,int,int,QString)), this , SLOT(slotMoveEffect(int,int,int,QString)));
235 connect(currentEffect, SIGNAL(addEffect(QDomElement)), this , SLOT(slotAddEffect(QDomElement)));
237 //ui.title->setPixmap(icon.pixmap(QSize(12, 12)));
239 vbox1->addStretch(10);
240 slotUpdateCheckAllButton();
241 connect(m_effectMetaInfo.monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
243 // Wait a little bit for the new layout to be ready, then check if we have a scrollbar
244 QTimer::singleShot(200, this, SLOT(slotCheckWheelEventFilter()));
248 void EffectStackView2::slotCheckWheelEventFilter()
250 // If the effect stack widget has no scrollbar, we will not filter the
251 // mouse wheel events, so that user can easily adjust effect params
252 bool filterWheelEvent = false;
253 if (m_ui.container->verticalScrollBar() && m_ui.container->verticalScrollBar()->isVisible()) {
254 // widget has scroll bar,
255 filterWheelEvent = true;
257 for (int i = 0; i < m_effects.count(); i++) {
258 m_effects.at(i)->filterWheelEvent = filterWheelEvent;
262 void EffectStackView2::resizeEvent ( QResizeEvent * event )
264 slotCheckWheelEventFilter();
265 QWidget::resizeEvent(event);
268 bool EffectStackView2::eventFilter( QObject * o, QEvent * e )
270 // Check if user clicked in an effect's top bar to start dragging it
271 if (e->type() == QEvent::MouseButtonPress) {
272 m_draggedEffect = qobject_cast<CollapsibleEffect*>(o);
273 if (m_draggedEffect) {
274 QMouseEvent *me = static_cast<QMouseEvent *>(e);
275 if (me->button() == Qt::LeftButton && (m_draggedEffect->frame->underMouse() || m_draggedEffect->title->underMouse())) {
276 m_clickPoint = me->globalPos();
279 m_clickPoint = QPoint();
280 m_draggedEffect = NULL;
285 m_draggedGroup = qobject_cast<CollapsibleGroup*>(o);
286 if (m_draggedGroup) {
287 QMouseEvent *me = static_cast<QMouseEvent *>(e);
288 if (me->button() == Qt::LeftButton && (m_draggedGroup->framegroup->underMouse() || m_draggedGroup->title()->underMouse()))
289 m_clickPoint = me->globalPos();
291 m_clickPoint = QPoint();
292 m_draggedGroup = NULL;
298 /*if (e->type() == QEvent::MouseMove) {
299 if (qobject_cast<CollapsibleEffect*>(o)) {
300 QMouseEvent *me = static_cast<QMouseEvent *>(e);
301 if (me->buttons() != Qt::LeftButton) {
311 return QWidget::eventFilter(o, e);
314 void EffectStackView2::mouseMoveEvent(QMouseEvent * event)
316 if (m_draggedEffect || m_draggedGroup) {
317 if ((event->buttons() & Qt::LeftButton) && (m_clickPoint != QPoint()) && ((event->globalPos() - m_clickPoint).manhattanLength() >= QApplication::startDragDistance())) {
323 void EffectStackView2::mouseReleaseEvent(QMouseEvent * event)
325 m_draggedEffect = NULL;
326 m_draggedGroup = NULL;
327 QWidget::mouseReleaseEvent(event);
330 void EffectStackView2::startDrag()
332 // The data to be transferred by the drag and drop operation is contained in a QMimeData object
335 if (m_draggedEffect) {
336 QDomElement effect = m_draggedEffect->effect().cloneNode().toElement();
337 doc.appendChild(doc.importNode(effect, true));
338 pixmap = QPixmap::grabWidget(m_draggedEffect->title);
340 else if (m_draggedGroup) {
341 doc = m_draggedGroup->effectsData();
342 pixmap = QPixmap::grabWidget(m_draggedGroup->title());
345 QDrag *drag = new QDrag(this);
346 drag->setPixmap(pixmap);
347 QMimeData *mime = new QMimeData;
349 data.append(doc.toString().toUtf8());
350 mime->setData("kdenlive/effectslist", data);
352 // Assign ownership of the QMimeData object to the QDrag object.
353 drag->setMimeData(mime);
354 // Start the drag and drop operation
355 drag->exec(Qt::CopyAction | Qt::MoveAction, Qt::CopyAction);
359 void EffectStackView2::slotUpdateEffectState(bool disable, int index)
361 if (m_effectMetaInfo.trackMode)
362 emit changeEffectState(NULL, m_trackindex, index, disable);
364 emit changeEffectState(m_clipref, -1, index, disable);
365 slotUpdateCheckAllButton();
369 void EffectStackView2::raiseWindow(QWidget* dock)
371 if ((m_clipref || m_effectMetaInfo.trackMode) && dock)
376 void EffectStackView2::slotSeekTimeline(int pos)
378 if (m_effectMetaInfo.trackMode) {
379 emit seekTimeline(pos);
380 } else if (m_clipref) {
381 emit seekTimeline(m_clipref->startPos().frames(KdenliveSettings::project_fps()) + pos);
386 /*void EffectStackView2::slotRegionChanged()
388 if (!m_trackMode) emit updateClipRegion(m_clipref, m_ui.effectlist->currentRow(), m_ui.region_url->text());
391 void EffectStackView2::slotCheckMonitorPosition(int renderPos)
393 if (m_effectMetaInfo.trackMode || (m_clipref && renderPos >= m_clipref->startPos().frames(KdenliveSettings::project_fps()) && renderPos <= m_clipref->endPos().frames(KdenliveSettings::project_fps()))) {
394 if (!m_effectMetaInfo.monitor->getEffectEdit()->getScene()->views().at(0)->isVisible())
395 m_effectMetaInfo.monitor->slotEffectScene(true);
397 m_effectMetaInfo.monitor->slotEffectScene(false);
401 int EffectStackView2::isTrackMode(bool *ok) const
403 *ok = m_effectMetaInfo.trackMode;
407 void EffectStackView2::clear()
410 QWidget *view = m_ui.container->takeWidget();
414 m_ui.checkAll->setToolTip(QString());
415 m_ui.checkAll->setText(QString());
416 m_ui.checkAll->setEnabled(false);
417 m_ui.labelComment->setText(QString());
421 void EffectStackView2::slotCheckAll(int state)
425 m_ui.checkAll->blockSignals(true);
426 m_ui.checkAll->setCheckState(Qt::Checked);
427 m_ui.checkAll->blockSignals(false);
430 bool disabled = (state != 2);
431 for (int i = 0; i < m_effects.count(); i++) {
432 if (!m_effects.at(i)->isGroup()) {
433 m_effects.at(i)->slotEnable(!disabled);
438 void EffectStackView2::slotUpdateCheckAllButton()
440 bool hasEnabled = false;
441 bool hasDisabled = false;
443 for (int i = 0; i < m_effects.count(); i++) {
444 if (m_effects.at(i)->enabledBox->isChecked()) hasEnabled = true;
445 else hasDisabled = true;
448 m_ui.checkAll->blockSignals(true);
449 if (hasEnabled && hasDisabled)
450 m_ui.checkAll->setCheckState(Qt::PartiallyChecked);
452 m_ui.checkAll->setCheckState(Qt::Checked);
454 m_ui.checkAll->setCheckState(Qt::Unchecked);
455 m_ui.checkAll->blockSignals(false);
458 void EffectStackView2::deleteCurrentEffect()
460 for (int i = 0; i < m_effects.count(); i++) {
461 if (m_effects.at(i)->isActive()) {
462 slotDeleteEffect(m_effects.at(i)->effect());
468 void EffectStackView2::updateProjectFormat(MltVideoProfile profile, Timecode t)
470 m_effectMetaInfo.profile = profile;
471 m_effectMetaInfo.timecode = t;
474 void EffectStackView2::updateTimecodeFormat()
476 for (int i = 0; i< m_effects.count(); i++)
477 m_effects.at(i)->updateTimecodeFormat();
480 CollapsibleEffect *EffectStackView2::getEffectByIndex(int ix)
482 for (int i = 0; i< m_effects.count(); i++) {
483 if (m_effects.at(i)->effectIndex() == ix) {
484 return m_effects.at(i);
490 void EffectStackView2::slotUpdateEffectParams(const QDomElement old, const QDomElement e, int ix)
492 if (m_effectMetaInfo.trackMode)
493 emit updateEffect(NULL, m_trackindex, old, e, ix,false);
494 else if (m_clipref) {
495 emit updateEffect(m_clipref, -1, old, e, ix, false);
496 // Make sure the changed effect is currently displayed
497 slotSetCurrentEffect(ix);
499 QTimer::singleShot(200, this, SLOT(slotCheckWheelEventFilter()));
502 void EffectStackView2::slotSetCurrentEffect(int ix)
504 if (m_clipref && ix != m_clipref->selectedEffectIndex())
505 m_clipref->setSelectedEffect(ix);
506 for (int i = 0; i < m_effects.count(); i++) {
507 if (m_effects.at(i)->effectIndex() == ix) {
508 m_effects.at(i)->setActive(true);
509 m_ui.labelComment->setText(i18n(m_effects.at(i)->effect().firstChildElement("description").firstChildElement("full").text().toUtf8().data()));
510 m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
512 else m_effects.at(i)->setActive(false);
516 void EffectStackView2::slotDeleteGroup(int groupIndex, QDomDocument doc)
518 QDomNodeList effects = doc.elementsByTagName("effect");
519 ClipItem * clip = NULL;
521 if (m_effectMetaInfo.trackMode) {
529 for (int i = 0; i < effects.count(); i++)
530 emit removeEffect(clip, ix, effects.at(i).toElement());
533 void EffectStackView2::slotDeleteEffect(const QDomElement effect)
535 if (m_effectMetaInfo.trackMode)
536 emit removeEffect(NULL, m_trackindex, effect);
538 emit removeEffect(m_clipref, -1, effect);
541 void EffectStackView2::slotAddEffect(QDomElement effect)
543 emit addEffect(m_clipref, effect);
546 void EffectStackView2::slotMoveEffectUp(int index, bool up)
548 if (up && index <= 1) return;
549 if (!up && index >= m_currentEffectList.count()) return;
557 if (m_effectMetaInfo.trackMode) emit changeEffectPosition(NULL, m_trackindex, index, endPos);
558 else emit changeEffectPosition(m_clipref, -1, index, endPos);
561 void EffectStackView2::slotStartFilterJob(const QString&filterName, const QString&filterParams, const QString&finalFilterName, const QString&consumer, const QString&consumerParams, const QString&properties)
563 if (!m_clipref) return;
564 emit startFilterJob(m_clipref->info(), m_clipref->clipProducer(), filterName, filterParams, finalFilterName, consumer, consumerParams, properties);
567 void EffectStackView2::slotResetEffect(int ix)
569 QDomElement old = m_currentEffectList.itemFromIndex(ix);
571 QString effectId = old.attribute("id");
572 QMap<QString, EffectsList*> effectLists;
573 effectLists["audio"] = &MainWindow::audioEffects;
574 effectLists["video"] = &MainWindow::videoEffects;
575 effectLists["custom"] = &MainWindow::customEffects;
576 foreach(const QString &type, effectLists.keys()) {
577 EffectsList *list = effectLists[type];
578 dom = list->getEffectByTag(QString(), effectId).cloneNode().toElement();
579 if (!dom.isNull()) break;
582 dom.setAttribute("kdenlive_ix", old.attribute("kdenlive_ix"));
583 if (m_effectMetaInfo.trackMode) {
584 EffectsList::setParameter(dom, "in", QString::number(0));
585 EffectsList::setParameter(dom, "out", QString::number(m_trackInfo.duration));
587 info.track = m_trackInfo.type;
588 info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
589 info.cropStart = GenTime(0);
590 info.startPos = GenTime(-1);
592 m_effects.at(ix)->updateWidget(info, dom, &m_effectMetaInfo);
593 emit updateEffect(NULL, m_trackindex, old, dom, ix,false);
595 m_clipref->initEffect(dom);
596 for (int i = 0; i < m_effects.count(); i++) {
597 if (m_effects.at(i)->effectIndex() == ix) {
598 m_effects.at(i)->updateWidget(m_clipref->info(), dom, &m_effectMetaInfo);
602 //m_ui.region_url->setUrl(KUrl(dom.attribute("region")));
603 emit updateEffect(m_clipref, -1, old, dom, ix,false);
607 emit showComments(m_ui.buttonShowComments->isChecked());
608 m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
611 void EffectStackView2::slotShowComments()
613 m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
614 emit showComments(m_ui.buttonShowComments->isChecked());
617 void EffectStackView2::slotCreateGroup(int ix)
619 QDomElement oldeffect = m_currentEffectList.itemFromIndex(ix);
620 QDomElement neweffect = oldeffect.cloneNode().toElement();
621 EffectInfo effectinfo;
622 effectinfo.fromString(oldeffect.attribute("kdenlive_info"));
623 effectinfo.groupIndex = m_groupIndex;
624 neweffect.setAttribute("kdenlive_info", effectinfo.toString());
627 if (m_effectMetaInfo.trackMode) {
628 info.track = m_trackInfo.type;
629 info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
630 info.cropStart = GenTime(0);
631 info.startPos = GenTime(-1);
633 emit updateEffect(NULL, m_trackindex, oldeffect, neweffect, ix, false);
635 emit updateEffect(m_clipref, -1, oldeffect, neweffect, ix, false);
638 QVBoxLayout *l = static_cast<QVBoxLayout *>(m_ui.container->widget()->layout());
640 CollapsibleEffect *effectToMove = NULL;
641 for (int i = 0; i < m_effects.count(); i++) {
642 if (m_effects.at(i)->effectIndex() == ix) {
643 effectToMove = m_effects.at(i);
644 groupPos = l->indexOf(effectToMove);
645 l->removeWidget(effectToMove);
650 CollapsibleGroup *group = new CollapsibleGroup(m_groupIndex, ix == 1, ix == m_currentEffectList.count() - 2, QString(), m_ui.container->widget());
652 connect(group, SIGNAL(moveEffect(int,int,int,QString)), this , SLOT(slotMoveEffect(int,int,int,QString)));
653 connect(group, SIGNAL(unGroup(CollapsibleGroup*)), this , SLOT(slotUnGroup(CollapsibleGroup*)));
654 connect(group, SIGNAL(groupRenamed(CollapsibleGroup *)), this , SLOT(slotRenameGroup(CollapsibleGroup*)));
655 connect(group, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
656 connect(group, SIGNAL(deleteGroup(int, QDomDocument)), this , SLOT(slotDeleteGroup(int,QDomDocument)));
657 l->insertWidget(groupPos, group);
658 group->installEventFilter( this );
659 group->addGroupEffect(effectToMove);
662 void EffectStackView2::slotMoveEffect(int currentIndex, int newIndex, int groupIndex, QString groupName)
664 CollapsibleEffect *effectToMove = getEffectByIndex(currentIndex);
665 if (effectToMove == NULL) return;
667 QDomElement oldeffect = effectToMove->effect();
668 QDomElement neweffect = oldeffect.cloneNode().toElement();
670 EffectInfo effectinfo;
671 effectinfo.fromString(oldeffect.attribute("kdenlive_info"));
672 effectinfo.groupIndex = groupIndex;
673 effectinfo.groupName = groupName;
674 neweffect.setAttribute("kdenlive_info", effectinfo.toString());
677 if (m_effectMetaInfo.trackMode) {
678 info.track = m_trackInfo.type;
679 info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
680 info.cropStart = GenTime(0);
681 info.startPos = GenTime(-1);
683 emit updateEffect(NULL, m_trackindex, oldeffect, neweffect, effectToMove->effectIndex(),false);
685 emit updateEffect(m_clipref, -1, oldeffect, neweffect, effectToMove->effectIndex(),false);
687 //if (currentIndex == newIndex) return;
688 // Update effect index with new position
689 if (m_effectMetaInfo.trackMode) {
690 emit changeEffectPosition(NULL, m_trackindex, currentIndex, newIndex);
693 emit changeEffectPosition(m_clipref, -1, currentIndex, newIndex);
697 void EffectStackView2::slotUnGroup(CollapsibleGroup* group)
699 QVBoxLayout *l = static_cast<QVBoxLayout *>(m_ui.container->widget()->layout());
700 int ix = l->indexOf(group);
701 group->removeGroup(ix, l);
702 group->deleteLater();
705 void EffectStackView2::slotRenameGroup(CollapsibleGroup *group)
707 QList <CollapsibleEffect*> effects = group->effects();
708 for (int i = 0; i < effects.count(); i++) {
709 QDomElement origin = effects.at(i)->effect();
710 QDomElement changed = origin.cloneNode().toElement();
711 changed.setAttribute("kdenlive_info", effects.at(i)->infoString());
712 if (m_effectMetaInfo.trackMode) {
713 emit updateEffect(NULL, m_trackindex, origin, changed, effects.at(i)->effectIndex(),false);
715 emit updateEffect(m_clipref, -1, origin, changed, effects.at(i)->effectIndex(),false);
720 #include "effectstackview2.moc"