for (int j = 0; j < params.count(); j++) {
bool modified = false;
QDomElement e = params.item(j).toElement();
- if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe")) {
+ if (e.isNull())
+ continue;
+ if (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe") {
// parse keyframes and adjust values
const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
QMap <int, double> kfr;
}
e.setAttribute("keyframes", newkfr);
}
+ } else if (e.attribute("type") == "geometry" && !e.hasAttribute("fixed")) {
+ char *tmp = (char *) qstrdup(e.attribute("value").toUtf8().data());
+ Mlt::Geometry geometry(tmp, cropDuration().frames(fps()));
+ delete[] tmp;
+
+ Mlt::GeometryItem item;
+ while (!geometry.next_key(&item, cropDuration().frames(fps()))) {
+ geometry.remove(item.frame());
+ modified = true;
+ }
+
+ e.setAttribute("value", geometry.serialise());
}
}
}
new MoveTransitionCommand(this, trInfo, newTrInfo, true, command);
}
+ /*
+ TODO: cleanup the effect update process
+ */
ClipItem *clip = static_cast < ClipItem * >(item);
updatePositionEffects(clip, oldInfo);
}
}
+ int panZoomPos = clip->hasEffect("affine", "pan_zoom");
+ if (panZoomPos != -1) {
+ doc.appendChild(doc.importNode(clip->effectAt(panZoomPos), true));
+ indexes.append(panZoomPos);
+ }
+
if (clip->checkEffectsKeyframesPos(oldInfo.cropStart.frames(m_document->fps()), clip->cropStart().frames(m_document->fps()), true)) {
// Keyframes were modified, updateClip
QDomNodeList effs = doc.elementsByTagName("effect");
}
oldeffect.setAttribute("in", start);
oldeffect.setAttribute("out", max);
+
if (!m_document->renderer()->mltEditEffect(m_document->tracksCount() - item->track(), item->startPos(), getEffectArgs(oldeffect)))
emit displayMessage(i18n("Problem editing effect"), ErrorMessage);
// if effect is displayed, update the effect edit widget with new clip duration
m_geometry = new Mlt::Geometry(tmp, maxframe - minframe, m_monitor->render->renderWidth(), m_monitor->render->renderHeight());
delete[] tmp;
- // remove keyframes out of range
- Mlt::GeometryItem invalidItem;
- bool foundInvalidItem = false;
- while (!m_geometry->next_key(&invalidItem, maxframe - minframe)) {
- foundInvalidItem = true;
- m_geometry->remove(invalidItem.frame());
- }
-
if (elem.attribute("fixed") == "1") {
// Keyframes are disabled
m_ui.widgetTimeWrapper->setHidden(true);
slotPositionChanged(0, false);
slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
-
- // update if we had to remove a keyframe which got out of range
- if (foundInvalidItem)
- QTimer::singleShot(300, this, SIGNAL(parameterChanged()));
}
void GeometryWidget::slotSyncPosition(int relTimelinePos)
void GeometryWidget::slotPositionChanged(int pos, bool seek)
{
- if (pos == -1) {
+ if (pos == -1)
pos = m_timePos->getValue();
- m_timeline->blockSignals(true);
- m_timeline->setValue(pos);
- m_timeline->blockSignals(false);
- } else {
+ else
m_timePos->setValue(pos);
- }
+
+ m_timeline->blockSignals(true);
+ m_timeline->setValue(pos);
+ m_timeline->blockSignals(false);
Mlt::GeometryItem item;
if (m_geometry->fetch(&item, pos) || item.key() == false) {