]> git.sesse.net Git - kdenlive/blobdiff - src/effectstackedit.cpp
Fix seek to pos in composite transition:
[kdenlive] / src / effectstackedit.cpp
index 8d951902f148363c3b1c8f9f5cd53ffbc5e8ba3c..d47da1ae9984ad9cc70c2f30e2ffb45d41ede763 100644 (file)
@@ -86,6 +86,7 @@ EffectStackEdit::EffectStackEdit(QWidget *parent) :
 EffectStackEdit::~EffectStackEdit()
 {
     iconCache.clear();
+    delete m_baseWidget;
 }
 
 void EffectStackEdit::setFrameSize(QPoint p)
@@ -121,6 +122,7 @@ void EffectStackEdit::updateParameter(const QString &name, const QString &value)
 void EffectStackEdit::transferParamDesc(const QDomElement d, int in, int out)
 {
     clearAllItems();
+    if (m_keyframeEditor) delete m_keyframeEditor;
     m_keyframeEditor = NULL;
     m_params = d;
     m_in = in;
@@ -225,7 +227,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int in, int out)
             m_valueItems[paramName+"complex"] = pl;
             connect(pl, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
         } else if (type == "geometry") {
-            Geometryval *geo = new Geometryval(m_profile, m_frameSize);
+            Geometryval *geo = new Geometryval(m_profile, m_frameSize, m_in);
             geo->setupParam(pa, minFrame, maxFrame);
             m_vbox->addWidget(geo);
             m_valueItems[paramName+"geometry"] = geo;
@@ -235,11 +237,12 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int in, int out)
             // keyframe editor widget
             kDebug() << "min: " << m_in << ", MAX: " << m_out;
             if (m_keyframeEditor == NULL) {
-                KeyframeEdit *geo = new KeyframeEdit(pa, m_in, m_in + m_out, pa.attribute("min").toInt(), pa.attribute("max").toInt(), m_timecode, paramName);
+                KeyframeEdit *geo = new KeyframeEdit(pa, m_in, m_in + m_out, pa.attribute("min").toInt(), pa.attribute("max").toInt(), m_timecode, e.attribute("active_keyframe", "-1").toInt());
                 m_vbox->addWidget(geo);
                 m_valueItems[paramName+"keyframe"] = geo;
                 m_keyframeEditor = geo;
                 connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
+                connect(geo, SIGNAL(seekToPos(int)), this, SLOT(slotSeekToPos(int)));
             } else {
                 // we already have a keyframe editor, so just add another column for the new param
                 m_keyframeEditor->addParameter(pa);
@@ -336,7 +339,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int in, int out)
 
 void EffectStackEdit::slotSeekToPos(int pos)
 {
-    emit seekTimeline(m_in + pos);
+    emit seekTimeline(pos);
 }
 
 wipeInfo EffectStackEdit::getWipeInfo(QString value)
@@ -423,8 +426,8 @@ void EffectStackEdit::collectAllParameters()
         else if (type == "position") paramName.append("position");
         else if (type == "geometry") paramName.append("geometry");
         else if (type == "keyframe") paramName.append("keyframe");
-        if (!m_valueItems.contains(paramName)) {
-            // kDebug() << "// Param: " << paramName << " NOT FOUND";
+        if (type != "simplekeyframe" && !m_valueItems.contains(paramName)) {
+            kDebug() << "// Param: " << paramName << " NOT FOUND";
             continue;
         }
 
@@ -488,8 +491,12 @@ void EffectStackEdit::collectAllParameters()
             else info.end = RIGHT;
             info.endTransparency = wp->end_transp->value();
             setValue = getWipeString(info);
+        } else if ((type == "simplekeyframe" || type == "keyframe") && m_keyframeEditor) {
+            QString realName = i18n(na.toElement().text().toUtf8().data());
+            QString val = m_keyframeEditor->getValue(realName);
+            kDebug() << "SET VALUE: " << val;
+            namenode.item(i).toElement().setAttribute("keyframes", val);
         }
-
         if (!setValue.isNull()) {
             pa.attributes().namedItem("value").setNodeValue(setValue);
         }
@@ -538,5 +545,6 @@ void EffectStackEdit::clearAllItems()
         delete child;
         if (wid) delete wid;
     }
+    m_keyframeEditor = NULL;
     blockSignals(false);
 }