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

Method getFadePosition

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

Source from the content-addressed store, hash-verified

1219}
1220
1221int EffectStackModel::getFadePosition(bool fromStart)
1222{
1223 QWriteLocker locker(&m_lock);
1224 if (fromStart) {
1225 if (m_fadeIns.empty()) {
1226 return 0;
1227 }
1228 for (int i = 0; i < rootItem->childCount(); ++i) {
1229 if (*(m_fadeIns.begin()) == std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) {
1230 std::shared_ptr<EffectItemModel> effect = std::static_pointer_cast<EffectItemModel>(rootItem->child(i));
1231 return effect->filter().get_length() - 1;
1232 }
1233 }
1234 } else {
1235 if (m_fadeOuts.empty()) {
1236 return 0;
1237 }
1238 for (int i = 0; i < rootItem->childCount(); ++i) {
1239 if (*(m_fadeOuts.begin()) == std::static_pointer_cast<TreeItem>(rootItem->child(i))->getId()) {
1240 std::shared_ptr<EffectItemModel> effect = std::static_pointer_cast<EffectItemModel>(rootItem->child(i));
1241 return effect->filter().get_length() - 1;
1242 }
1243 }
1244 }
1245 return 0;
1246}
1247
1248bool EffectStackModel::removeFade(bool fromStart)
1249{

Callers 2

fadeInMethod · 0.80
fadeOutMethod · 0.80

Calls 6

childCountMethod · 0.80
childMethod · 0.80
emptyMethod · 0.45
beginMethod · 0.45
getIdMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected