MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / SetParentEffect

Method SetParentEffect

src/EffectBase.cpp:561–583  ·  view source on GitHub ↗

Set the parent effect from which this properties will be set to

Source from the content-addressed store, hash-verified

559
560// Set the parent effect from which this properties will be set to
561void EffectBase::SetParentEffect(std::string parentEffect_id) {
562
563 // Get parent Timeline
564 Timeline* parentTimeline = static_cast<Timeline *>(ParentTimeline());
565
566 if (parentTimeline){
567
568 // Get a pointer to the parentEffect
569 EffectBase* parentEffectPtr = parentTimeline->GetClipEffect(parentEffect_id);
570
571 if (parentEffectPtr){
572 // Set the parent Effect
573 parentEffect = parentEffectPtr;
574
575 // Set the properties of this effect with the parent effect's properties
576 Json::Value EffectJSON = parentEffect->JsonValue();
577 EffectJSON["id"] = this->Id();
578 EffectJSON["parent_effect_id"] = this->info.parent_effect_id;
579 this->SetJsonValue(EffectJSON);
580 }
581 }
582 return;
583}
584
585// Return the ID of this effect's parent clip
586std::string EffectBase::ParentClipId() const{

Callers

nothing calls this directly

Calls 4

SetJsonValueMethod · 0.95
GetClipEffectMethod · 0.80
JsonValueMethod · 0.45
IdMethod · 0.45

Tested by

no test coverage detected