| 297 | |
| 298 | |
| 299 | void Manager::load(std::string path) { |
| 300 | INFO("Loading patch %s", path.c_str()); |
| 301 | |
| 302 | clear(); |
| 303 | clearAutosave(); |
| 304 | system::createDirectories(autosavePath); |
| 305 | |
| 306 | if (isPatchLegacyV1(path)) { |
| 307 | // Copy the .vcv file directly to "patch.json". |
| 308 | system::copy(path, system::join(autosavePath, "patch.json")); |
| 309 | } |
| 310 | else { |
| 311 | // Extract the .vcv file as a .tar.zst archive. |
| 312 | double startTime = system::getTime(); |
| 313 | system::unarchiveToDirectory(path, autosavePath); |
| 314 | double endTime = system::getTime(); |
| 315 | INFO("Unarchived patch in %lf seconds", (endTime - startTime)); |
| 316 | } |
| 317 | |
| 318 | loadAutosave(); |
| 319 | } |
| 320 | |
| 321 | |
| 322 | void Manager::loadTemplate() { |
no test coverage detected