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

Method Save

lib/macro/macro-action-variable.cpp:527–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525}
526
527bool MacroActionVariable::Save(obs_data_t *obj) const
528{
529 MacroAction::Save(obj);
530 obs_data_set_string(obj, "variableName",
531 GetWeakVariableName(_variable).c_str());
532 obs_data_set_string(obj, "variable2Name",
533 GetWeakVariableName(_variable2).c_str());
534 _strValue.Save(obj, "strValue");
535 _numValue.Save(obj, "numValue");
536 obs_data_set_int(obj, "condition", static_cast<int>(_action));
537 obs_data_set_int(obj, "segmentIdx", GetSegmentIndexValue());
538 _subStringStart.Save(obj, "subStringStart");
539 _subStringSize.Save(obj, "subStringSize");
540 obs_data_set_string(obj, "regexPattern", _regexPattern.c_str());
541 _regexMatchIdx.Save(obj, "regexMatchIdx");
542 _findRegex.Save(obj, "findRegex");
543 _findStr.Save(obj, "findStr");
544 _replaceStr.Save(obj, "replaceStr");
545 _subStringRegex.Save(obj);
546 _mathExpression.Save(obj, "mathExpression");
547 obs_data_set_bool(obj, "useCustomPrompt", _useCustomPrompt);
548 _inputPrompt.Save(obj, "inputPrompt");
549 obs_data_set_bool(obj, "useInputPlaceholder", _useInputPlaceholder);
550 _inputPlaceholder.Save(obj, "inputPlaceholder");
551 _envVariableName.Save(obj, "environmentVariableName");
552 _scene.Save(obj);
553 _tempVar.Save(obj, GetMacro());
554 _sceneItemIndex.Save(obj, "sceneItemIndex");
555 obs_data_set_int(obj, "direction", static_cast<int>(_direction));
556 _stringLength.Save(obj, "stringLength");
557 obs_data_set_int(obj, "paddingChar", _paddingChar);
558 obs_data_set_int(obj, "caseType", static_cast<int>(_caseType));
559 _randomNumberStart.Save(obj, "randomNumberStart");
560 _randomNumberEnd.Save(obj, "randomNumberEnd");
561 obs_data_set_bool(obj, "generateInteger", _generateInteger);
562 _randomValues.Save(obj, "randomValues", "value");
563 obs_data_set_bool(obj, "allowRepeatValues", _allowRepeatValues);
564 _jsonQuery.Save(obj, "jsonQuery");
565 _jsonIndex.Save(obj, "jsonIndex");
566 obs_data_set_bool(obj, "jsonQueryExtractSingle",
567 _jsonQueryExtractSingle);
568
569 obs_data_set_int(obj, "version", 1);
570
571 return true;
572}
573
574bool MacroActionVariable::Load(obs_data_t *obj)
575{

Callers

nothing calls this directly

Calls 3

GetWeakVariableNameFunction · 0.85
GetMacroFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected