]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.cpp
cleanup & fix crash on project saving with Qt 4.5:
[kdenlive] / src / customtrackview.cpp
index c2779a70760cc5bf40a0e31e0642ea55ca401842..16a167fc7f55f4b582603c91c27c905493a82987 100644 (file)
@@ -270,9 +270,11 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event) {
 
             } else if (m_operationMode == RESIZESTART && move) {
                 double snappedPos = getSnapPointForPos(mappedXPos);
+                m_document->renderer()->pause();
                 m_dragItem->resizeStart((int)(snappedPos));
             } else if (m_operationMode == RESIZEEND && move) {
                 double snappedPos = getSnapPointForPos(mappedXPos);
+                m_document->renderer()->pause();
                 m_dragItem->resizeEnd((int)(snappedPos));
             } else if (m_operationMode == FADEIN && move) {
                 ((ClipItem*) m_dragItem)->setFadeIn((int)(mappedXPos - m_dragItem->startPos().frames(m_document->fps())));
@@ -656,6 +658,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event) {
         }
         AbstractClipItem *clip = static_cast <AbstractClipItem *>(m_dragItem);
         RazorClipCommand* command = new RazorClipCommand(this, clip->info(), GenTime((int)(mapToScene(event->pos()).x()), m_document->fps()), true);
+        m_document->renderer()->pause();
         m_commandStack->push(command);
         m_document->setModified(true);
         m_dragItem = NULL;
@@ -2398,12 +2401,13 @@ void CustomTrackView::doChangeClipSpeed(ItemInfo info, const double speed, const
     }
     info.track = m_document->tracksCount() - item->track();
     int endPos = m_document->renderer()->mltChangeClipSpeed(info, speed, oldspeed, baseclip->producer());
-    kDebug() << "//CH CLIP SPEED: " << speed << "x" << oldspeed << ", END POS: " << endPos;
-    item->setSpeed(speed);
-    item->updateRectGeometry();
-    if (item->cropDuration().frames(m_document->fps()) > endPos)
-        item->AbstractClipItem::resizeEnd(info.startPos.frames(m_document->fps()) + endPos, speed);
-    m_document->setModified(true);
+    if (endPos >= 0) {
+        item->setSpeed(speed);
+        item->updateRectGeometry();
+        if (item->cropDuration().frames(m_document->fps()) > endPos)
+            item->AbstractClipItem::resizeEnd(info.startPos.frames(m_document->fps()) + endPos, speed);
+        m_document->setModified(true);
+    } else emit displayMessage(i18n("Invalid clip"), ErrorMessage);
 }
 
 void CustomTrackView::cutSelectedClips() {