MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / SetUpFromSaveData

Method SetUpFromSaveData

Source/ScriptModule.cpp:1483–1516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1481}
1482
1483void ScriptModule::SetUpFromSaveData()
1484{
1485 if (mModuleSaveData.GetBool("execute_on_init"))
1486 {
1487 mInitExecutePriority = mModuleSaveData.GetInt("init_execute_priority");
1488 sScriptsRequestingInitExecution.insert(std::lower_bound(sScriptsRequestingInitExecution.begin(),
1489 sScriptsRequestingInitExecution.end(),
1490 this,
1491 [](const ScriptModule* left, const ScriptModule* right)
1492 {
1493 return left->mInitExecutePriority < right->mInitExecutePriority;
1494 }),
1495 this);
1496 }
1497
1498 mCodeEntry->SetDoSyntaxHighlighting(mModuleSaveData.GetBool("syntax_highlighting"));
1499
1500 std::string styleName = mModuleSaveData.GetString("style");
1501 for (auto i = 0; i < sStyleJSON.size(); ++i)
1502 {
1503 try
1504 {
1505 if (sStyleJSON[i]["name"].asString() == styleName)
1506 mCodeEntry->SetStyleFromJSON(sStyleJSON[i]);
1507 }
1508 catch (Json::LogicError& e)
1509 {
1510 TheSynth->LogEvent(__PRETTY_FUNCTION__ + std::string(" json error: ") + e.what(), kLogEventType_Error);
1511 }
1512 }
1513
1514 mHotloadScripts = mModuleSaveData.GetBool("hotload_script_files");
1515 mDrawBoundModuleConnections = mModuleSaveData.GetBool("draw_bound_module_connections");
1516}
1517
1518void ScriptModule::SaveLayout(ofxJSONElement& moduleInfo)
1519{

Callers

nothing calls this directly

Calls 7

GetBoolMethod · 0.80
GetIntMethod · 0.80
GetStringMethod · 0.80
sizeMethod · 0.80
SetStyleFromJSONMethod · 0.80
LogEventMethod · 0.80

Tested by

no test coverage detected