X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Feffectstackedit.cpp;h=00ebba69d55ecc00fe2b0d9494c31a4cbfeb2cab;hb=29b7373a465ab472ad5be4edf00e98aabfe7825e;hp=2ed0bc631b4c2e2c24c2585370b9fee01ecfd649;hpb=448dbcd79f25292802f759c1d4ac652308e50b7f;p=kdenlive diff --git a/src/effectstackedit.cpp b/src/effectstackedit.cpp index 2ed0bc63..00ebba69 100644 --- a/src/effectstackedit.cpp +++ b/src/effectstackedit.cpp @@ -232,9 +232,8 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, ItemInfo info, bool } } #endif - QDomElement e = m_params.toElement(); - int minFrame = e.attribute("start").toInt(); - int maxFrame = e.attribute("end").toInt(); + int minFrame = d.attribute("start").toInt(); + int maxFrame = d.attribute("end").toInt(); // In transitions, maxFrame is in fact one frame after the end of transition if (maxFrame > 0) maxFrame --; @@ -372,14 +371,14 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, ItemInfo info, bool KeyframeEdit *geo; if (pa.attribute("widget") == "corners") { // we want a corners-keyframe-widget - CornersWidget *corners = new CornersWidget(m_monitor, pa, m_in, m_out, m_timecode, e.attribute("active_keyframe", "-1").toInt(), this); + CornersWidget *corners = new CornersWidget(m_monitor, pa, m_in, m_out, m_timecode, d.attribute("active_keyframe", "-1").toInt(), this); corners->slotShowScene(!disable); connect(corners, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int))); connect(this, SIGNAL(effectStateChanged(bool)), corners, SLOT(slotShowScene(bool))); connect(this, SIGNAL(syncEffectsPos(int)), corners, SLOT(slotSyncPosition(int))); geo = static_cast(corners); } else { - geo = new KeyframeEdit(pa, m_in, m_out, m_timecode, e.attribute("active_keyframe", "-1").toInt()); + geo = new KeyframeEdit(pa, m_in, m_out, m_timecode, d.attribute("active_keyframe", "-1").toInt()); } m_vbox->addWidget(geo); m_valueItems[paramName+"keyframe"] = geo; @@ -416,7 +415,12 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, ItemInfo info, bool KisCurveWidget *curve = new KisCurveWidget(this); curve->setMaxPoints(pa.attribute("max").toInt()); QList points; - int number = EffectsList::parameter(e, pa.attribute("number")).toInt(); + int number; + if (d.attribute("version").toDouble() > 0.2) { + number = EffectsList::parameter(d, pa.attribute("number")).toDouble() * 10; + } else { + number = EffectsList::parameter(d, pa.attribute("number")).toInt(); + } QString inName = pa.attribute("inpoints"); QString outName = pa.attribute("outpoints"); int start = pa.attribute("min").toInt(); @@ -425,7 +429,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, ItemInfo info, bool in.replace("%i", QString::number(j)); QString out = outName; out.replace("%i", QString::number(j)); - points << QPointF(EffectsList::parameter(e, in).toDouble(), EffectsList::parameter(e, out).toDouble()); + points << QPointF(EffectsList::parameter(d, in).toDouble(), EffectsList::parameter(d, out).toDouble()); } if (!points.isEmpty()) curve->setCurve(KisCubicCurve(points)); @@ -443,7 +447,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, ItemInfo info, bool QString depends = pa.attribute("depends"); if (!depends.isEmpty()) - meetDependency(paramName, type, EffectsList::parameter(e, depends)); + meetDependency(paramName, type, EffectsList::parameter(d, depends)); } else if (type == "bezier_spline") { BezierSplineWidget *widget = new BezierSplineWidget(value, this); stretch = false; @@ -452,7 +456,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, ItemInfo info, bool connect(widget, SIGNAL(modified()), this, SLOT(collectAllParameters())); QString depends = pa.attribute("depends"); if (!depends.isEmpty()) - meetDependency(paramName, type, EffectsList::parameter(e, depends)); + meetDependency(paramName, type, EffectsList::parameter(d, depends)); #ifdef QJSON } else if (type == "roto-spline") { RotoWidget *roto = new RotoWidget(value, m_monitor, info, m_timecode, this); @@ -646,11 +650,10 @@ QString EffectStackEdit::getWipeString(wipeInfo info) void EffectStackEdit::collectAllParameters() { if (m_valueItems.isEmpty() || m_params.isNull()) return; - QLocale locale; - locale.setNumberOptions(QLocale::OmitGroupSeparator); const QDomElement oldparam = m_params.cloneNode().toElement(); QDomElement newparam = oldparam.cloneNode().toElement(); QDomNodeList namenode = newparam.elementsByTagName("parameter"); + QLocale locale; for (int i = 0; i < namenode.count() ; i++) { QDomNode pa = namenode.item(i); @@ -726,7 +729,11 @@ void EffectStackEdit::collectAllParameters() QString outName = pa.attributes().namedItem("outpoints").nodeValue(); int off = pa.attributes().namedItem("min").nodeValue().toInt(); int end = pa.attributes().namedItem("max").nodeValue().toInt(); - EffectsList::setParameter(newparam, number, QString::number(points.count())); + if (oldparam.attribute("version").toDouble() > 0.2) { + EffectsList::setParameter(newparam, number, locale.toString(points.count() / 10.)); + } else { + EffectsList::setParameter(newparam, number, QString::number(points.count())); + } for (int j = 0; (j < points.count() && j + off <= end); j++) { QString in = inName; in.replace("%i", QString::number(j + off));