| 131 | } |
| 132 | |
| 133 | void MacroScheduleEntry::Save(obs_data_t *obj) const |
| 134 | { |
| 135 | obs_data_set_string(obj, "id", id.c_str()); |
| 136 | obs_data_set_string(obj, "name", name.c_str()); |
| 137 | macro.Save(obj); |
| 138 | obs_data_set_string(obj, "color", color.name().toUtf8().constData()); |
| 139 | obs_data_set_bool(obj, "checkConditions", checkConditions); |
| 140 | obs_data_set_bool(obj, "runElseActionsOnConditionFailure", |
| 141 | runElseActionsOnConditionFailure); |
| 142 | obs_data_set_bool(obj, "enabled", enabled); |
| 143 | |
| 144 | saveDateTime(obj, "startDateTime", startDateTime); |
| 145 | obs_data_set_bool(obj, "hasEndDate", hasEndDate); |
| 146 | if (hasEndDate) { |
| 147 | saveDateTime(obj, "endDate", endDate); |
| 148 | obs_data_set_int(obj, "endDateAction", |
| 149 | static_cast<int>(endDateAction)); |
| 150 | } |
| 151 | |
| 152 | obs_data_set_bool(obj, "doesRepeat", doesRepeat); |
| 153 | repeatInterval.Save(obj, "repeatInterval"); |
| 154 | obs_data_set_int(obj, "repeatEndType", static_cast<int>(repeatEndType)); |
| 155 | obs_data_set_int(obj, "repeatMaxCount", repeatMaxCount); |
| 156 | if (repeatEndType == RepeatEndType::UNTIL_DATE && |
| 157 | repeatUntilDate.isValid()) { |
| 158 | saveDateTime(obj, "repeatUntilDate", repeatUntilDate); |
| 159 | } |
| 160 | |
| 161 | obs_data_set_int(obj, "timesTriggered", timesTriggered); |
| 162 | saveDateTime(obj, "lastTriggered", lastTriggered); |
| 163 | obs_data_set_bool(obj, "endDateActionApplied", endDateActionApplied); |
| 164 | } |
| 165 | |
| 166 | void MacroScheduleEntry::Load(obs_data_t *obj) |
| 167 | { |
no test coverage detected