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

Method loadService

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

Source from the content-addressed store, hash-verified

72}
73
74void EffectStackModel::loadService(std::weak_ptr<Mlt::Service> service)
75{
76 // Ensure child stack has the same effects count, otherwise re-sync
77 if (auto ptr = service.lock()) {
78 auto ms = m_masterService.lock();
79 if (ptr->filter_count() != ms->filter_count()) {
80 // Filters mismatch
81 ms->unlock();
82 // Remove all filters from service
83 int ix = ptr->filter_count() - 1;
84 while (ix >= 0) {
85 std::unique_ptr<Mlt::Filter> filt(ptr->filter(ix));
86 if (filt->property_exists("kdenlive_id")) {
87 ptr->detach(*filt.get());
88 }
89 ix--;
90 }
91 ptr->unlock();
92 addService(service);
93 return;
94 }
95 }
96 QWriteLocker locker(&m_lock);
97 m_childServices.emplace_back(std::move(service));
98 for (int i = 0; i < rootItem->childCount(); ++i) {
99 std::static_pointer_cast<EffectItemModel>(rootItem->child(i))->loadClone(m_childServices.back());
100 }
101}
102
103void EffectStackModel::removeService(const std::shared_ptr<Mlt::Service> &service)
104{

Callers 1

Calls 9

lockMethod · 0.80
unlockMethod · 0.80
childCountMethod · 0.80
loadCloneMethod · 0.80
childMethod · 0.80
backMethod · 0.80
filterMethod · 0.45
detachMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected