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

Method save

hi_scripting/scripting/scriptnode/ui/DspNetworkComponents.cpp:1800–1823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1798
1799
1800bool DspNetworkGraph::Actions::save(DspNetworkGraph& g)
1801{
1802#if USE_BACKEND
1803 auto saveCopy = g.network->getValueTree().createCopy();
1804
1805 DspNetworkListeners::PatchAutosaver::removeDanglingConnections(saveCopy);
1806
1807 valuetree::Helpers::forEach(saveCopy, DspNetworkListeners::PatchAutosaver::stripValueTree);
1808
1809 auto xml = saveCopy.createXml();
1810
1811 auto folder = BackendDllManager::getSubFolder(g.network->getScriptProcessor()->getMainController_(), BackendDllManager::FolderSubType::Networks);
1812
1813 auto d = folder.getChildFile(g.network->getId()).withFileExtension("xml");
1814
1815 if(!d.existsAsFile() || PresetHandler::showYesNoWindow("Overwrite file", "Do you want to overwrite the file " + d.getFullPathName()))
1816 {
1817 d.replaceWithText(xml->createDocument(""));
1818 }
1819
1820#endif
1821
1822 return true;
1823}
1824
1825
1826

Callers 1

saveCurrentSampleMapMethod · 0.45

Calls 12

getMainController_Method · 0.80
replaceWithTextMethod · 0.80
createDocumentMethod · 0.80
forEachFunction · 0.50
createCopyMethod · 0.45
getValueTreeMethod · 0.45
createXmlMethod · 0.45
getScriptProcessorMethod · 0.45
withFileExtensionMethod · 0.45
getChildFileMethod · 0.45
getIdMethod · 0.45
existsAsFileMethod · 0.45

Tested by

no test coverage detected