]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.cpp
* Cleanup monitor / MLT communication
[kdenlive] / src / customtrackview.cpp
index c1d4b07415f731c502ab481006e6e8b8f6b3caa6..7e5b0329290ad129355c05243a9d274bb6dfd70d 100644 (file)
@@ -670,7 +670,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
 
     // special cases (middle click button or ctrl / shift click
     if (event->button() == Qt::MidButton) {
-        m_document->renderer()->switchPlay();
+        emit playMonitor();
         m_blockRefresh = false;
         m_operationMode = NONE;
         return;
@@ -1750,7 +1750,8 @@ ClipItem *CustomTrackView::cutClip(ItemInfo info, GenTime cutTime, bool cut, boo
         ClipItem *item = getClipItemAt((int) info.startPos.frames(m_document->fps()), info.track);
         if (!item || cutTime >= item->endPos() || cutTime <= item->startPos()) {
             emit displayMessage(i18n("Cannot find clip to cut"), ErrorMessage);
-            kDebug() << "/////////  ERROR CUTTING CLIP : (" << item->startPos().frames(25) << "-" << item->endPos().frames(25) << "), INFO: (" << info.startPos.frames(25) << "-" << info.endPos.frames(25) << ")" << ", CUT: " << cutTime.frames(25);
+            if (item) kDebug() << "/////////  ERROR CUTTING CLIP : (" << item->startPos().frames(25) << "-" << item->endPos().frames(25) << "), INFO: (" << info.startPos.frames(25) << "-" << info.endPos.frames(25) << ")" << ", CUT: " << cutTime.frames(25);
+            else kDebug() << "/// ERROR NO CLIP at: " << info.startPos.frames(m_document->fps()) << ", track: " << info.track;
             m_blockRefresh = false;
             return NULL;
         }
@@ -2151,7 +2152,7 @@ void CustomTrackView::adjustTimelineClips(EDITMODE mode, ClipItem *item, ItemInf
                         new ResizeClipCommand(this, clip->info(), newclipInfo, false, false, command);
                         clip->resizeEnd(info.startPos.frames(m_document->fps()));
                     }
-                } else if (clip->endPos() < info.endPos) {
+                } else if (clip->endPos() <= info.endPos) {
                     new AddTimelineClipCommand(this, clip->xml(), clip->clipProducer(), clip->info(), clip->effectList(), false, false, false, true, command);
                     scene()->removeItem(clip);
                     delete clip;
@@ -2269,7 +2270,7 @@ int CustomTrackView::duration() const
 void CustomTrackView::addTrack(TrackInfo type, int ix)
 {
     if (ix == -1 || ix == m_document->tracksCount()) {
-        m_document->insertTrack(ix, type);
+        m_document->insertTrack(0, type);
         m_document->renderer()->mltInsertTrack(1, type.type == VIDEOTRACK);
     } else {
         m_document->insertTrack(m_document->tracksCount() - ix, type);
@@ -2305,8 +2306,8 @@ void CustomTrackView::addTrack(TrackInfo type, int ix)
             ItemInfo clipinfo = item->info();
             if (item->type() == AVWIDGET) {
                 ClipItem *clip = static_cast <ClipItem *>(item);
-               // slowmotion clips are not track dependant, so no need to update them
-               if (clip->speed() != 1.0) continue;
+                // slowmotion clips are not track dependant, so no need to update them
+                if (clip->speed() != 1.0) continue;
                 // We add a move clip command so that we get the correct producer for new track number
                 if (clip->clipType() == AV || clip->clipType() == AUDIO) {
                     Mlt::Producer *prod;
@@ -4907,6 +4908,7 @@ void CustomTrackView::setOutPoint()
 
 void CustomTrackView::slotUpdateAllThumbs()
 {
+    if (!isEnabled()) return;
     QList<QGraphicsItem *> itemList = items();
     //if (itemList.isEmpty()) return;
     ClipItem *item;