Commit 440f7c18 authored by Marco Gittler's avatar Marco Gittler

correct length/start in transition

resize (start+end) correct

svn path=/branches/KDE4/; revision=2046
parent f1981d12
......@@ -60,11 +60,13 @@ void AbstractClipItem::resizeStart(int posx, double scale) {
GenTime durationDiff = GenTime(posx, m_fps) - m_startPos;
if (durationDiff == GenTime()) return;
//kDebug() << "-- RESCALE: CROP=" << m_cropStart << ", DIFF = " << durationDiff;
if (m_cropStart + durationDiff < GenTime()) {
if (m_cropStart + durationDiff < GenTime() && type() == 70000) {
durationDiff = GenTime() - m_cropStart;
} else if (durationDiff >= m_cropDuration) {
durationDiff = m_cropDuration - GenTime(3, m_fps);
}
m_startPos += durationDiff;
m_cropStart += durationDiff;
m_cropDuration = m_cropDuration - durationDiff;
......
......@@ -154,10 +154,6 @@ int ClipItem::clipProducer() {
return m_producer;
}
GenTime ClipItem::cropStart() const {
return m_cropStart;
}
void ClipItem::flashClip() {
if (m_timeLine == 0) {
m_timeLine = new QTimeLine(750, this);
......
......@@ -51,8 +51,6 @@ public:
int clipType();
DocClipBase *baseClip();
QString clipName();
GenTime cropStart() const;
QDomElement xml() const;
void setFadeOut(int pos, double scale);
......
......@@ -99,7 +99,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event) {
if (m_operationMode == MOVE) {
double snappedPos = getSnapPointForPos(mapToScene(event->pos()).x() - m_clickPoint);
kDebug() << "/////// MOVE CLIP, EVENT Y: ";//<<event->scenePos().y()<<", SCENE HEIGHT: "<<scene()->sceneRect().height();
int moveTrack = (int) mapToScene(event->pos()).y() / 50;
int moveTrack = (int) mapToScene(event->pos() - QPoint(0, (m_dragItem->type() == 70001 ? 25 : 0))).y() / 50;
int currentTrack = m_dragItem->track();
if (moveTrack > m_tracksCount - 1) moveTrack = m_tracksCount - 1;
......@@ -347,7 +347,12 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event) {
else if (m_operationMode == RESIZEEND)
m_startPos = QPointF(m_dragItem->endPos().frames(m_document->fps()), m_dragItem->track());
else if (m_operationMode == TRANSITIONSTART) {
Transition *tr = new Transition(QRect(m_dragItem->rect().x() , m_dragItem->rect().height() / 2, (m_dragItem->startPos() + GenTime(2.5)).frames(25.0) , m_dragItem->rect().height()), (ClipItem*)m_dragItem, LUMA_TRANSITION, m_dragItem->startPos(), m_dragItem->startPos() + GenTime(2.5), m_document->fps());
Transition *tr = new Transition(
QRect(m_dragItem->startPos().frames(m_document->fps()) *m_scale , m_dragItem->rect().height() / 2,
GenTime(2.5).frames(m_document->fps()) *m_scale , m_dragItem->rect().height()
),
(ClipItem*)m_dragItem, LUMA_TRANSITION, m_dragItem->startPos(), m_dragItem->startPos() + GenTime(2.5), m_document->fps());
tr->setTrack(m_dragItem->track());
scene()->addItem(tr);
//m_dragItem->addTransition(tra);
}
......
......@@ -42,6 +42,7 @@ Transition::Transition(const QRectF& rect , ClipItem * clipa, const TRANSITIONTY
m_fps = fps;
m_cropDuration = endTime - startTime;
m_startPos = startTime;
m_maxDuration = GenTime(1000000);
// Default duration = 2.5 seconds
GenTime defaultTransitionDuration = GenTime(2.5);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment