]> git.sesse.net Git - kdenlive/blobdiff - src/trackview.cpp
Improve keyframe editor, fix random keyframe sometimes inserted
[kdenlive] / src / trackview.cpp
index 16e0da314683bb46a31b69d0b36313a530b22381..b6009c1a9dd4564baa1225c3981bad80f9121616 100644 (file)
@@ -689,7 +689,7 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool locked)
                             QDomElement currenteffect = clipeffect.cloneNode().toElement();
                             currenteffect.setAttribute("kdenlive_ix", effectindex);
                             QDomNodeList clipeffectparams = currenteffect.childNodes();
-                           
+
                             if (MainWindow::videoEffects.hasKeyFrames(currenteffect)) {
                                 //kDebug() << " * * * * * * * * * * ** CLIP EFF WITH KFR FND  * * * * * * * * * * *";
                                 // effect is key-framable, read all effects to retrieve keyframes
@@ -792,16 +792,15 @@ int TrackView::slotAddProjectTrack(int ix, QDomElement xml, bool locked)
                                             if (factor.startsWith('%')) {
                                                 fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
                                             } else fact = factor.toDouble();
-                                           if (e.attribute("type") == "simplekeyframe") {
-                                               QStringList kfrs = paramvalue.split(";");
-                                               for (int l = 0; l < kfrs.count(); l++) {
-                                                   QString fr = kfrs.at(l).section("=", 0, 0);
-                                                   double val = kfrs.at(l).section("=", 1, 1).toDouble();
-                                                   kfrs[l] = fr + ":" + QString::number((int) (val * fact));
-                                               }
-                                               e.setAttribute("keyframes", kfrs.join(";"));
-                                           }
-                                            else e.setAttribute("value", paramvalue.toDouble() * fact);
+                                            if (e.attribute("type") == "simplekeyframe") {
+                                                QStringList kfrs = paramvalue.split(";");
+                                                for (int l = 0; l < kfrs.count(); l++) {
+                                                    QString fr = kfrs.at(l).section("=", 0, 0);
+                                                    double val = kfrs.at(l).section("=", 1, 1).toDouble();
+                                                    kfrs[l] = fr + ":" + QString::number((int)(val * fact));
+                                                }
+                                                e.setAttribute("keyframes", kfrs.join(";"));
+                                            } else e.setAttribute("value", paramvalue.toDouble() * fact);
                                         } else e.setAttribute("value", paramvalue);
                                         break;
                                     }