m_transitionTrack(transitiontrack)
{
setZValue(3);
- setRect(0, 0, (info.endPos - info.startPos).frames(fps) - 0.02, (qreal)(KdenliveSettings::trackheight() / 3 * 2 - 1));
+ m_info.cropDuration = info.endPos - info.startPos;
setPos(info.startPos.frames(fps), (qreal)(info.track * KdenliveSettings::trackheight() + KdenliveSettings::trackheight() / 3 * 2));
- m_cropStart = GenTime();
+#if QT_VERSION >= 0x040600
+ m_startAnimation = new QPropertyAnimation(this, "rect");
+ m_startAnimation->setDuration(200);
+ QRectF r(0, 0, m_info.cropDuration.frames(fps) - 0.02, 1);
+ QRectF r2(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal)(KdenliveSettings::trackheight() / 3 * 2 - 1));
+ m_startAnimation->setStartValue(r);
+ m_startAnimation->setEndValue(r2);
+ m_startAnimation->setEasingCurve(QEasingCurve::OutQuad);
+ m_startAnimation->start();
+#else
+ setRect(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal)(KdenliveSettings::trackheight() / 3 * 2 - 1));
+#endif
+
+ m_info.cropStart = GenTime();
m_maxDuration = GenTime(600);
if (m_automaticTransition) setBrush(QColor(200, 200, 50, 100));
Transition::~Transition()
{
+ blockSignals(true);
+ delete m_startAnimation;
+ if (scene()) scene()->removeItem(this);
}
Transition *Transition::clone()
// Only one clip is moving
QRectF sceneShape = rect();
sceneShape.translate(newPos);
- QList<QGraphicsItem*> items = scene()->items(sceneShape, Qt::IntersectsItemShape);
+ QList<QGraphicsItem*> items;
+ if (projectScene()->editMode() == NORMALEDIT)
+ items = scene()->items(sceneShape, Qt::IntersectsItemShape);
items.removeAll(this);
if (!items.isEmpty()) {
if ((int) otherPos.y() != (int) pos().y()) return pos();
//kDebug()<<"//// CURRENT Y: "<<pos().y()<<", COLLIDING Y: "<<otherPos.y();
if (pos().x() < otherPos.x()) {
- int npos = (static_cast < AbstractClipItem* >(items.at(i))->startPos() - m_cropDuration).frames(m_fps);
+ int npos = (static_cast < AbstractClipItem* >(items.at(i))->startPos() - m_info.cropDuration).frames(m_fps);
newPos.setX(npos);
} else {
// get pos just after colliding clip
int npos = static_cast < AbstractClipItem* >(items.at(i))->endPos().frames(m_fps);
newPos.setX(npos);
}
- m_track = newTrack;
+ m_info.track = newTrack;
//kDebug()<<"// ITEM NEW POS: "<<newPos.x()<<", mapped: "<<mapToScene(newPos.x(), 0).x();
- m_startPos = GenTime((int) newPos.x(), m_fps);
+ m_info.startPos = GenTime((int) newPos.x(), m_fps);
return newPos;
}
}
}
- m_track = newTrack;
- m_startPos = GenTime((int) newPos.x(), m_fps);
+ m_info.track = newTrack;
+ m_info.startPos = GenTime((int) newPos.x(), m_fps);
//kDebug()<<"// ITEM NEW POS: "<<newPos.x()<<", mapped: "<<mapToScene(newPos.x(), 0).x();
return newPos;
}
return false;
}
+int Transition::defaultZValue() const
+{
+ return 3;
+}
+