| 345 | } |
| 346 | |
| 347 | void 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 ¯oShared : 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 | |
| 381 | void TempVariableRef::PostLoad(int idx, SegmentType type, |
| 382 | const std::weak_ptr<Macro> &weakMacro) |
nothing calls this directly
no test coverage detected