Fix default param value for keyframe effects with factor. Fixes #18

Fix wrong version of effect used because of unfaithful double comparison
parent 8b9669e1
......@@ -3,7 +3,7 @@
<name>Balance</name>
<description>Adjust the left/right balance</description>
<author>Dan Dennedy</author>
<parameter type="animated" name="split" max="1000" min="0" default="500" factor="1000">
<parameter type="animated" name="split" max="1000" min="0" default=".5" factor="1000">
<name>Balance</name>
</parameter>
</effect>
......@@ -7,7 +7,7 @@
<paramlistdisplay>Left,Right</paramlistdisplay>
<name>Channel</name>
</parameter>
<parameter type="keyframe" name="start" max="1000" min="0" default="500" factor="1000">
<parameter type="keyframe" name="start" max="1000" min="0" default=".5" factor="1000">
<name>Pan</name>
</parameter>
</effect>
......@@ -7,7 +7,7 @@
<parameter type="color" name="Neutral Color" default="0xffffffff">
<name>Neutral Color</name>
</parameter>
<parameter type="keyframe" name="Green Tint" default="1200" min="0" max="2500" factor="1000">
<parameter type="keyframe" name="Green Tint" default="1.2" min="0" max="2500" factor="1000">
<name>Green Tint</name>
</parameter>
</effect>
......@@ -18,7 +18,7 @@
<parameter type="color" name="Neutral Color" default="0xffffffff">
<name>Neutral Color</name>
</parameter>
<parameter type="keyframe" name="Green Tint" default="1333" min="0" max="10000" factor="10000">
<parameter type="keyframe" name="Green Tint" default=".1333" min="0" max="10000" factor="10000">
<name>Green Tint</name>
</parameter>
</effect>
......
......@@ -3,13 +3,11 @@
<name>Denoiser</name>
<description>High quality 3D denoiser</description>
<author>Marko Cebokli, Daniel Moreno</author>
<parameter type="simplekeyframe" name="Spatial" default="40" min="0" max="1000" factor="1000">
<parameter type="simplekeyframe" name="Spatial" default="0.004" min="0" max="1000" factor="1000">
<name>Spatial</name>
<comment>Amount of spatial filtering</comment>
</parameter>
<parameter type="simplekeyframe" name="Temporal" default="60" min="0" max="1000" factor="1000">
<parameter type="simplekeyframe" name="Temporal" default="0.006" min="0" max="1000" factor="1000">
<name>Temporal</name>
<comment>Amount of temporal filtering</comment>
</parameter>
......
......@@ -69,7 +69,7 @@ protected:
QString id; // identifier of the asset
QString mltId; //"tag" of the asset, that is the name of the mlt service
QString name, description, author, version_str;
double version;
int version;
QDomElement xml;
AssetType type;
};
......
......@@ -132,7 +132,7 @@ template <typename AssetType> bool AbstractAssetsRepository<AssetType>::parseInf
res.description = metadata->get("description");
res.author = metadata->get("creator");
res.version_str = metadata->get("version");
res.version = metadata->get_double("version");
res.version = ceil(100 * metadata->get_double("version"));
res.id = res.mltId = assetId;
parseType(metadata, res);
// Create params
......@@ -290,7 +290,7 @@ template <typename AssetType> bool AbstractAssetsRepository<AssetType>::parseInf
// Check if there is a maximal version set
if (currentAsset.hasAttribute(QStringLiteral("version"))) {
// a specific version of the filter is required
if (locale.toDouble(currentAsset.attribute(QStringLiteral("version"))) > m_assets.at(tag).version) {
if (m_assets.at(tag).version < (int)(100 * currentAsset.attribute(QStringLiteral("version")).toDouble())) {
return false;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment