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

Method setEffectStackEnabled

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

Source from the content-addressed store, hash-verified

1407}
1408
1409void EffectStackModel::setEffectStackEnabled(bool enabled)
1410{
1411 QWriteLocker locker(&m_lock);
1412 m_effectStackEnabled = enabled;
1413
1414 QList<QModelIndex> indexes;
1415 bool hasVideo = false;
1416 bool hasAudio = false;
1417 // Recursively updates children states
1418 for (int i = 0; i < rootItem->childCount(); ++i) {
1419 std::shared_ptr<AbstractEffectItem> item = std::static_pointer_cast<AbstractEffectItem>(rootItem->child(i));
1420 item->setEffectStackEnabled(enabled);
1421 indexes << getIndexFromItem(item);
1422 if (!hasVideo && !item->isAudio()) {
1423 hasVideo = true;
1424 }
1425 if (!hasAudio && item->isAudio()) {
1426 hasAudio = true;
1427 }
1428 }
1429 if (indexes.isEmpty()) {
1430 return;
1431 }
1432 if (hasVideo) {
1433 pCore->refreshProjectItem(m_ownerId);
1434 pCore->invalidateItem(m_ownerId);
1435 }
1436 if (hasAudio) {
1437 pCore->invalidateAudio(m_ownerId);
1438 }
1439 Q_EMIT dataChanged(indexes.first(), indexes.last(), {TimelineModel::EffectsEnabledRole});
1440 Q_EMIT enabledStateChanged();
1441}
1442
1443std::shared_ptr<AbstractEffectItem> EffectStackModel::getEffectStackRow(int row, const std::shared_ptr<TreeItem> &parentItem)
1444{

Callers 2

registerItemMethod · 0.45
importEffectsMethod · 0.45

Calls 7

childCountMethod · 0.80
childMethod · 0.80
refreshProjectItemMethod · 0.80
invalidateAudioMethod · 0.80
isAudioMethod · 0.45
isEmptyMethod · 0.45
invalidateItemMethod · 0.45

Tested by

no test coverage detected