int max = e.attribute("max").toInt();
int min = e.attribute("min").toInt();
int def = e.attribute("default").toInt();
- int factor = e.attribute("factor").toInt();
- if (factor == 0) factor = 1;
+ double factor = e.attribute("factor", "1").toDouble();
// Effect has a keyframe type parameter, we need to set the values
if (e.attribute("keyframes").isEmpty()) {
int max = e.attribute("max").toInt();
int min = e.attribute("min").toInt();
int def = e.attribute("default").toInt();
- int factor = e.attribute("factor").toInt();
- if (factor == 0) factor = 1;
+ double factor = e.attribute("factor", "1").toDouble();
QString keyframes;
if (m_keyframes.count() > 1) {
for (int i = 0; i < params.count(); i++) {
QDomElement e = params.item(i).toElement();
if (!e.isNull()) {
- if (e.attribute("factor").isEmpty()) {
+ double f = e.attribute("factor", "1").toDouble();
+ if (f == 1) {
effectParams[e.attribute("name")] = e.attribute("value");
// check if it is a fade effect
if (effectId == "fadein") {
else if (e.attribute("name") == "in") fade += e.attribute("value").toInt();
}
} else {
- effectParams[e.attribute("name")] = QString::number(effectParams[e.attribute("name")].toDouble() / e.attribute("factor").toDouble());
+ effectParams[e.attribute("name")] = QString::number(effectParams[e.attribute("name")].toDouble() / f);
}
}
}
effectParams["keyframes"] = e.attribute("keyframes");
effectParams["max"] = e.attribute("max");
effectParams["min"] = e.attribute("min");
- effectParams["factor"] = e.attribute("factor");
+ effectParams["factor"] = e.attribute("factor", "1");
effectParams["starttag"] = e.attribute("starttag", "start");
effectParams["endtag"] = e.attribute("endtag", "end");
} else if (e.attribute("namedesc").contains(";")) {
txtNeu << (int)(values[i+1].toDouble());
}
effectParams["start"] = neu;
- } else if (!e.isNull()) {
- if (!e.attribute("factor").isEmpty())
- effectParams[e.attribute("name")] = QString::number(effectParams[e.attribute("value")].toDouble() / e.attribute("factor").toDouble());
+ } else {
+ if (e.attribute("factor", "1") != "1")
+ effectParams[e.attribute("name")] = QString::number(e.attribute("value").toDouble() / e.attribute("factor").toDouble());
else effectParams[e.attribute("name")] = e.attribute("value");
}
}