- updatePositionEffects(clip, oldInfo);
-
- // check keyframes
- QDomDocument doc;
- QDomElement root = doc.createElement("list");
- doc.appendChild(root);
- QList <int> indexes;
- for (int i = 0; i < clip->effectsCount(); i++) {
- QDomElement effect = clip->effectAt(i);
- if (EffectsList::hasKeyFrames(effect)) {
- doc.appendChild(doc.importNode(effect, true));
- indexes.append(i);
- }
- }
-
- if (clip->checkEffectsKeyframesPos((oldInfo.cropStart + oldInfo.endPos - oldInfo.startPos).frames(m_document->fps()) - 1, (clip->cropStart() + clip->cropDuration()).frames(m_document->fps()) - 1, false)) {
- // Keyframes were modified, updateClip
- QDomNodeList effs = doc.elementsByTagName("effect");
- // Hack:
- // Since we must always resize clip before updating the keyframes, we
- // put a resize command before & after checking keyframes so that
- // we are sure the resize is performed before whenever we do or undo the action
-
- new ResizeClipCommand(this, oldInfo, info, false, true, command);
- for (int i = 0; i < indexes.count(); i++) {
- new EditEffectCommand(this, m_document->tracksCount() - clip->track(), clip->startPos(), effs.at(i).cloneNode().toElement(), clip->effectAt(indexes.at(i)), indexes.at(i), false, command);
- updateEffect(m_document->tracksCount() - clip->track(), clip->startPos(), clip->effectAt(indexes.at(i)), indexes.at(i));
- }
- new ResizeClipCommand(this, oldInfo, info, false, true, command);
- emit clipItemSelected(clip);
- } else {
- new ResizeClipCommand(this, oldInfo, info, false, false, command);
- }
+ // Hack:
+ // Since we must always resize clip before updating the keyframes, we
+ // put a resize command before & after checking keyframes so that
+ // we are sure the resize is performed before whenever we do or undo the action
+ new ResizeClipCommand(this, oldInfo, info, false, true, command);
+ adjustEffects(clip, oldInfo, command);
+ new ResizeClipCommand(this, oldInfo, info, false, true, command);
+ emit clipItemSelected(clip);