]> git.sesse.net Git - kdenlive/commitdiff
When cutting a clip, don't duplicate unwanted effects (fade in) to second part of...
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 28 Apr 2009 20:57:32 +0000 (20:57 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 28 Apr 2009 20:57:32 +0000 (20:57 +0000)
svn path=/trunk/kdenlive/; revision=3331

src/customtrackview.cpp
src/renderer.cpp

index 4058fe016ec079be15ca5c54ceea60451db5036e..4813edfdcb5684fa388c8403e5b619871c0d0896 100644 (file)
@@ -1326,7 +1326,6 @@ void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement effect, i
                 int pos = effectParams.paramValue("out").toInt() - effectParams.paramValue("in").toInt();
                 clip->setFadeOut(pos);
             }
-
         }
     }
     m_document->setModified(true);
@@ -1396,6 +1395,17 @@ void CustomTrackView::cutClip(ItemInfo info, GenTime cutTime, bool cut)
         else newPos.cropStart = item->info().cropStart + (cutTime - info.startPos) * speed;
         newPos.track = info.track;
         ClipItem *dup = item->clone(newPos);
+        // remove unwanted effects (fade in) from 2nd part of cutted clip
+        int ix = dup->hasEffect(QString(), "fadein");
+        if (ix != -1) {
+            QDomElement oldeffect = item->effectAt(ix);
+            dup->deleteEffect(oldeffect.attribute("kdenlive_ix"));
+        }
+        ix = dup->hasEffect(QString(), "fade_from_black");
+        if (ix != -1) {
+            QDomElement oldeffect = item->effectAt(ix);
+            dup->deleteEffect(oldeffect.attribute("kdenlive_ix"));
+        }
         item->resizeEnd(cutPos, false);
         scene()->addItem(dup);
         if (item->checkKeyFrames()) slotRefreshEffects(item);
index 6893ef5a8cfae6b4b19dd298c340a3690a5b9954..a3aee435d4a3f0b37159c6e53ed4303948da4f21 100644 (file)
@@ -1455,7 +1455,8 @@ void Render::mltCutClip(int track, GenTime position)
     int ct = 0;
     Mlt::Filter *filter = clipService.filter(ct);
     while (filter) {
-        if (filter->is_valid() && strcmp(filter->get("kdenlive_id"), "")) {
+        // Only duplicate Kdenlive filters, and skip the fade in effects
+        if (filter->is_valid() && strcmp(filter->get("kdenlive_id"), "") && strcmp(filter->get("kdenlive_id"), "fadein") && strcmp(filter->get("kdenlive_id"), "fade_from_black")) {
             // looks like there is no easy way to duplicate a filter,
             // so we will create a new one and duplicate its properties
             Mlt::Filter *dup = new Mlt::Filter(*m_mltProfile, filter->get("mlt_service"));