MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / loadTemplate

Function loadTemplate

src/CardinalCommon.cpp:1049–1077  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1047}
1048
1049void loadTemplate(const bool factory)
1050{
1051 try {
1052 APP->patch->load(factory ? APP->patch->factoryTemplatePath : APP->patch->templatePath);
1053 }
1054 catch (Exception& e) {
1055 // if user template failed, try the factory one
1056 if (!factory)
1057 return loadTemplate(true);
1058
1059 const std::string message = string::f("Could not load template patch, clearing rack: %s", e.what());
1060 asyncDialog::create(message.c_str());
1061
1062 APP->patch->clear();
1063 APP->patch->clearAutosave();
1064 }
1065
1066 // load() sets the patch's original patch, but we don't want to use that.
1067 APP->patch->path.clear();
1068 APP->history->setSaved();
1069
1070 #ifdef DISTRHO_OS_WASM
1071 syncfs();
1072 #endif
1073
1074 if (remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote())
1075 if (remoteDetails->autoDeploy)
1076 remoteUtils::sendFullPatchToRemote(remoteDetails);
1077}
1078
1079
1080void loadTemplateDialog(const bool factory)

Callers 1

loadTemplateDialogFunction · 0.70

Calls 8

fFunction · 0.85
createFunction · 0.85
c_strMethod · 0.80
syncfsFunction · 0.70
getRemoteFunction · 0.70
sendFullPatchToRemoteFunction · 0.70
loadMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected