]> git.sesse.net Git - kdenlive/blobdiff - src/effectstackedit.cpp
Fetch audio thumbs one after another, so that we don't create hundreds of threads:
[kdenlive] / src / effectstackedit.cpp
index 8d951902f148363c3b1c8f9f5cd53ffbc5e8ba3c..8cbc72f0b8141199fb33623bd0b09783a3cfa45d 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;
@@ -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);
@@ -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);
 }