]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.cpp
Fix hang on exit somewhere strange inside Qt on OS X.
[kdenlive] / src / customtrackview.cpp
index 28f20905c3c9879bd9d8130179bb4c3f961012f0..5dfc7344ee9ca5e5f9f7a3d68bb9cb75245a668f 100644 (file)
@@ -1553,6 +1553,7 @@ void CustomTrackView::addEffect(int track, GenTime pos, QDomElement effect)
         // Add track effect
         m_document->addTrackEffect(track - 1, effect);
         m_document->renderer()->mltAddTrackEffect(track, getEffectArgs(effect));
+        emit updateTrackEffectState(track - 1);
         emit showTrackEffects(track, m_document->trackInfoAt(track - 1));
         return;
     }
@@ -1587,6 +1588,7 @@ void CustomTrackView::deleteEffect(int track, GenTime pos, QDomElement effect)
         // Delete track effect
         m_document->removeTrackEffect(track - 1, effect);
         m_document->renderer()->mltRemoveTrackEffect(track, index, true);
+        emit updateTrackEffectState(track - 1);
         emit showTrackEffects(track, m_document->trackInfoAt(track - 1));
         return;
     }
@@ -1805,6 +1807,7 @@ void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement insertedE
         if (!m_document->renderer()->mltEditEffect(m_document->tracksCount() - track, pos, effectParams))
             emit displayMessage(i18n("Problem editing effect"), ErrorMessage);
         m_document->setTrackEffect(m_document->tracksCount() - track - 1, ix, effect);
+        emit updateTrackEffectState(track - 1);
         setDocumentModified();
         return;
 
@@ -2645,6 +2648,7 @@ void CustomTrackView::configTracks(QList < TrackInfo > trackInfos)
     for (int i = 0; i < trackInfos.count(); ++i) {
         m_document->setTrackType(i, trackInfos.at(i));
         m_document->renderer()->mltChangeTrackState(i + 1, m_document->trackInfoAt(i).isMute, m_document->trackInfoAt(i).isBlind);
+        lockTrack(m_document->tracksCount() - i - 1, m_document->trackInfoAt(i).isLocked, false);
     }
 
     QTimer::singleShot(300, this, SIGNAL(trackHeightChanged()));
@@ -2670,11 +2674,12 @@ void CustomTrackView::slotSwitchTrackLock(int ix)
 }
 
 
-void CustomTrackView::lockTrack(int ix, bool lock)
+void CustomTrackView::lockTrack(int ix, bool lock, bool requestUpdate)
 {
     int tracknumber = m_document->tracksCount() - ix - 1;
     m_document->switchTrackLock(tracknumber, lock);
-    emit doTrackLock(ix, lock);
+    if (requestUpdate)
+        emit doTrackLock(ix, lock);
     AbstractClipItem *clip = NULL;
     QList<QGraphicsItem *> selection = m_scene->items(0, ix * m_tracksHeight + m_tracksHeight / 2, sceneRect().width(), m_tracksHeight / 2 - 2);
 
@@ -4404,13 +4409,13 @@ void CustomTrackView::prepareResizeClipStart(AbstractClipItem* item, ItemInfo ol
                 }
             }
 
-            int panZoomPos = clip->hasEffect("affine", "pan_zoom");
+            /*int panZoomPos = clip->hasEffect("affine", "pan_zoom");
             if (panZoomPos != -1) {
                 doc.appendChild(doc.importNode(clip->effectAt(panZoomPos), true));
                 indexes.append(panZoomPos);
-            }
+            }*/
 
-            if (clip->checkEffectsKeyframesPos(oldInfo.cropStart.frames(m_document->fps()), clip->cropStart().frames(m_document->fps()), true)) {
+            if (clip->checkEffectsKeyframesPos(oldInfo.cropStart.frames(m_document->fps()), clip->cropStart().frames(m_document->fps()), true, m_document->width(), m_document->height())) {
                 // Keyframes were modified, updateClip
                 QDomNodeList effs = doc.elementsByTagName("effect");
                 // Hack:
@@ -4527,7 +4532,7 @@ void CustomTrackView::prepareResizeClipEnd(AbstractClipItem* item, ItemInfo oldI
                 }
             }
 
-            if (clip->checkEffectsKeyframesPos((oldInfo.cropStart + oldInfo.endPos - oldInfo.startPos).frames(m_document->fps()) - 1, (clip->cropStart() + clip->cropDuration()).frames(m_document->fps()) - 1, false)) {
+            if (clip->checkEffectsKeyframesPos((oldInfo.cropStart + oldInfo.endPos - oldInfo.startPos).frames(m_document->fps()) - 1, (clip->cropStart() + clip->cropDuration()).frames(m_document->fps()) - 1, false, m_document->width(), m_document->height())) {
                 // Keyframes were modified, updateClip
                 QDomNodeList effs = doc.elementsByTagName("effect");
                 // Hack: