MCPcopy Create free account
hub / github.com/christophhart/HISE / prePresetLoad

Method prePresetLoad

hi_scripting/scripting/api/ScriptExpansion.cpp:893–913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

891}
892
893juce::ValueTree ScriptUserPresetHandler::prePresetLoad(const ValueTree& dataToLoad, const File& fileToLoad)
894{
895 currentlyLoadedFile = fileToLoad;
896
897 if (preCallback)
898 {
899 var args;
900
901 if (enablePreprocessing)
902 args = convertToJson(dataToLoad);
903 else
904 args = var(new ScriptingObjects::ScriptFile(getScriptProcessor(), fileToLoad));
905
906 auto r = preCallback.callSync(&args, 1, nullptr);
907
908 if (enablePreprocessing)
909 return applyJSON(dataToLoad, args.getDynamicObject());
910 }
911
912 return dataToLoad;
913}
914
915void ScriptUserPresetHandler::presetChanged(const File& newPreset)
916{

Callers

nothing calls this directly

Calls 3

varFunction · 0.85
callSyncMethod · 0.45
getDynamicObjectMethod · 0.45

Tested by

no test coverage detected