Improve some effect focus cases, fix compile warning

parent 2bcd6e07
Pipeline #15677 passed with stage
in 14 minutes and 1 second
......@@ -205,20 +205,6 @@ bool KeyframeModelList::updateKeyframe(GenTime pos, const QVariant &value, const
pCore->pushUndo(command);
}
return true;
QWriteLocker locker(&m_lock);
Q_ASSERT(m_parameters.count(index) > 0);
Fun undo = []() { return true; };
Fun redo = []() { return true; };
if (singleKeyframe()) {
bool ok = false;
Keyframe kf = m_parameters.begin()->second->getNextKeyframe(GenTime(-1), &ok);
pos = kf.first;
}
bool res = m_parameters.at(index)->updateKeyframe(pos, value, undo, redo);
if (res) {
PUSH_UNDO(undo, redo, i18n("Update keyframe"));
}
return res;
}
bool KeyframeModelList::updateKeyframeType(GenTime pos, int type, const QPersistentModelIndex &index)
......
......@@ -106,6 +106,7 @@ void KeyframeView::slotAddRemove()
} else {
slotAddKeyframe(m_position);
}
emit activateEffect();
}
void KeyframeView::slotEditType(int type, const QPersistentModelIndex &index)
......@@ -149,6 +150,7 @@ void KeyframeView::slotGoToNext()
// no keyframe after current position
emit seekToPos(m_duration - 1);
}
emit activateEffect();
}
void KeyframeView::slotGoToPrev()
......@@ -167,6 +169,7 @@ void KeyframeView::slotGoToPrev()
// no keyframe after current position
emit seekToPos(m_duration - 1);
}
emit activateEffect();
}
void KeyframeView::mousePressEvent(QMouseEvent *event)
......
......@@ -207,6 +207,7 @@ void KeyframeWidget::slotEditKeyframeType(QAction *action)
{
int type = action->data().toInt();
m_keyframeview->slotEditType(type, m_index);
activateEffect();
}
void KeyframeWidget::slotRefreshParams()
......@@ -354,7 +355,9 @@ void KeyframeWidget::addParameter(const QPersistentModelIndex &index)
GeometryWidget *geomWidget = new GeometryWidget(pCore->getMonitor(m_model->monitorId), range, rect, opacity, m_sourceFrameSize, false,
m_model->data(m_index, AssetParameterModel::OpacityRole).toBool(), integerOpacity, this);
connect(geomWidget, &GeometryWidget::valueChanged,
[this, index](const QString v) { m_keyframes->updateKeyframe(GenTime(getPosition(), pCore->getCurrentFps()), QVariant(v), index); });
[this, index](const QString v) {
activateEffect();
m_keyframes->updateKeyframe(GenTime(getPosition(), pCore->getCurrentFps()), QVariant(v), index); });
paramWidget = geomWidget;
} else if (type == ParamType::Roto_spline) {
m_monitorHelper = new RotoHelper(pCore->getMonitor(m_model->monitorId), m_model, index, this);
......@@ -386,7 +389,10 @@ void KeyframeWidget::addParameter(const QPersistentModelIndex &index)
factor = qFuzzyIsNull(factor) ? 1 : factor;
auto doubleWidget = new DoubleWidget(name, value, min, max, factor, defaultValue, comment, -1, suffix, decimals, m_model->data(index, AssetParameterModel::OddRole).toBool(), this);
connect(doubleWidget, &DoubleWidget::valueChanged,
[this, index](double v) { m_keyframes->updateKeyframe(GenTime(getPosition(), pCore->getCurrentFps()), QVariant(v), index); });
[this, index](double v) {
activateEffect();
m_keyframes->updateKeyframe(GenTime(getPosition(), pCore->getCurrentFps()), QVariant(v), index);
});
paramWidget = doubleWidget;
}
if (paramWidget) {
......@@ -430,6 +436,7 @@ void KeyframeWidget::connectMonitor(bool active)
void KeyframeWidget::slotUpdateKeyframesFromMonitor(const QPersistentModelIndex &index, const QVariant &res)
{
activateEffect();
if (m_keyframes->isEmpty()) {
GenTime pos(pCore->getItemIn(m_model->getOwnerId()) + m_time->getValue(), pCore->getCurrentFps());
if (m_time->getValue() > 0) {
......
......@@ -398,6 +398,7 @@ void CollapsibleEffectView::slotDisable(bool disable)
QString effectId = m_model->getAssetId();
QString effectName = EffectsRepository::get()->getName(effectId);
std::static_pointer_cast<AbstractEffectItem>(m_model)->markEnabled(effectName, !disable);
emit activateEffect(m_model);
}
void CollapsibleEffectView::slotDeleteEffect()
......@@ -727,7 +728,6 @@ void CollapsibleEffectView::dropEvent(QDropEvent *event)
if (event->source()->objectName() == QStringLiteral("ParameterContainer")) {
return;
}
// emit activateEffect(effectIndex());
QString itemData = event->mimeData()->data(QStringLiteral("kdenlive/geometry"));
importKeyframes(itemData);
return;
......
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