| 78 | } |
| 79 | |
| 80 | bool 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 | |
| 105 | void MacroConditionTimer::Pause() |
| 106 | { |
nothing calls this directly
no test coverage detected