Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Kdenlive
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
258
Issues
258
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Multimedia
Kdenlive
Commits
8fe1e09d
Commit
8fe1e09d
authored
Aug 03, 2019
by
Jean-Baptiste Mardelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MLT effects with float param and no xml description
Fixes
#295
parent
2875d557
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
12 deletions
+35
-12
src/assets/abstractassetsrepository.ipp
src/assets/abstractassetsrepository.ipp
+35
-12
No files found.
src/assets/abstractassetsrepository.ipp
View file @
8fe1e09d
...
...
@@ -148,6 +148,7 @@ template <typename AssetType> bool AbstractAssetsRepository<AssetType>::parseInf
QDomElement eff = doc.createElement(QStringLiteral("effect"));
eff.setAttribute(QStringLiteral("tag"), id);
eff.setAttribute(QStringLiteral("id"), id);
QLocale locale;
////qCDebug(KDENLIVE_LOG)<<"Effect: "<<id;
Mlt::Properties param_props((mlt_properties)metadata->get_data("parameters"));
...
...
@@ -165,15 +166,25 @@ template <typename AssetType> bool AbstractAssetsRepository<AssetType>::parseInf
// Do not expose readonly parameters
continue;
}
QString paramType = paramdesc.get("type");
if (paramdesc.get("maximum")) {
params.setAttribute(QStringLiteral("max"), paramdesc.get("maximum"));
}
if (paramdesc.get("minimum")) {
params.setAttribute(QStringLiteral("min"), paramdesc.get("minimum"));
if (paramType == QLatin1String("float")) {
// Float must be converted using correct locale
if (paramdesc.get("maximum")) {
params.setAttribute(QStringLiteral("max"), locale.toString(paramdesc.get_double("maximum")));
}
if (paramdesc.get("minimum")) {
params.setAttribute(QStringLiteral("min"), locale.toString(paramdesc.get_double("minimum")));
}
} else {
if (paramdesc.get("maximum")) {
params.setAttribute(QStringLiteral("max"), paramdesc.get("maximum"));
}
if (paramdesc.get("minimum")) {
params.setAttribute(QStringLiteral("min"), paramdesc.get("minimum"));
}
}
QString paramType = paramdesc.get("type");
if (paramType == QLatin1String("integer")) {
if (params.attribute(QStringLiteral("min")) == QLatin1String("0") && params.attribute(QStringLiteral("max")) == QLatin1String("1")) {
params.setAttribute(QStringLiteral("type"), QStringLiteral("bool"));
...
...
@@ -206,13 +217,25 @@ template <typename AssetType> bool AbstractAssetsRepository<AssetType>::parseInf
}
}
if (!params.hasAttribute(QStringLiteral("value"))) {
if (paramdesc.get("default")) {
params.setAttribute(QStringLiteral("default"), paramdesc.get("default"));
}
if (paramdesc.get("value")) {
params.setAttribute(QStringLiteral("value"), paramdesc.get("value"));
if (paramType == QLatin1String("float")) {
// floats have to be converted using correct locale
if (paramdesc.get("default")) {
params.setAttribute(QStringLiteral("default"), locale.toString(paramdesc.get_double("default")));
}
if (paramdesc.get("value")) {
params.setAttribute(QStringLiteral("value"), locale.toString(paramdesc.get_double("value")));
} else {
params.setAttribute(QStringLiteral("value"), locale.toString(paramdesc.get_double("default")));
}
} else {
params.setAttribute(QStringLiteral("value"), paramdesc.get("default"));
if (paramdesc.get("default")) {
params.setAttribute(QStringLiteral("default"), paramdesc.get("default"));
}
if (paramdesc.get("value")) {
params.setAttribute(QStringLiteral("value"), paramdesc.get("value"));
} else {
params.setAttribute(QStringLiteral("value"), paramdesc.get("default"));
}
}
}
QString paramName = paramdesc.get("title");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment