]> git.sesse.net Git - kdenlive/blobdiff - src/effectstackedit.cpp
Resetting an effect should not loose the filter id
[kdenlive] / src / effectstackedit.cpp
index 1d36e385e6874b4ee60cea9f3493afb0547d2c41..ab4785190e25a04c3807304ae15364993bae3be5 100644 (file)
@@ -69,10 +69,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement& d,int ,int){
        QDomNodeList namenode = params.elementsByTagName("parameter");
        
        clearAllItems();
-               QString outstr;
-               QTextStream str(&outstr);
-               d.save(str,2);
-               kDebug() << outstr;
+
        for (int i=0;i< namenode.count() ;i++){
                kDebug() << "in form";
                QDomNode pa=namenode.item(i);
@@ -112,7 +109,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement& d,int ,int){
                        valueItems[paramName]=bval;
                        uiItems.append(bval);
                }else if(type=="complex"){
-                       QStringList names=nodeAtts.namedItem("name").nodeValue().split(";");
+                       /*QStringList names=nodeAtts.namedItem("name").nodeValue().split(";");
                        QStringList max=nodeAtts.namedItem("max").nodeValue().split(";");
                        QStringList min=nodeAtts.namedItem("min").nodeValue().split(";");
                        QStringList val=value.split(";");
@@ -124,10 +121,12 @@ void EffectStackEdit::transferParamDesc(const QDomElement& d,int ,int){
                                for (int i=0;i< names.size();i++){
                                        createSliderItem(names[i],val[i].toInt(),min[i].toInt(),max[i].toInt());
                                };
-                       }
+                       }*/
                        ComplexParameter *pl=new ComplexParameter;
+                       connect (pl, SIGNAL ( parameterChanged()),this, SLOT( collectAllParameters ()) );
                        pl->setupParam(d,0,100);
                        vbox->addWidget(pl);
+                       valueItems[paramName+"complex"]=pl;
                        items.append(pl);
                }else if (type=="color"){
                        Ui::Colorval_UI *cval=new Ui::Colorval_UI;
@@ -152,7 +151,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement& d,int ,int){
        }
 }
 void EffectStackEdit::collectAllParameters(){
-       kDebug() << "cklicked";
+       QDomElement oldparam = params.cloneNode().toElement();
        QDomNodeList namenode = params.elementsByTagName("parameter");
 
        for (int i=0;i< namenode.count() ;i++){
@@ -175,12 +174,16 @@ void EffectStackEdit::collectAllParameters(){
                if (type=="color"){
                        KColorButton *color=((Ui::Colorval_UI*)valueItems[na.toElement().text()])->kcolorbutton;
                        setValue.sprintf("0x%08x",color->color().rgba());
-               }
+               }else
+                       if (type=="complex"){
+                               ComplexParameter *complex=((ComplexParameter*)valueItems[na.toElement().text()+"complex"]);
+                               namenode.item(i)=complex->getParamDesc();
+                       }
                if (!setValue.isEmpty()){
                        pa.attributes().namedItem("value").setNodeValue(setValue);
                }
        }
-       emit parameterChanged(params);
+       emit parameterChanged(oldparam, params);
 }
 
 void EffectStackEdit::createSliderItem(const QString& name, int val ,int min, int max){