MCPcopy Create free account
hub / github.com/KDE/kdenlive / importEffects

Method importEffects

src/effects/effectstack/model/effectstackmodel.cpp:1448–1488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1446}
1447
1448bool EffectStackModel::importEffects(const std::shared_ptr<EffectStackModel> &sourceStack, PlaylistState::ClipState state)
1449{
1450 QWriteLocker locker(&m_lock);
1451 // TODO: manage fades, keyframes if clips don't have same size / in point
1452 bool found = false;
1453 bool effectEnabled = rootItem->childCount() > 0;
1454 int imported = 0;
1455 int builtIn = 0;
1456 for (int i = 0; i < sourceStack->rowCount(); i++) {
1457 auto item = sourceStack->getEffectStackRow(i);
1458 // No undo. this should only be used on project opening
1459 if (copyEffect(item, state, false)) {
1460 found = true;
1461 if (item->isAssetEnabled()) {
1462 effectEnabled = true;
1463 } else {
1464 std::shared_ptr<EffectItemModel> sourceEffect = std::static_pointer_cast<EffectItemModel>(item);
1465 if (sourceEffect->isBuiltIn()) {
1466 builtIn++;
1467 }
1468 }
1469 imported++;
1470 }
1471 }
1472 if (!effectEnabled && imported == builtIn) {
1473 effectEnabled = true;
1474 }
1475 m_effectStackEnabled = effectEnabled;
1476 if (!m_effectStackEnabled) {
1477 // Mark all effects as disabled by stack
1478 for (int i = 0; i < rootItem->childCount(); ++i) {
1479 std::shared_ptr<EffectItemModel> sourceEffect = std::static_pointer_cast<EffectItemModel>(rootItem->child(i));
1480 sourceEffect->setEffectStackEnabled(false);
1481 sourceEffect->setAssetEnabled(true);
1482 }
1483 }
1484 if (found) {
1485 Q_EMIT modelChanged();
1486 }
1487 return found;
1488}
1489
1490void EffectStackModel::importEffects(const std::weak_ptr<Mlt::Service> &service, PlaylistState::ClipState state, bool alreadyExist,
1491 const QString &originalDecimalPoint, const QUuid &uuid)

Callers

nothing calls this directly

Calls 15

childCountMethod · 0.80
getEffectStackRowMethod · 0.80
isAssetEnabledMethod · 0.80
childMethod · 0.80
setAssetEnabledMethod · 0.80
lockMethod · 0.80
get_intMethod · 0.80
insertMethod · 0.80
slotInitSubtitleMethod · 0.80
getEffectMethod · 0.80
prepareKeyframesMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected