Load JSON string into this object
| 1243 | |
| 1244 | // Load JSON string into this object |
| 1245 | void Timeline::SetJson(const std::string value) { |
| 1246 | |
| 1247 | // Get lock (prevent getting frames while this happens) |
| 1248 | const std::lock_guard<std::recursive_mutex> lock(getFrameMutex); |
| 1249 | |
| 1250 | // Parse JSON string into JSON objects |
| 1251 | try |
| 1252 | { |
| 1253 | const Json::Value root = openshot::stringToJson(value); |
| 1254 | // Set all values that match |
| 1255 | SetJsonValue(root); |
| 1256 | } |
| 1257 | catch (const std::exception& e) |
| 1258 | { |
| 1259 | // Error parsing JSON (or missing keys) |
| 1260 | throw InvalidJSON("JSON is invalid (missing keys or invalid data types)"); |
| 1261 | } |
| 1262 | } |
| 1263 | |
| 1264 | // Load Json::Value into this object |
| 1265 | void Timeline::SetJsonValue(const Json::Value root) { |
nothing calls this directly
no test coverage detected