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 vbox1->addWidget(group);
191 group->installEventFilter( this );
193 if (effectInfo.groupIndex >= m_groupIndex) m_groupIndex = effectInfo.groupIndex + 1;
197 doc.appendChild(doc.importNode(d, true));
198 kDebug() << "IMPORTED STK: " << doc.toString();*/
201 if (m_effectMetaInfo.trackMode) {
202 info.track = m_trackInfo.type;
203 info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
204 info.cropStart = GenTime(0);
205 info.startPos = GenTime(-1);
208 else info = m_clipref->info();
210 CollapsibleEffect *currentEffect = new CollapsibleEffect(d, m_currentEffectList.at(i), info, &m_effectMetaInfo, i == m_currentEffectList.count() - 1, view);
211 m_effects.append(currentEffect);
213 group->addGroupEffect(currentEffect);
215 vbox1->addWidget(currentEffect);
217 if (currentEffect->effectIndex() == ix) currentEffect->setActive(true);
220 currentEffect->installEventFilter( this );
222 connect(currentEffect, SIGNAL(parameterChanged(const QDomElement, const QDomElement, int)), this , SLOT(slotUpdateEffectParams(const QDomElement, const QDomElement, int)));
223 connect(currentEffect, SIGNAL(startFilterJob(QString,QString,QString,QString,QString,QString)), this , SLOT(slotStartFilterJob(QString,QString,QString,QString,QString,QString)));
224 connect(currentEffect, SIGNAL(deleteEffect(const QDomElement)), this , SLOT(slotDeleteEffect(const QDomElement)));
225 connect(currentEffect, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
226 connect(currentEffect, SIGNAL(resetEffect(int)), this , SLOT(slotResetEffect(int)));
227 connect(currentEffect, SIGNAL(changeEffectPosition(int,bool)), this , SLOT(slotMoveEffectUp(int , bool)));
228 connect(currentEffect, SIGNAL(effectStateChanged(bool, int)), this, SLOT(slotUpdateEffectState(bool, int)));
229 connect(currentEffect, SIGNAL(activateEffect(int)), this, SLOT(slotSetCurrentEffect(int)));
230 connect(currentEffect, SIGNAL(checkMonitorPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
231 connect(currentEffect, SIGNAL(seekTimeline(int)), this , SLOT(slotSeekTimeline(int)));
232 connect(currentEffect, SIGNAL(createGroup(int)), this , SLOT(slotCreateGroup(int)));
233 connect(currentEffect, SIGNAL(moveEffect(int,int,int,QString)), this , SLOT(slotMoveEffect(int,int,int,QString)));
234 connect(currentEffect, SIGNAL(addEffect(QDomElement)), this , SLOT(slotAddEffect(QDomElement)));
236 //ui.title->setPixmap(icon.pixmap(QSize(12, 12)));
238 vbox1->addStretch(10);
239 slotUpdateCheckAllButton();
240 connect(m_effectMetaInfo.monitor, SIGNAL(renderPosition(int)), this, SLOT(slotRenderPos(int)));
242 // Wait a little bit for the new layout to be ready, then check if we have a scrollbar
243 QTimer::singleShot(200, this, SLOT(slotCheckWheelEventFilter()));
247 void EffectStackView2::slotCheckWheelEventFilter()
249 // If the effect stack widget has no scrollbar, we will not filter the
250 // mouse wheel events, so that user can easily adjust effect params
251 bool filterWheelEvent = false;
252 if (m_ui.container->verticalScrollBar() && m_ui.container->verticalScrollBar()->isVisible()) {
253 // widget has scroll bar,
254 filterWheelEvent = true;
256 for (int i = 0; i < m_effects.count(); i++) {
257 m_effects.at(i)->filterWheelEvent = filterWheelEvent;
261 void EffectStackView2::resizeEvent ( QResizeEvent * event )
263 slotCheckWheelEventFilter();
264 QWidget::resizeEvent(event);
267 bool EffectStackView2::eventFilter( QObject * o, QEvent * e )
269 // Check if user clicked in an effect's top bar to start dragging it
270 if (e->type() == QEvent::MouseButtonPress) {
271 m_draggedEffect = qobject_cast<CollapsibleEffect*>(o);
272 if (m_draggedEffect) {
273 QMouseEvent *me = static_cast<QMouseEvent *>(e);
274 if (me->button() == Qt::LeftButton && (m_draggedEffect->frame->underMouse() || m_draggedEffect->title->underMouse())) {
275 m_clickPoint = me->globalPos();
278 m_clickPoint = QPoint();
279 m_draggedEffect = NULL;
284 m_draggedGroup = qobject_cast<CollapsibleGroup*>(o);
285 if (m_draggedGroup) {
286 QMouseEvent *me = static_cast<QMouseEvent *>(e);
287 if (me->button() == Qt::LeftButton && (m_draggedGroup->framegroup->underMouse() || m_draggedGroup->title()->underMouse()))
288 m_clickPoint = me->globalPos();
290 m_clickPoint = QPoint();
291 m_draggedGroup = NULL;
297 /*if (e->type() == QEvent::MouseMove) {
298 if (qobject_cast<CollapsibleEffect*>(o)) {
299 QMouseEvent *me = static_cast<QMouseEvent *>(e);
300 if (me->buttons() != Qt::LeftButton) {
310 return QWidget::eventFilter(o, e);
313 void EffectStackView2::mouseMoveEvent(QMouseEvent * event)
315 if (m_draggedEffect || m_draggedGroup) {
316 if ((event->buttons() & Qt::LeftButton) && (m_clickPoint != QPoint()) && ((event->globalPos() - m_clickPoint).manhattanLength() >= QApplication::startDragDistance())) {
322 void EffectStackView2::mouseReleaseEvent(QMouseEvent * event)
324 m_draggedEffect = NULL;
325 m_draggedGroup = NULL;
326 QWidget::mouseReleaseEvent(event);
329 void EffectStackView2::startDrag()
331 // The data to be transferred by the drag and drop operation is contained in a QMimeData object
334 if (m_draggedEffect) {
335 QDomElement effect = m_draggedEffect->effect().cloneNode().toElement();
336 doc.appendChild(doc.importNode(effect, true));
337 pixmap = QPixmap::grabWidget(m_draggedEffect->title);
339 else if (m_draggedGroup) {
340 doc = m_draggedGroup->effectsData();
341 pixmap = QPixmap::grabWidget(m_draggedGroup->title());
344 QDrag *drag = new QDrag(this);
345 drag->setPixmap(pixmap);
346 QMimeData *mime = new QMimeData;
348 data.append(doc.toString().toUtf8());
349 mime->setData("kdenlive/effectslist", data);
351 // Assign ownership of the QMimeData object to the QDrag object.
352 drag->setMimeData(mime);
353 // Start the drag and drop operation
354 drag->exec(Qt::CopyAction | Qt::MoveAction, Qt::CopyAction);
358 void EffectStackView2::slotUpdateEffectState(bool disable, int index)
360 if (m_effectMetaInfo.trackMode)
361 emit changeEffectState(NULL, m_trackindex, index, disable);
363 emit changeEffectState(m_clipref, -1, index, disable);
364 slotUpdateCheckAllButton();
368 void EffectStackView2::raiseWindow(QWidget* dock)
370 if ((m_clipref || m_effectMetaInfo.trackMode) && dock)
375 void EffectStackView2::slotSeekTimeline(int pos)
377 if (m_effectMetaInfo.trackMode) {
378 emit seekTimeline(pos);
379 } else if (m_clipref) {
380 emit seekTimeline(m_clipref->startPos().frames(KdenliveSettings::project_fps()) + pos);
385 /*void EffectStackView2::slotRegionChanged()
387 if (!m_trackMode) emit updateClipRegion(m_clipref, m_ui.effectlist->currentRow(), m_ui.region_url->text());
390 void EffectStackView2::slotCheckMonitorPosition(int renderPos)
392 if (m_effectMetaInfo.trackMode || (m_clipref && renderPos >= m_clipref->startPos().frames(KdenliveSettings::project_fps()) && renderPos <= m_clipref->endPos().frames(KdenliveSettings::project_fps()))) {
393 if (!m_effectMetaInfo.monitor->getEffectEdit()->getScene()->views().at(0)->isVisible())
394 m_effectMetaInfo.monitor->slotEffectScene(true);
396 m_effectMetaInfo.monitor->slotEffectScene(false);
400 int EffectStackView2::isTrackMode(bool *ok) const
402 *ok = m_effectMetaInfo.trackMode;
406 void EffectStackView2::clear()
409 QWidget *view = m_ui.container->takeWidget();
413 m_ui.checkAll->setToolTip(QString());
414 m_ui.checkAll->setText(QString());
415 m_ui.checkAll->setEnabled(false);
416 m_ui.labelComment->setText(QString());
420 void EffectStackView2::slotCheckAll(int state)
424 m_ui.checkAll->blockSignals(true);
425 m_ui.checkAll->setCheckState(Qt::Checked);
426 m_ui.checkAll->blockSignals(false);
429 bool disabled = (state != 2);
430 for (int i = 0; i < m_effects.count(); i++) {
431 if (!m_effects.at(i)->isGroup()) {
432 m_effects.at(i)->slotEnable(!disabled);
437 void EffectStackView2::slotUpdateCheckAllButton()
439 bool hasEnabled = false;
440 bool hasDisabled = false;
442 for (int i = 0; i < m_effects.count(); i++) {
443 if (m_effects.at(i)->enabledBox->isChecked()) hasEnabled = true;
444 else hasDisabled = true;
447 m_ui.checkAll->blockSignals(true);
448 if (hasEnabled && hasDisabled)
449 m_ui.checkAll->setCheckState(Qt::PartiallyChecked);
451 m_ui.checkAll->setCheckState(Qt::Checked);
453 m_ui.checkAll->setCheckState(Qt::Unchecked);
454 m_ui.checkAll->blockSignals(false);
457 void EffectStackView2::deleteCurrentEffect()
459 for (int i = 0; i < m_effects.count(); i++) {
460 if (m_effects.at(i)->isActive()) {
461 slotDeleteEffect(m_effects.at(i)->effect());
467 void EffectStackView2::updateProjectFormat(MltVideoProfile profile, Timecode t)
469 m_effectMetaInfo.profile = profile;
470 m_effectMetaInfo.timecode = t;
473 void EffectStackView2::updateTimecodeFormat()
475 for (int i = 0; i< m_effects.count(); i++)
476 m_effects.at(i)->updateTimecodeFormat();
479 CollapsibleEffect *EffectStackView2::getEffectByIndex(int ix)
481 for (int i = 0; i< m_effects.count(); i++) {
482 if (m_effects.at(i)->effectIndex() == ix) {
483 return m_effects.at(i);
489 void EffectStackView2::slotUpdateEffectParams(const QDomElement old, const QDomElement e, int ix)
491 if (m_effectMetaInfo.trackMode)
492 emit updateEffect(NULL, m_trackindex, old, e, ix,false);
493 else if (m_clipref) {
494 emit updateEffect(m_clipref, -1, old, e, ix, false);
495 // Make sure the changed effect is currently displayed
496 slotSetCurrentEffect(ix);
498 QTimer::singleShot(200, this, SLOT(slotCheckWheelEventFilter()));
501 void EffectStackView2::slotSetCurrentEffect(int ix)
503 if (m_clipref && ix != m_clipref->selectedEffectIndex())
504 m_clipref->setSelectedEffect(ix);
505 for (int i = 0; i < m_effects.count(); i++) {
506 if (m_effects.at(i)->effectIndex() == ix) {
507 m_effects.at(i)->setActive(true);
508 m_ui.labelComment->setText(i18n(m_effects.at(i)->effect().firstChildElement("description").firstChildElement("full").text().toUtf8().data()));
509 m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
511 else m_effects.at(i)->setActive(false);
515 void EffectStackView2::slotDeleteEffect(const QDomElement effect)
517 if (m_effectMetaInfo.trackMode)
518 emit removeEffect(NULL, m_trackindex, effect);
520 emit removeEffect(m_clipref, -1, effect);
523 void EffectStackView2::slotAddEffect(QDomElement effect)
525 emit addEffect(m_clipref, effect);
528 void EffectStackView2::slotMoveEffectUp(int index, bool up)
530 if (up && index <= 1) return;
531 if (!up && index >= m_currentEffectList.count()) return;
539 if (m_effectMetaInfo.trackMode) emit changeEffectPosition(NULL, m_trackindex, index, endPos);
540 else emit changeEffectPosition(m_clipref, -1, index, endPos);
543 void EffectStackView2::slotStartFilterJob(const QString&filterName, const QString&filterParams, const QString&finalFilterName, const QString&consumer, const QString&consumerParams, const QString&properties)
545 if (!m_clipref) return;
546 emit startFilterJob(m_clipref->info(), m_clipref->clipProducer(), filterName, filterParams, finalFilterName, consumer, consumerParams, properties);
549 void EffectStackView2::slotResetEffect(int ix)
551 QDomElement old = m_currentEffectList.itemFromIndex(ix);
553 QString effectId = old.attribute("id");
554 QMap<QString, EffectsList*> effectLists;
555 effectLists["audio"] = &MainWindow::audioEffects;
556 effectLists["video"] = &MainWindow::videoEffects;
557 effectLists["custom"] = &MainWindow::customEffects;
558 foreach(const QString &type, effectLists.keys()) {
559 EffectsList *list = effectLists[type];
560 dom = list->getEffectByTag(QString(), effectId).cloneNode().toElement();
561 if (!dom.isNull()) break;
564 dom.setAttribute("kdenlive_ix", old.attribute("kdenlive_ix"));
565 if (m_effectMetaInfo.trackMode) {
566 EffectsList::setParameter(dom, "in", QString::number(0));
567 EffectsList::setParameter(dom, "out", QString::number(m_trackInfo.duration));
569 info.track = m_trackInfo.type;
570 info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
571 info.cropStart = GenTime(0);
572 info.startPos = GenTime(-1);
574 m_effects.at(ix)->updateWidget(info, dom, &m_effectMetaInfo);
575 emit updateEffect(NULL, m_trackindex, old, dom, ix,false);
577 m_clipref->initEffect(dom);
578 for (int i = 0; i < m_effects.count(); i++) {
579 if (m_effects.at(i)->effectIndex() == ix) {
580 m_effects.at(i)->updateWidget(m_clipref->info(), dom, &m_effectMetaInfo);
584 //m_ui.region_url->setUrl(KUrl(dom.attribute("region")));
585 emit updateEffect(m_clipref, -1, old, dom, ix,false);
589 emit showComments(m_ui.buttonShowComments->isChecked());
590 m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
593 void EffectStackView2::slotShowComments()
595 m_ui.labelComment->setHidden(!m_ui.buttonShowComments->isChecked() || m_ui.labelComment->text().isEmpty());
596 emit showComments(m_ui.buttonShowComments->isChecked());
599 void EffectStackView2::slotCreateGroup(int ix)
601 QDomElement oldeffect = m_currentEffectList.itemFromIndex(ix);
602 QDomElement neweffect = oldeffect.cloneNode().toElement();
603 EffectInfo effectinfo;
604 effectinfo.fromString(oldeffect.attribute("kdenlive_info"));
605 effectinfo.groupIndex = m_groupIndex;
606 neweffect.setAttribute("kdenlive_info", effectinfo.toString());
609 if (m_effectMetaInfo.trackMode) {
610 info.track = m_trackInfo.type;
611 info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
612 info.cropStart = GenTime(0);
613 info.startPos = GenTime(-1);
615 emit updateEffect(NULL, m_trackindex, oldeffect, neweffect, ix, false);
617 emit updateEffect(m_clipref, -1, oldeffect, neweffect, ix, false);
620 QVBoxLayout *l = static_cast<QVBoxLayout *>(m_ui.container->widget()->layout());
622 CollapsibleEffect *effectToMove = NULL;
623 for (int i = 0; i < m_effects.count(); i++) {
624 if (m_effects.at(i)->effectIndex() == ix) {
625 effectToMove = m_effects.at(i);
626 groupPos = l->indexOf(effectToMove);
627 l->removeWidget(effectToMove);
632 CollapsibleGroup *group = new CollapsibleGroup(m_groupIndex, ix == 1, ix == m_currentEffectList.count() - 2, QString(), m_ui.container->widget());
634 connect(group, SIGNAL(moveEffect(int,int,int,QString)), this , SLOT(slotMoveEffect(int,int,int,QString)));
635 connect(group, SIGNAL(unGroup(CollapsibleGroup*)), this , SLOT(slotUnGroup(CollapsibleGroup*)));
636 connect(group, SIGNAL(groupRenamed(CollapsibleGroup *)), this , SLOT(slotRenameGroup(CollapsibleGroup*)));
637 connect(group, SIGNAL(reloadEffects()), this , SIGNAL(reloadEffects()));
638 l->insertWidget(groupPos, group);
639 group->installEventFilter( this );
640 group->addGroupEffect(effectToMove);
643 void EffectStackView2::slotMoveEffect(int currentIndex, int newIndex, int groupIndex, QString groupName)
645 CollapsibleEffect *effectToMove = getEffectByIndex(currentIndex);
646 if (effectToMove == NULL) return;
648 QDomElement oldeffect = effectToMove->effect();
649 QDomElement neweffect = oldeffect.cloneNode().toElement();
651 EffectInfo effectinfo;
652 effectinfo.fromString(oldeffect.attribute("kdenlive_info"));
653 effectinfo.groupIndex = groupIndex;
654 effectinfo.groupName = groupName;
655 neweffect.setAttribute("kdenlive_info", effectinfo.toString());
658 if (m_effectMetaInfo.trackMode) {
659 info.track = m_trackInfo.type;
660 info.cropDuration = GenTime(m_trackInfo.duration, KdenliveSettings::project_fps());
661 info.cropStart = GenTime(0);
662 info.startPos = GenTime(-1);
664 emit updateEffect(NULL, m_trackindex, oldeffect, neweffect, effectToMove->effectIndex(),false);
666 emit updateEffect(m_clipref, -1, oldeffect, neweffect, effectToMove->effectIndex(),false);
669 //if (currentIndex == newIndex) return;
670 // Update effect index with new position
671 if (m_effectMetaInfo.trackMode) {
672 emit changeEffectPosition(NULL, m_trackindex, currentIndex, newIndex);
675 emit changeEffectPosition(m_clipref, -1, currentIndex, newIndex);
679 void EffectStackView2::slotUnGroup(CollapsibleGroup* group)
681 QVBoxLayout *l = static_cast<QVBoxLayout *>(m_ui.container->widget()->layout());
682 int ix = l->indexOf(group);
683 group->removeGroup(ix, l);
684 group->deleteLater();
687 void EffectStackView2::slotRenameGroup(CollapsibleGroup *group)
689 QList <CollapsibleEffect*> effects = group->effects();
690 for (int i = 0; i < effects.count(); i++) {
691 QDomElement origin = effects.at(i)->effect();
692 QDomElement changed = origin.cloneNode().toElement();
693 changed.setAttribute("kdenlive_info", effects.at(i)->infoString());
694 if (m_effectMetaInfo.trackMode) {
695 emit updateEffect(NULL, m_trackindex, origin, changed, effects.at(i)->effectIndex(),false);
697 emit updateEffect(m_clipref, -1, origin, changed, effects.at(i)->effectIndex(),false);
702 #include "effectstackview2.moc"