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

Fix master effect zones hidden.

Related to #990
parent 77830ba0
......@@ -371,9 +371,7 @@ bool EffectStackModel::fromXml(const QDomElement &effectsXml, Fun &undo, Fun &re
effect->prepareKeyframes();
connect(effect.get(), &AssetParameterModel::modelChanged, this, &EffectStackModel::modelChanged);
connect(effect.get(), &AssetParameterModel::replugEffect, this, &EffectStackModel::replugEffect, Qt::DirectConnection);
connect(effect.get(), &AssetParameterModel::showEffectZone, this, [=]() {
emit dataChanged(QModelIndex(), QModelIndex(), {TimelineModel::EffectZonesRole});
});
connect(effect.get(), &AssetParameterModel::showEffectZone, this, &EffectStackModel::updateEffectZones);
if (effectId == QLatin1String("fadein") || effectId == QLatin1String("fade_from_black")) {
m_fadeIns.insert(effect->getId());
int duration = effect->filter().get_length() - 1;
......@@ -438,9 +436,7 @@ bool EffectStackModel::copyEffect(const std::shared_ptr<AbstractEffectItem> &sou
effect->prepareKeyframes();
connect(effect.get(), &AssetParameterModel::modelChanged, this, &EffectStackModel::modelChanged);
connect(effect.get(), &AssetParameterModel::replugEffect, this, &EffectStackModel::replugEffect, Qt::DirectConnection);
connect(effect.get(), &AssetParameterModel::showEffectZone, this, [=]() {
emit dataChanged(QModelIndex(), QModelIndex(), {TimelineModel::EffectZonesRole});
});
connect(effect.get(), &AssetParameterModel::showEffectZone, this, &EffectStackModel::updateEffectZones);
QVector<int> roles = {TimelineModel::EffectNamesRole};
if (effectId == QLatin1String("fadein") || effectId == QLatin1String("fade_from_black")) {
m_fadeIns.insert(effect->getId());
......@@ -503,9 +499,7 @@ bool EffectStackModel::appendEffect(const QString &effectId, bool makeCurrent)
effect->prepareKeyframes();
connect(effect.get(), &AssetParameterModel::modelChanged, this, &EffectStackModel::modelChanged);
connect(effect.get(), &AssetParameterModel::replugEffect, this, &EffectStackModel::replugEffect, Qt::DirectConnection);
connect(effect.get(), &AssetParameterModel::showEffectZone, this, [=]() {
emit dataChanged(QModelIndex(), QModelIndex(), {TimelineModel::EffectZonesRole});
});
connect(effect.get(), &AssetParameterModel::showEffectZone, this, &EffectStackModel::updateEffectZones);
int currentActive = getActiveEffect();
if (makeCurrent) {
setActiveEffect(rowCount());
......@@ -1024,12 +1018,7 @@ void EffectStackModel::importEffects(const std::weak_ptr<Mlt::Service> &service,
imported++;
connect(effect.get(), &AssetParameterModel::modelChanged, this, &EffectStackModel::modelChanged);
connect(effect.get(), &AssetParameterModel::replugEffect, this, &EffectStackModel::replugEffect, Qt::DirectConnection);
connect(effect.get(), &AssetParameterModel::showEffectZone, this, [=]() {
emit dataChanged(QModelIndex(), QModelIndex(), {TimelineModel::EffectZonesRole});
if (m_ownerId.first == ObjectType::Master) {
emit updateMasterZones();
}
});
connect(effect.get(), &AssetParameterModel::showEffectZone, this, &EffectStackModel::updateEffectZones);
Fun redo = addItem_lambda(effect, rootItem->getId());
effect->prepareKeyframes();
if (redo()) {
......@@ -1408,3 +1397,11 @@ QVariantList EffectStackModel::getEffectZones() const
}
return effectZones;
}
void EffectStackModel::updateEffectZones()
{
emit dataChanged(QModelIndex(), QModelIndex(), {TimelineModel::EffectZonesRole});
if (m_ownerId.first == ObjectType::Master) {
emit updateMasterZones();
}
}
......@@ -182,6 +182,9 @@ private slots:
/** @brief: Some effects do not support dynamic changes like sox, and need to be unplugged / replugged on each param change
*/
void replugEffect(const std::shared_ptr<AssetParameterModel> &asset);
/** @brief: Some effect zones changed, ensure to update master effect zones
*/
void updateEffectZones();
signals:
/** @brief: This signal is connected to the project clip for bin clips and activates the reload of effects on child (timeline) producers
......
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