aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Baptiste Mardelle <[email protected]>2016-07-18 23:32:39 +0200
committerJean-Baptiste Mardelle <[email protected]>2016-07-18 23:32:39 +0200
commitbee8ff2a472164b129a1c2224496d69c8ef3c25b (patch)
tree2880f15d23660b3c2ff0bde24e5974030936e744
parent2e892304e8d36151561799f42118b511cf4bb208 (diff)
some fixes for animated effects in tracks
-rw-r--r--data/kdenliveeffectscategory.rc2
-rw-r--r--src/effectstack/parametercontainer.cpp2
-rw-r--r--src/timeline/headertrack.cpp5
-rw-r--r--src/timeline/timeline.cpp20
4 files changed, 16 insertions, 13 deletions
diff --git a/data/kdenliveeffectscategory.rc b/data/kdenliveeffectscategory.rc
index 352bc3b..c645229 100644
--- a/data/kdenliveeffectscategory.rc
+++ b/data/kdenliveeffectscategory.rc
@@ -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">
diff --git a/src/effectstack/parametercontainer.cpp b/src/effectstack/parametercontainer.cpp
index c3ec0b2..5654a0f 100644
--- a/src/effectstack/parametercontainer.cpp
+++ b/src/effectstack/parametercontainer.cpp
@@ -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;
}
diff --git a/src/timeline/headertrack.cpp b/src/timeline/headertrack.cpp
index b776393..c506fda 100644
--- a/src/timeline/headertrack.cpp
+++ b/src/timeline/headertrack.cpp
@@ -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
diff --git a/src/timeline/timeline.cpp b/src/timeline/timeline.cpp
index 19effe5..ae20692 100644
--- a/src/timeline/timeline.cpp
+++ b/src/timeline/timeline.cpp
@@ -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()) {