return m_selectedEffect;
}
-void ClipItem::initEffect(QDomElement effect)
+void ClipItem::initEffect(QDomElement effect, int diff)
{
// the kdenlive_ix int is used to identify an effect in mlt's playlist, should
// not be changed
if (effect.attribute("kdenlive_ix").toInt() == 0)
effect.setAttribute("kdenlive_ix", QString::number(effectsCounter()));
- // init keyframes if required
+
+ if (effect.attribute("id") == "freeze" && diff > 0) {
+ EffectsList::setParameter(effect, "frame", QString::number(diff));
+ }
+
+ // Init parameter value & keyframes if required
QDomNodeList params = effect.elementsByTagName("parameter");
for (int i = 0; i < params.count(); i++) {
QDomElement e = params.item(i).toElement();
void updateKeyframeEffect();
QDomElement selectedEffect();
int selectedEffectIndex() const;
- void initEffect(QDomElement effect);
+ void initEffect(QDomElement effect, int diff = 0);
QString keyframes(const int index);
void setKeyframes(const int ix, const QString keyframes);
void setEffectList(const EffectsList effectList);
if (item->isItemLocked()) {
continue;
}
- item->initEffect(effect);
+ if (effect.attribute("id") == "freeze" && m_cursorPos > item->startPos().frames(m_document->fps()) && m_cursorPos < item->endPos().frames(m_document->fps())) {
+ item->initEffect(effect, m_cursorPos - item->startPos().frames(m_document->fps()));
+ } else item->initEffect(effect);
if (effect.attribute("tag") == "ladspa") {
QString ladpsaFile = m_document->getLadspaFile();
initEffects::ladspaEffectFile(ladpsaFile, effect.attribute("ladspaid").toInt(), getLadspaParams(effect));
if (item->isSelected() && effectPos == item->selectedEffectIndex()) emit clipItemSelected(item, effectPos);
}
}
+ if (item->isSelected() && item->selectedEffect().attribute("id") == "freeze") emit clipItemSelected(item, item->selectedEffectIndex());
}
double CustomTrackView::getSnapPointForPos(double pos)