#include <QDomElement>
#include <QPainter>
#include <QStyleOptionGraphicsItem>
-
+#if QT_VERSION >= 0x040600
+#include <QPropertyAnimation>
+#endif
Transition::Transition(const ItemInfo &info, int transitiontrack, double fps, QDomElement params, bool automaticTransition) :
AbstractClipItem(info, QRectF(), fps),
setPos(info.startPos.frames(fps), (int)(info.track * KdenliveSettings::trackheight() + itemOffset() + 1));
#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, (qreal) itemHeight() / 2);
- QRectF r2(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal)itemHeight());
- m_startAnimation->setStartValue(r);
- m_startAnimation->setEndValue(r2);
- m_startAnimation->setEasingCurve(QEasingCurve::OutQuad);
- m_startAnimation->start();
+ if (!(KGlobalSettings::graphicEffectsLevel() & KGlobalSettings::SimpleAnimationEffects)) {
+ // animation disabled
+ setRect(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal) itemHeight());
+ }
+ else {
+ QPropertyAnimation *startAnimation = new QPropertyAnimation(this, "rect");
+ startAnimation->setDuration(200);
+ const QRectF r(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal) itemHeight() / 2);
+ const QRectF r2(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal)itemHeight());
+ startAnimation->setStartValue(r);
+ startAnimation->setEndValue(r2);
+ startAnimation->setEasingCurve(QEasingCurve::OutQuad);
+ startAnimation->start(QAbstractAnimation::DeleteWhenStopped);
+ }
#else
setRect(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal) itemHeight());
#endif
Transition::~Transition()
{
blockSignals(true);
-#if QT_VERSION >= 0x040600
- delete m_startAnimation;
-#endif
if (scene()) scene()->removeItem(this);
}
return MOVE;
}
+//static
int Transition::itemHeight()
{
return (int) (KdenliveSettings::trackheight() / 3 * 2 - 1);
}
+//static
int Transition::itemOffset()
{
return (int) (KdenliveSettings::trackheight() / 3 * 2);