//connect (ui.effectlist, SIGNAL (itemSelectionChanged() ) , this, SLOT ( itemSelectionChanged()));
connect( this,SIGNAL (transferParamDesc(const QDomElement&,int ,int) ), ui.kplotwidget, SLOT(setPointLists(const QDomElement&,int ,int) ));
connect(ui.kplotwidget, SIGNAL (parameterChanged(QDomElement ) ), this , SLOT (slotUpdateEffectParams(QDomElement)));
+ connect(ui.kplotwidget, SIGNAL (parameterList(QStringList)), this , SLOT (slotUpdateParameterList(QStringList)));
/*ÜeffectLists["audio"]=audioEffectList;
effectLists["video"]=videoEffectList;
effectLists["custom"]=customEffectList;*/
}
void ComplexParameter::setupParam(const QDomElement& d,int from,int to){
+ param=d;
ui.kplotwidget->setPointLists(d,from,to);
}
void ComplexParameter::itemSelectionChanged (){
//kDebug() << "drop";
}
+
+void ComplexParameter::slotUpdateEffectParams(QDomElement e){
+ param=e;
+ emit parameterChanged();
+}
+
+QDomElement ComplexParameter::getParamDesc(){
+ return param;
+}
+
+void ComplexParameter::slotUpdateParameterList(QStringList l){
+ kDebug() << l ;
+ ui.parameterList->clear();
+ ui.parameterList->addItems(l);
+}
+
#include "complexparameter.moc"
public:
ComplexParameter(QWidget *parent=0);
-
+ QDomElement getParamDesc();
private:
int activeRow;
QList<QDomElement> effects;
void setupListView();
void updateButtonStatus();
QMap<QString,EffectsList*> effectLists;
-
+
+ QDomElement param;
public slots:
void slotSetMoveX();
void slotSetMoveY();
void slotParameterChanged(const QString&);
void itemSelectionChanged();
void setupParam(const QDomElement&,int,int);
+ void slotUpdateEffectParams(QDomElement e);
+ void slotUpdateParameterList(QStringList);
signals:
void transferParamDesc(const QDomElement&,int ,int);
void removeEffect(ClipItem*, QDomElement);
void updateClipEffect(ClipItem*, QDomElement);
+ void parameterChanged();
};
};
}
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;
}
}
void EffectStackEdit::collectAllParameters(){
- kDebug() << "cklicked";
+
QDomNodeList namenode = params.elementsByTagName("parameter");
for (int i=0;i< namenode.count() ;i++){
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);
}
itemParameter=d;
QDomNodeList namenode = d.elementsByTagName("parameter");
- int max_y=0;
+ int max_y=0,min_y=0;
removeAllPlotObjects ();
parameterNameList.clear();
plotobjects.clear();
+ QString dat;
+ QTextStream stre(&dat);
+ d.save(stre,2);
+ kDebug() << dat;
- for (int i=0;i< namenode.count() ;i++){
- KPlotObject *plot=new KPlotObject(colors[plotobjects.size()%colors.size()]);
- plot->setShowLines(true);
- //QPair<QString, QMap< int , QVariant > > item=nameit.next();
- QDomNode pa=namenode.item(i);
+ if ( namenode.count() ){
+
+
+ QDomNode pa=namenode.item(0);
QDomNode na=pa.firstChildElement("name");
- parameterNameList << na.toElement().text();
+ parameterNameList << pa.attributes().namedItem("name").nodeValue().split(";");
+ emit parameterList(parameterNameList);
+
+ //max_y=pa.attributes().namedItem("max").nodeValue().toInt();
+ //int val=pa.attributes().namedItem("value").nodeValue().toInt();
+ QStringList defauls=pa.attributes().namedItem("default").nodeValue().split(";");
+ QStringList maxv=pa.attributes().namedItem("max").nodeValue().split(";");
+ QStringList minv=pa.attributes().namedItem("max").nodeValue().split(";");
+ for (int i=0;i<maxv.size();i++){
+ if (max_y< maxv[i].toInt()) max_y=maxv[i].toInt();
+ if (min_y< minv[i].toInt()) min_y=minv[i].toInt();
+ }
+
+ for (int i=0;i<parameterNameList.count();i++){
+ KPlotObject *plot=new KPlotObject(colors[plotobjects.size()%colors.size()]);
+ plot->setShowLines(true);
+
+ plot->addPoint(startframe,defauls[i].toInt());
+ //add keyframes here
+ plot->addPoint(endframe,defauls[i].toInt());
+ plotobjects.append(plot);
+ }
- max_y=pa.attributes().namedItem("max").nodeValue().toInt();
- int val=pa.attributes().namedItem("value").nodeValue().toInt();
- plot->addPoint((i+1)*20,val);
/*TODO keyframes
while (pointit.hasNext()){
pointit.next();
if (pointit.value().toInt() >maxy)
max_y=pointit.value().toInt();
}*/
- plotobjects.append(plot);
+
}
maxx=endframe;
maxy=max_y;
- setLimits(0,endframe,0,maxy+10);
+ setLimits(-1,endframe+1,-1,maxy+10);
addPlotObjects(plotobjects);
}
signals:
void parameterChanged(QDomElement );
void updateFrame(int);
+ void parameterList(QStringList);
};