]> git.sesse.net Git - kdenlive/blobdiff - src/trackview.cpp
Replacing deprecated mpeg1video format with mpeg2ts
[kdenlive] / src / trackview.cpp
index 431876109fe650088a636beea15394131b72aa66..bbe2210032900661ab3d44c2db8879bddc219d49 100644 (file)
@@ -257,7 +257,7 @@ void TrackView::parseDocument(QDomDocument doc) {
             kDebug() << "///////  TRANSITION XML: "<< doc.toString();*/
 
             transitionInfo.startPos = GenTime(e.attribute("in").toInt(), m_doc->fps());
-            transitionInfo.endPos = GenTime(e.attribute("out").toInt(), m_doc->fps());
+            transitionInfo.endPos = GenTime(e.attribute("out").toInt() + 1, m_doc->fps());
             transitionInfo.track = b_track;
             //kDebug() << "///////////////   +++++++++++  ADDING TRANSITION ON TRACK: " << b_track << ", TOTAL TRKA: " << m_projectTracks;
             Transition *tr = new Transition(transitionInfo, a_track, m_doc->fps(), base, isAutomatic);
@@ -401,7 +401,6 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool videotrack) {
                 for (int ix = 0; ix < effects.count(); ix++) {
                     QDomElement effect = effects.at(ix).toElement();
                     if (effect.tagName() == "filter") {
-                        kDebug() << " * * * * * * * * * * ** CLIP EFF FND  * * * * * * * * * * *";
                         // add effect to clip
                         QString effecttag;
                         QString effectid;
@@ -418,7 +417,7 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool videotrack) {
                                 effectindex = effectparam.text();
                             }
                         }
-
+                        //kDebug() << "+ + CLIP EFF FND: " << effecttag << ", " << effectid << ", " << effectindex;
                         // get effect standard tags
                         QDomElement clipeffect = MainWindow::customEffects.getEffectByTag(QString(), effectid);
                         if (clipeffect.isNull()) clipeffect = MainWindow::videoEffects.getEffectByTag(effecttag, effectid);
@@ -434,7 +433,7 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool videotrack) {
                             QDomNodeList clipeffectparams = currenteffect.childNodes();
 
                             if (MainWindow::videoEffects.hasKeyFrames(currenteffect)) {
-                                kDebug() << " * * * * * * * * * * ** CLIP EFF WITH KFR FND  * * * * * * * * * * *";
+                                //kDebug() << " * * * * * * * * * * ** CLIP EFF WITH KFR FND  * * * * * * * * * * *";
                                 // effect is key-framable, read all effects to retrieve keyframes
                                 double factor;
                                 QString starttag;
@@ -479,6 +478,7 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool videotrack) {
                                         if (subeffectparam.attribute("name") == "kdenlive_ix" && subeffectparam.text() != effectindex) {
                                             //We are not in the same effect, stop parsing
                                             lastParsedEffect = n2.previousSibling();
+                                            ix--;
                                             continueParsing = false;
                                             break;
                                         } else if (subeffectparam.attribute("name") == endtag) {
@@ -486,8 +486,10 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool videotrack) {
                                             break;
                                         }
                                     }
-                                    if (continueParsing) keyframes.append(QString::number(effectout) + ":" + QString::number(endvalue) + ";");
-                                    ix++;
+                                    if (continueParsing) {
+                                        keyframes.append(QString::number(effectout) + ":" + QString::number(endvalue) + ";");
+                                        ix++;
+                                    }
                                 }
 
                                 params = currenteffect.elementsByTagName("parameter");
@@ -498,6 +500,14 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool videotrack) {
                                 if (!continueParsing) {
                                     n2 = lastParsedEffect;
                                 }
+                            } else {
+                                // Check if effect has in/out points
+                                if (effect.hasAttribute("in")) {
+                                    EffectsList::setParameter(currenteffect, "in",  effect.attribute("in"));
+                                }
+                                if (effect.hasAttribute("out")) {
+                                    EffectsList::setParameter(currenteffect, "out",  effect.attribute("out"));
+                                }
                             }
 
                             // adjust effect parameters