]> git.sesse.net Git - kdenlive/blobdiff - src/clipitem.cpp
Freeze effect: when adding the effect, set the default freeze frame to the cursor...
[kdenlive] / src / clipitem.cpp
index 1e3dd89382a4d1d4432a05f68c2e36652519ddce..4ae0514ab1f74460f60d38707366948baf8fdd04 100644 (file)
@@ -155,13 +155,18 @@ int ClipItem::selectedEffectIndex() const
     return m_selectedEffect;
 }
 
-void ClipItem::initEffect(QDomElement effect)
+void ClipItem::initEffect(QDomElement effect, int diff)
 {
     // the kdenlive_ix int is used to identify an effect in mlt's playlist, should
     // not be changed
     if (effect.attribute("kdenlive_ix").toInt() == 0)
         effect.setAttribute("kdenlive_ix", QString::number(effectsCounter()));
-    // init keyframes if required
+
+    if (effect.attribute("id") == "freeze" && diff > 0) {
+        EffectsList::setParameter(effect, "frame", QString::number(diff));
+    }
+
+    // Init parameter value & keyframes if required
     QDomNodeList params = effect.elementsByTagName("parameter");
     for (int i = 0; i < params.count(); i++) {
         QDomElement e = params.item(i).toElement();