MCPcopy Create free account
hub / github.com/VCVRack/Rack / loadAutosave

Method loadAutosave

src/patch.cpp:364–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362
363
364void Manager::loadAutosave() {
365 std::string patchPath = system::join(autosavePath, "patch.json");
366 INFO("Loading autosave %s", patchPath.c_str());
367 FILE* file = std::fopen(patchPath.c_str(), "r");
368 if (!file)
369 throw Exception("Could not open autosave patch %s", patchPath.c_str());
370 DEFER({std::fclose(file);});
371
372 json_error_t error;
373 json_t* rootJ = json_loadf(file, 0, &error);
374 if (!rootJ)
375 throw Exception("Failed to load patch. JSON parsing error at %s %d:%d %s", error.source, error.line, error.column, error.text);
376 DEFER({json_decref(rootJ);});
377
378 checkUnavailableModulesJson(rootJ);
379
380 fromJson(rootJ);
381}
382
383
384void Manager::loadAction(std::string path) {

Callers

nothing calls this directly

Calls 3

ExceptionClass · 0.85
fromJsonFunction · 0.85
joinFunction · 0.70

Tested by

no test coverage detected