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

Method Load

plugins/base/macro-condition-timer.cpp:80–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80bool MacroConditionTimer::Load(obs_data_t *obj)
81{
82 MacroCondition::Load(obj);
83 _type = static_cast<TimerType>(obs_data_get_int(obj, "type"));
84 _duration.Load(obj);
85 // TODO: remove this fallback
86 if (obs_data_get_int(obj, "version") == 1) {
87 _duration2.Load(obj, "duration2");
88 } else {
89 _duration2.Load(obj, "seconds2");
90 _duration2.SetUnit(static_cast<Duration::Unit>(
91 obs_data_get_int(obj, "displayUnit2")));
92 }
93 _remaining = obs_data_get_double(obj, "remaining");
94 _paused = obs_data_get_bool(obj, "paused");
95 _saveRemaining = obs_data_get_bool(obj, "saveRemaining");
96 if (!obs_data_has_user_value(obj, "oneshot")) {
97 _oneshot = false;
98 } else {
99 _oneshot = obs_data_get_bool(obj, "oneshot");
100 }
101 _duration.SetTimeRemaining(_remaining);
102 return true;
103}
104
105void MacroConditionTimer::Pause()
106{

Callers

nothing calls this directly

Calls 2

SetUnitMethod · 0.80
SetTimeRemainingMethod · 0.45

Tested by

no test coverage detected