some fixes for animated effects in tracks

parent 2e892304
......@@ -7,7 +7,7 @@
<group list="invert,sepia,tcolor,greyscale,frei0r.B,frei0r.G,frei0r.R,frei0r.contrast0r,frei0r.saturat0r,frei0r.tint0r,frei0r.primaries,chroma_hold,frei0r.colorize,frei0r.equaliz0r,frei0r.hueshift0r,frei0r.luminance,lumaliftgaingamma">
<text>Colour</text>
</group>
<group list="frei0r.letterb0xed,pan_zoom,frei0r.scale0tilt,crop,affine,affinerotate,frei0r.nosync0r">
<group list="frei0r.letterb0xed,pan_zoom,frei0r.scale0tilt,crop,affine,affinerotate,frei0r.nosync0r,qtblend">
<text>Crop and transform</text>
</group>
<group list="volume,normalise,gain,ladspa.1049,ladspa.1048,ladspa.1413,mute">
......
......@@ -972,7 +972,7 @@ void ParameterContainer::slotCollectAllParameters()
paramName.append("keyframe");
else if (type == QLatin1String("animated"))
continue;
if (type != QLatin1String("simplekeyframe") && type != QLatin1String("fixed") && type != QLatin1String("addedgeometry") && !m_valueItems.contains(paramName)) {
if (type != QLatin1String("animatedrect") && type != QLatin1String("simplekeyframe") && type != QLatin1String("fixed") && type != QLatin1String("addedgeometry") && !m_valueItems.contains(paramName)) {
qDebug() << "// Param: " << paramName << " NOT FOUND";
continue;
}
......
......@@ -210,11 +210,6 @@ void HeaderTrack::dropEvent(QDropEvent * event)
}
emit selectTrack(m_parentTrack->index());
emit addTrackEffect(e, m_parentTrack->index());
/*if (scene() && !scene()->views().isEmpty()) {
event->accept();
CustomTrackView *view = (CustomTrackView *) scene()->views()[0];
if (view) view->slotAddEffect(e, m_info.startPos, track());
}*/
}
//virtual
......
......@@ -1401,17 +1401,25 @@ void Timeline::addTrackEffect(int trackIndex, QDomElement effect, bool addToPlay
QDomNodeList params = effect.elementsByTagName(QStringLiteral("parameter"));
for (int i = 0; i < params.count(); ++i) {
QDomElement e = params.item(i).toElement();
const QString type = e.attribute(QStringLiteral("type"));
// Check if this effect has a variable parameter
if (e.attribute(QStringLiteral("default")).contains('%')) {
double evaluatedValue = EffectsController::getStringEval(m_doc->getProfileInfo(), e.attribute(QStringLiteral("default")));
e.setAttribute(QStringLiteral("default"), evaluatedValue);
if (e.hasAttribute(QStringLiteral("value")) && e.attribute(QStringLiteral("value")).startsWith('%')) {
e.setAttribute(QStringLiteral("value"), evaluatedValue);
if (type == QLatin1String("animatedrect")) {
QString evaluatedValue = EffectsController::getStringRectEval(m_doc->getProfileInfo(), e.attribute(QStringLiteral("default")));
e.setAttribute(QStringLiteral("default"), evaluatedValue);
if (!e.hasAttribute(QStringLiteral("value"))) {
e.setAttribute(QStringLiteral("value"), evaluatedValue);
}
} else {
double evaluatedValue = EffectsController::getStringEval(m_doc->getProfileInfo(), e.attribute(QStringLiteral("default")));
e.setAttribute(QStringLiteral("default"), evaluatedValue);
if (!e.hasAttribute(QStringLiteral("value")) || e.attribute(QStringLiteral("value")).startsWith('%')) {
e.setAttribute(QStringLiteral("value"), evaluatedValue);
}
}
}
if (!e.isNull() && (e.attribute(QStringLiteral("type")) == QLatin1String("keyframe") || e.attribute(QStringLiteral("type")) == QLatin1String("simplekeyframe"))) {
if (!e.isNull() && (type == QLatin1String("keyframe") || type == QLatin1String("simplekeyframe"))) {
QString def = e.attribute(QStringLiteral("default"));
// Effect has a keyframe type parameter, we need to set the values
if (e.attribute(QStringLiteral("keyframes")).isEmpty()) {
......
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