QString factor = e.attribute("factor", "1");
if (factor != "1") {
double fact;
- if (factor.startsWith('%')) {
+ if (factor.contains('%')) {
fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
} else fact = factor.toDouble();
double val = paramValue.toDouble() * fact;
double endvalue = 0;
double fact;
if (factor.isEmpty()) fact = 1;
- else if (factor.startsWith('%')) {
+ else if (factor.contains('%')) {
fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
} else fact = factor.toDouble();
for (QDomNode n3 = effect.firstChild(); !n3.isNull(); n3 = n3.nextSibling()) {
for (int k = 0; k < clipeffectparams.count(); k++) {
e = clipeffectparams.item(k).toElement();
if (!e.isNull() && e.tagName() == "parameter" && e.attribute("name") == paramname) {
+ QString type = e.attribute("type");
QString factor = e.attribute("factor", "1");
double fact;
- if (factor.startsWith('%')) {
+ if (factor.contains('%')) {
fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
} else {
fact = factor.toDouble();
}
- if (e.attribute("type") == "simplekeyframe") {
+ if (type == "simplekeyframe") {
QStringList kfrs = paramvalue.split(";");
for (int l = 0; l < kfrs.count(); l++) {
QString fr = kfrs.at(l).section('=', 0, 0);
kfrs[l] = fr + ":" + QString::number((int)(val * fact));
}
e.setAttribute("keyframes", kfrs.join(";"));
- } else {
+ } else if (type == "double" || type == "constant") {
bool ok;
e.setAttribute("value", paramvalue.toDouble(&ok) * fact);
if (!ok)
e.setAttribute("value", paramvalue);
+ } else {
+ e.setAttribute("value", paramvalue);
}
break;
}
widgets.at(m_doc->tracksCount() - ix - 1)->updateEffectLabel(m_doc->trackInfoAt(ix).effectsList.effectNames());
}
+void TrackView::slotSaveTimelinePreview(const QString path)
+{
+ QImage img(width(), height(), QImage::Format_ARGB32_Premultiplied);
+ img.fill(palette().base().color().rgb());
+ QPainter painter(&img);
+ render(&painter);
+ painter.end();
+ img = img.scaledToWidth(600, Qt::SmoothTransformation);
+ img.save(path);
+}
+
+
#include "trackview.moc"
+
+
+