}
}
+int AbstractClipItem::itemHeight()
+{
+ return 0;
+}
+
+int AbstractClipItem::itemOffset()
+{
+ return 0;
+}
+
+
virtual int track() const ;
virtual GenTime cropStart() const ;
virtual GenTime cropDuration() const ;
+ /** @brief Return the current item's height */
+ static int itemHeight();
+ /** @brief Return the current item's vertical offset
+ * For example transitions are drawn at 1/3 of track height */
+ static int itemOffset();
/** @brief Resizes the clip from the start.
* @param posx Absolute position of new in point
m_framePixelWidth(0)
{
setZValue(2);
- setRect(0, 0, (info.endPos - info.startPos).frames(fps) - 0.02, (double)(KdenliveSettings::trackheight() - 2));
- setPos(info.startPos.frames(fps), (double)(info.track * KdenliveSettings::trackheight()) + 1);
+ setRect(0, 0, (info.endPos - info.startPos).frames(fps) - 0.02, (double) itemHeight());
+ setPos(info.startPos.frames(fps), (double)(info.track * KdenliveSettings::trackheight()) + 1 + itemOffset());
// set speed independant info
if (m_speed <= 0 && m_speed > -1)
return MOVE;
}
+int ClipItem::itemHeight()
+{
+ return KdenliveSettings::trackheight() - 2;
+}
+
QList <GenTime> ClipItem::snapMarkers() const
{
QList < GenTime > snaps;
void resizeStart(int posx, bool size = true);
void resizeEnd(int posx);
OPERATIONTYPE operationMode(QPointF pos);
+ static int itemHeight();
const QString clipProducer() const;
int clipType() const;
DocClipBase *baseClip() const;
// If we are in overwrite mode, always allow the move
return true;
}
- QRectF rect((double) info.startPos.frames(m_document->fps()), (double)(info.track * m_tracksHeight + 1), (double)(info.endPos - info.startPos).frames(m_document->fps()), (double)(m_tracksHeight - 1));
+ int height;
+ int offset = 0;
+ if (type == TRANSITIONWIDGET) {
+ height = Transition::itemHeight();
+ offset = Transition::itemOffset();
+ }
+ else if (type == AVWIDGET) {
+ height = ClipItem::itemHeight();
+ offset = ClipItem::itemOffset();
+ }
+ QRectF rect((double) info.startPos.frames(m_document->fps()), (double)(info.track * m_tracksHeight + 1 + offset), (double)(info.endPos - info.startPos).frames(m_document->fps()), (double) height);
QList<QGraphicsItem *> collisions = scene()->items(rect, Qt::IntersectsItemBoundingRect);
for (int i = 0; i < collisions.count(); i++) {
- if (collisions.at(i)->type() == type) return false;
+ if (collisions.at(i)->type() == type) {
+ return false;
+ }
}
return true;
}
{
setZValue(3);
m_info.cropDuration = info.endPos - info.startPos;
- setPos(info.startPos.frames(fps), (qreal)(info.track * KdenliveSettings::trackheight() + KdenliveSettings::trackheight() / 3 * 2));
+ setPos(info.startPos.frames(fps), (qreal)(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)(KdenliveSettings::trackheight() / 3 + 5));
- QRectF r2(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal)(KdenliveSettings::trackheight() / 3 * 2 - 1));
+ 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();
#else
- setRect(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal)(KdenliveSettings::trackheight() / 3 * 2 - 1));
+ setRect(0, 0, m_info.cropDuration.frames(fps) - 0.02, (qreal) itemHeight());
#endif
m_info.cropStart = GenTime();
return MOVE;
}
+int Transition::itemHeight()
+{
+ return (int) (KdenliveSettings::trackheight() / 3 * 2 - 1);
+}
+
+int Transition::itemOffset()
+{
+ return (int) (KdenliveSettings::trackheight() / 3 * 2);
+}
+
bool Transition::hasClip(const ClipItem * clip) const
{
if (clip == m_secondClip) return true;
QString transitionTag() const;
QStringList transitionInfo() const;
OPERATIONTYPE operationMode(QPointF pos);
+ static int itemHeight();
+ static int itemOffset();
//const QMap < QString, QString > transitionParameters() const;
void setTransitionParameters(const QDomElement params);
void setTransitionDirection(bool inv);