Commit f9d31a61 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Don't invalidate timeline/refresh monitor on audio effects

parent 321f45f6
Pipeline #3594 passed with stage
in 14 minutes and 33 seconds
......@@ -43,6 +43,7 @@ AssetParameterModel::AssetParameterModel(std::unique_ptr<Mlt::Properties> asset,
Q_ASSERT(m_asset->is_valid());
QDomNodeList nodeList = assetXml.elementsByTagName(QStringLiteral("parameter"));
m_hideKeyframesByDefault = assetXml.hasAttribute(QStringLiteral("hideKeyframes"));
m_isAudio = assetXml.attribute(QStringLiteral("type")) == QLatin1String("audio");
bool needsLocaleConversion = false;
QChar separator, oldSeparator;
......@@ -187,10 +188,12 @@ void AssetParameterModel::setParameter(const QString &name, int value, bool upda
emit dataChanged(index(0, 0), index(m_rows.count() - 1, 0), {});
// Update fades in timeline
pCore->updateItemModel(m_ownerId, m_assetId);
// Trigger monitor refresh
pCore->refreshProjectItem(m_ownerId);
// Invalidate timeline preview
pCore->invalidateItem(m_ownerId);
if (!m_isAudio) {
// Trigger monitor refresh
pCore->refreshProjectItem(m_ownerId);
// Invalidate timeline preview
pCore->invalidateItem(m_ownerId);
}
}
}
......@@ -279,10 +282,12 @@ void AssetParameterModel::setParameter(const QString &name, const QString &param
} else {
// Update fades in timeline
pCore->updateItemModel(m_ownerId, m_assetId);
// Trigger monitor refresh
pCore->refreshProjectItem(m_ownerId);
// Invalidate timeline preview
pCore->invalidateItem(m_ownerId);
if (!m_isAudio) {
// Trigger monitor refresh
pCore->refreshProjectItem(m_ownerId);
// Invalidate timeline preview
pCore->invalidateItem(m_ownerId);
}
}
}
......
......@@ -210,6 +210,8 @@ protected:
std::shared_ptr<KeyframeModelList> m_keyframes;
// if true, keyframe tools will be hidden by default
bool m_hideKeyframesByDefault;
// true if this is an audio effect, used to prevent unnecessary monitor refresh / timeline invalidate
bool m_isAudio;
/* @brief Set the parameter with given name to the given value. This should be called when first
* building an effect in the constructor, so that we don't call shared_from_this
......
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