} else delete effectCommand;
}
+void CustomTrackView::slotAddEffect(ClipItem *clip, QDomElement effect)
+{
+ if (clip) slotAddEffect(effect, clip->startPos(), clip->track());
+}
+
void CustomTrackView::slotAddEffect(QDomElement effect, GenTime pos, int track)
{
QList<QGraphicsItem *> itemList;
* @param offsetList The list of points that should also snap (for example when movin a clip, start and end points should snap
* @param skipSelectedItems if true, the selected item start and end points will not be added to snap list */
void updateSnapPoints(AbstractClipItem *selected, QList <GenTime> offsetList = QList <GenTime> (), bool skipSelectedItems = false);
+
+ void slotAddEffect(ClipItem *clip, QDomElement effect);
protected:
virtual void drawBackground(QPainter * painter, const QRectF & rect);
//event->acceptProposedAction();
QDomDocument doc;
doc.setContent(effects, true);
- const QDomElement e = doc.documentElement();
+ QDomElement e = doc.documentElement();
int ix = e.attribute("kdenlive_ix").toInt();
if (ix == effectIndex()) {
// effect dropped on itself, reject
event->ignore();
return;
}
+ if (ix == 0) {
+ // effect dropped from effects list, add it
+ e.setAttribute("kdenlive_ix", ix);
+ event->setDropAction(Qt::CopyAction);
+ event->accept();
+ emit addEffect(e);
+ return;
+ }
int new_index = -1;
if (m_isGroup) {
QVBoxLayout *vbox = static_cast<QVBoxLayout *>(widgetFrame->layout());
void createGroup(int ix);
void moveEffect(int current_pos, int new_pos, CollapsibleEffect *target);
void unGroup(CollapsibleEffect *);
+ void addEffect(QDomElement e);
};
connect(currentEffect, SIGNAL(seekTimeline(int)), this , SLOT(slotSeekTimeline(int)));
connect(currentEffect, SIGNAL(createGroup(int)), this , SLOT(slotCreateGroup(int)));
connect(currentEffect, SIGNAL(moveEffect(int,int,CollapsibleEffect*)), this , SLOT(slotMoveEffect(int,int,CollapsibleEffect*)));
+ connect(currentEffect, SIGNAL(addEffect(QDomElement)), this , SLOT(slotAddEffect(QDomElement)));
//ui.title->setPixmap(icon.pixmap(QSize(12, 12)));
}
emit removeEffect(m_clipref, -1, effect);
}
+void EffectStackView2::slotAddEffect(QDomElement effect)
+{
+ emit addEffect(m_clipref, effect);
+}
+
void EffectStackView2::slotMoveEffectUp(int index, bool up)
{
if (up && index <= 1) return;
void EffectStackView2::slotMoveEffect(int currentIndex, int newIndex, CollapsibleEffect* target)
{
- QVBoxLayout *l = static_cast<QVBoxLayout *>(m_ui.container->widget()->layout());
CollapsibleEffect *effectToMove = getEffectByIndex(currentIndex);
if (effectToMove == NULL) return;
** @param lastEffectIndex the last effect index in the group, effect will be inserted after that index
*/
void slotMoveEffect(int currentIndex, int newIndex, CollapsibleEffect* target);
+
/** @brief Remove effects from a group */
void slotUnGroup(CollapsibleEffect* group);
+
+ void slotAddEffect(QDomElement effect);
signals:
void removeEffect(ClipItem*, int, QDomElement);
void displayMessage(const QString&, int);
void showComments(bool show);
void startFilterJob(ItemInfo info, const QString &clipId, const QString &filterName, const QString &filterParams, const QString&finalFilterName, const QString &consumer, const QString &consumerParams, const QString &properties);
+ void addEffect(ClipItem*,QDomElement);
};
#endif
disconnect(m_activeDocument, SIGNAL(docModified(bool)), this, SLOT(slotUpdateDocumentState(bool)));
disconnect(m_effectStack, SIGNAL(updateEffect(ClipItem*, int, QDomElement, QDomElement, int)), m_activeTimeline->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, int, QDomElement, QDomElement, int)));
disconnect(m_effectStack, SIGNAL(removeEffect(ClipItem*, int, QDomElement)), m_activeTimeline->projectView(), SLOT(slotDeleteEffect(ClipItem*, int, QDomElement)));
+ disconnect(m_effectStack, SIGNAL(addEffect(ClipItem*, QDomElement)), trackView->projectView(), SLOT(slotAddEffect(ClipItem*, QDomElement)));
disconnect(m_effectStack, SIGNAL(changeEffectState(ClipItem*, int, int, bool)), m_activeTimeline->projectView(), SLOT(slotChangeEffectState(ClipItem*, int, int, bool)));
disconnect(m_effectStack, SIGNAL(changeEffectPosition(ClipItem*, int, int, int)), m_activeTimeline->projectView(), SLOT(slotChangeEffectPosition(ClipItem*, int, int, int)));
disconnect(m_effectStack, SIGNAL(refreshEffectStack(ClipItem*)), m_activeTimeline->projectView(), SLOT(slotRefreshEffects(ClipItem*)));
connect(m_effectStack, SIGNAL(updateEffect(ClipItem*, int, QDomElement, QDomElement, int)), trackView->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, int, QDomElement, QDomElement, int)));
connect(m_effectStack, SIGNAL(updateClipRegion(ClipItem*, int, QString)), trackView->projectView(), SLOT(slotUpdateClipRegion(ClipItem*, int, QString)));
connect(m_effectStack, SIGNAL(removeEffect(ClipItem*, int, QDomElement)), trackView->projectView(), SLOT(slotDeleteEffect(ClipItem*, int, QDomElement)));
+ connect(m_effectStack, SIGNAL(addEffect(ClipItem*, QDomElement)), trackView->projectView(), SLOT(slotAddEffect(ClipItem*, QDomElement)));
connect(m_effectStack, SIGNAL(changeEffectState(ClipItem*, int, int, bool)), trackView->projectView(), SLOT(slotChangeEffectState(ClipItem*, int, int, bool)));
connect(m_effectStack, SIGNAL(changeEffectPosition(ClipItem*, int, int, int)), trackView->projectView(), SLOT(slotChangeEffectPosition(ClipItem*, int, int, int)));
connect(m_effectStack, SIGNAL(refreshEffectStack(ClipItem*)), trackView->projectView(), SLOT(slotRefreshEffects(ClipItem*)));