Commit 71e96e10 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix slide composition with MLT7 (geometry deprecated).

Related to #1116
parent 72a4126f
Pipeline #69483 canceled with stage
......@@ -3,7 +3,7 @@
<name context="Slide Transition Name">Slide</name>
<description>Slide image from one side to another.</description>
<author>Dan Dennedy</author>
<parameter tag="geometry" type="wipe" default="-100%,0%:100%x100%;-1=0%,0%:100%x100%" name="geometry">
<parameter tag="geometry" type="wipe" default="0=-100% 0% 100% 100%;-1=0% 0% 100% 100%" name="geometry">
<name>Direction</name>
</parameter>
<parameter tag="aligned" default="0" type="bool" name="aligned" >
......
......@@ -136,40 +136,41 @@ SlideWidget::wipeInfo SlideWidget::getWipeInfo(QString value)
if (value.contains(QLatin1Char(','))) {
value.replace(',', '/');
}
QString start = value.section(QLatin1Char(';'), 0, 0);
QString start = value.section(QLatin1Char(';'), 0, 0).section(QLatin1Char('='), 1);
QString end = value.section(QLatin1Char(';'), 1, 1).section(QLatin1Char('='), 1, 1);
if (start.startsWith(QLatin1String("-100%/0"))) {
if (start.startsWith(QLatin1String("-100% 0"))) {
info.start = LEFT;
} else if (start.startsWith(QLatin1String("100%/0"))) {
} else if (start.startsWith(QLatin1String("100% 0"))) {
info.start = RIGHT;
} else if (start.startsWith(QLatin1String("0%/100%"))) {
} else if (start.startsWith(QLatin1String("0% 100%"))) {
info.start = DOWN;
} else if (start.startsWith(QLatin1String("0%/-100%"))) {
} else if (start.startsWith(QLatin1String("0% -100%"))) {
info.start = UP;
} else {
info.start = CENTER;
}
if (start.count(':') == 2) {
info.startTransparency = start.section(QLatin1Char(':'), -1).toInt();
if (start.split(QLatin1Char(' ')).count() == 5) {
qDebug()<<"== READING START TR: "<<start.section(QLatin1Char(' '), -1);
info.startTransparency = start.section(QLatin1Char(' '), -1).section(QLatin1Char('%'), 0, 0).toInt();
} else {
info.startTransparency = 100;
}
if (end.startsWith(QLatin1String("-100%/0"))) {
if (end.startsWith(QLatin1String("-100% 0"))) {
info.end = LEFT;
} else if (end.startsWith(QLatin1String("100%/0"))) {
} else if (end.startsWith(QLatin1String("100% 0"))) {
info.end = RIGHT;
} else if (end.startsWith(QLatin1String("0%/100%"))) {
} else if (end.startsWith(QLatin1String("0% 100%"))) {
info.end = DOWN;
} else if (end.startsWith(QLatin1String("0%/-100%"))) {
} else if (end.startsWith(QLatin1String("0% -100%"))) {
info.end = UP;
} else {
info.end = CENTER;
}
if (end.count(':') == 2) {
info.endTransparency = end.section(QLatin1Char(':'), -1).toInt();
if (end.split(QLatin1Char(' ')).count() == 5) {
info.endTransparency = end.section(QLatin1Char(' '), -1).section(QLatin1Char('%'), 0, 0).toInt();
} else {
info.endTransparency = 100;
}
......@@ -184,40 +185,40 @@ const QString SlideWidget::getWipeString(wipeInfo info)
QString end;
switch (info.start) {
case LEFT:
start = QStringLiteral("-100%/0%:100%x100%");
start = QStringLiteral("-100% 0% 100% 100%");
break;
case RIGHT:
start = QStringLiteral("100%/0%:100%x100%");
start = QStringLiteral("100% 0% 100% 100%");
break;
case DOWN:
start = QStringLiteral("0%/100%:100%x100%");
start = QStringLiteral("0% 100% 100% 100%");
break;
case UP:
start = QStringLiteral("0%/-100%:100%x100%");
start = QStringLiteral("0% -100% 100% 100%");
break;
default:
start = QStringLiteral("0%/0%:100%x100%");
start = QStringLiteral("0% 0% 100% 100%");
break;
}
start.append(':' + QString::number(info.startTransparency));
start.append(QString(" %1%").arg(info.startTransparency));
switch (info.end) {
case LEFT:
end = QStringLiteral("-100%/0%:100%x100%");
end = QStringLiteral("-100% 0% 100% 100%");
break;
case RIGHT:
end = QStringLiteral("100%/0%:100%x100%");
end = QStringLiteral("100% 0% 100% 100%");
break;
case DOWN:
end = QStringLiteral("0%/100%:100%x100%");
end = QStringLiteral("0% 100% 100% 100%");
break;
case UP:
end = QStringLiteral("0%/-100%:100%x100%");
end = QStringLiteral("0% -100% 100% 100%");
break;
default:
end = QStringLiteral("0%/0%:100%x100%");
end = QStringLiteral("0% 0% 100% 100%");
break;
}
end.append(':' + QString::number(info.endTransparency));
return QString(start + QStringLiteral(";-1=") + end);
end.append(QString(" %1%").arg(info.endTransparency));
return QString("0=%1;-1=%2").arg(start).arg(end);
}
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