MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / Load

Method Load

lib/utils/temp-variable.cpp:347–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347void TempVariableRef::Load(obs_data_t *obj, Macro *macroPtr, const char *name)
348{
349 const auto macros = GetAllMacros();
350 std::weak_ptr<Macro> macro;
351 for (const auto &macroShared : macros) {
352 if (macroShared.get() == macroPtr) {
353 macro = macroShared;
354 break;
355 }
356 }
357
358 if (macro.expired()) {
359 _segment.reset();
360 return;
361 }
362 OBSDataAutoRelease data = obs_data_get_obj(obj, name);
363 int idx = obs_data_get_int(data, "idx");
364 _id = obs_data_get_string(data, "id");
365 const auto type =
366 static_cast<SegmentType>(obs_data_get_int(data, "type"));
367 _depth = obs_data_get_int(data, "depth");
368
369 // Backwards compatibility checks
370 if (obs_data_get_int(data, "version") < 1) {
371 if (_id == "chatter") {
372 _id = "user_login";
373 }
374 }
375
376 AddPostLoadStep([this, idx, type, macro]() {
377 this->PostLoad(idx, type, macro);
378 });
379}
380
381void TempVariableRef::PostLoad(int idx, SegmentType type,
382 const std::weak_ptr<Macro> &weakMacro)

Callers

nothing calls this directly

Calls 5

PostLoadMethod · 0.95
GetAllMacrosFunction · 0.85
AddPostLoadStepFunction · 0.70
getMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected