]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.cpp
Fix clip move in overwrite mode, fix crash in audio thumbs,
[kdenlive] / src / customtrackview.cpp
index 2c2ec67c1e984d4779037d9211ebf08596012eed..43c5af46d8c79f3f1ad9f846d217cf139061f798 100644 (file)
@@ -1753,7 +1753,7 @@ ClipItem *CustomTrackView::cutClip(ItemInfo info, GenTime cutTime, bool cut, boo
         item->baseClip()->addReference();
         m_document->updateClip(item->baseClip()->getId());
         setDocumentModified();
-        KdenliveSettings::setSnaptopoints(snap);
+       KdenliveSettings::setSnaptopoints(snap);
         return dup;
         //kDebug() << "/////////  CUTTING CLIP RESULT: (" << item->startPos().frames(25) << "-" << item->endPos().frames(25) << "), DUP: (" << dup->startPos().frames(25) << "-" << dup->endPos().frames(25) << ")" << ", CUT: " << cutTime.frames(25);
     } else {
@@ -1779,7 +1779,7 @@ ClipItem *CustomTrackView::cutClip(ItemInfo info, GenTime cutTime, bool cut, boo
 
         bool snap = KdenliveSettings::snaptopoints();
         KdenliveSettings::setSnaptopoints(false);
-
+       
         if (dup->isSelected()) emit clipItemSelected(NULL);
         dup->baseClip()->removeReference();
         m_document->updateClip(dup->baseClip()->getId());
@@ -1794,7 +1794,7 @@ ClipItem *CustomTrackView::cutClip(ItemInfo info, GenTime cutTime, bool cut, boo
             setDocumentModified();
         } else
             emit displayMessage(i18n("Error when resizing clip"), ErrorMessage);
-        KdenliveSettings::setSnaptopoints(snap);
+       KdenliveSettings::setSnaptopoints(snap);
         return item;
 
     }
@@ -2049,24 +2049,24 @@ void CustomTrackView::dropEvent(QDropEvent * event)
         m_commandStack->push(addCommand);
         setDocumentModified();
 
-        /*
-        // debug info
-        QRectF rect(0, 1 * m_tracksHeight + m_tracksHeight / 2, sceneRect().width(), 2);
-        QList<QGraphicsItem *> selection = m_scene->items(rect);
-        QStringList timelineList;
-
-        kDebug()<<"// ITEMS on TRACK: "<<selection.count();
-        for (int i = 0; i < selection.count(); i++) {
-               if (selection.at(i)->type() == AVWIDGET) {
-                   ClipItem *clip = static_cast <ClipItem *>(selection.at(i));
-                   int start = clip->startPos().frames(m_document->fps());
-                   int end = clip->endPos().frames(m_document->fps());
-                   timelineList.append(QString::number(start) + "-" + QString::number(end));
-            }
-        }
-        kDebug() << "// COMPARE:\n" << timelineList << "\n-------------------";
-        */
+       /*
+       // debug info
+       QRectF rect(0, 1 * m_tracksHeight + m_tracksHeight / 2, sceneRect().width(), 2);
+       QList<QGraphicsItem *> selection = m_scene->items(rect);
+       QStringList timelineList;
 
+       kDebug()<<"// ITEMS on TRACK: "<<selection.count();
+       for (int i = 0; i < selection.count(); i++) {
+        if (selection.at(i)->type() == AVWIDGET) {
+            ClipItem *clip = static_cast <ClipItem *>(selection.at(i));
+            int start = clip->startPos().frames(m_document->fps());
+            int end = clip->endPos().frames(m_document->fps());
+            timelineList.append(QString::number(start) + "-" + QString::number(end));
+           }
+       }
+       kDebug() << "// COMPARE:\n" << timelineList << "\n-------------------";
+       */
+       
         m_pasteEffectsAction->setEnabled(m_copiedItems.count() == 1);
         if (items.count() > 1) groupSelectedItems(true);
         event->setDropAction(Qt::MoveAction);
@@ -2082,8 +2082,8 @@ void CustomTrackView::adjustTimelineClips(EDITMODE mode, ClipItem *item, ItemInf
         bool snap = KdenliveSettings::snaptopoints();
         KdenliveSettings::setSnaptopoints(false);
         ItemInfo info;
-        if (item == NULL) info = posinfo;
-        else info = item->info();
+       if (item == NULL) info = posinfo;
+       else info = item->info();
         QRectF rect(info.startPos.frames(m_document->fps()), info.track * m_tracksHeight + m_tracksHeight / 2, (info.endPos - info.startPos).frames(m_document->fps()) - 1, 5);
         QList<QGraphicsItem *> selection = m_scene->items(rect);
         if (item) selection.removeAll(item);
@@ -2106,13 +2106,7 @@ void CustomTrackView::adjustTimelineClips(EDITMODE mode, ClipItem *item, ItemInf
                         new RazorClipCommand(this, clipInfo, info.startPos, false, command);
                         new ResizeClipCommand(this, dupInfo, newdupInfo, false, false, command);
                         ClipItem *dup = cutClip(clipInfo, info.startPos, true, false);
-                        if (dup) dup->resizeStart(info.endPos.frames(m_document->fps()));
-                        kDebug() << "-----------------------------";
-
-                        kDebug() << "///RES+CUT: " << dup->startPos().frames(25) << "x" << dup->endPos().frames(25);
-                        kDebug() << "-----------------------------";
-
-
+                        if (dup) dup->resizeStart(info.endPos.frames(m_document->fps()));                      
                     } else {
                         ItemInfo newclipInfo = clip->info();
                         newclipInfo.endPos = info.startPos;
@@ -3343,10 +3337,10 @@ void CustomTrackView::deleteClip(ItemInfo info, bool refresh)
     // animate item deletion
     if (refresh) item->closeAnimation();
     else {
-        // no refresh, means we have several operations chained, we need to delete clip immediatly
-        // so that it does not get in the way of the other
-        delete item;
-        item = NULL;
+       // no refresh, means we have several operations chained, we need to delete clip immediatly 
+       // so that it does not get in the way of the other
+       delete item;
+       item = NULL;
     }
 #else
     delete item;
@@ -3420,7 +3414,7 @@ void CustomTrackView::deleteSelectedClips()
     else if (transitionCount > 0 && groupCount == 0 && clipCount == 0)
         deleteSelected->setText(i18np("Delete selected transition", "Delete selected transitions", transitionCount));
     else deleteSelected->setText(i18n("Delete selected items"));
-    m_commandStack->push(deleteSelected);
+    m_commandStack->push(deleteSelected);    
 }
 
 void CustomTrackView::changeClipSpeed()