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

Method createAllNodesOnce

hi_scripting/scripting/scriptnode/api/DspNetwork.cpp:265–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

263}
264
265void DspNetwork::createAllNodesOnce()
266{
267 if (cppgen::CustomNodeProperties::isInitialised())
268 return;
269
270 for (auto f : nodeFactories)
271 {
272 auto isProjectFactory = f->getId() == Identifier("project");
273
274 if (isProjectFactory)
275 continue;
276
277 MainController::ScopedBadBabysitter sb(getScriptProcessor()->getMainController_());
278
279 for (auto id : f->getModuleList())
280 {
281 ScopedPointer<NodeBase::Holder> s = new NodeBase::Holder();
282
283 currentNodeHolder = s;
284 create(id, "unused");
285 exceptionHandler.removeError(nullptr);
286 currentNodeHolder = nullptr;
287
288 s = nullptr;
289 }
290 }
291
292#if USE_BACKEND
293
294 // Now check whether the compiled nodes should be rendered with a template
295 // argument for their voice count
296 auto fileList = BackendDllManager::getNetworkFiles(getScriptProcessor()->getMainController_(), false);
297
298 for(auto f: fileList)
299 {
300 using namespace snex::cppgen;
301
302 if(auto xml = XmlDocument::parse(f))
303 {
304 auto v = ValueTree::fromXml(*xml);
305
306 auto isPoly = ValueTreeIterator::forEach(v, [](ValueTree& v)
307 {
308 if(v.getType() == PropertyIds::Node)
309 {
310 if(CustomNodeProperties::nodeHasProperty(v, PropertyIds::IsPolyphonic))
311 {
312 return true;
313 }
314 }
315
316 return false;
317 });
318
319 if(isPoly)
320 {
321 CustomNodeProperties::addNodeIdManually(f.getFileNameWithoutExtension(), PropertyIds::IsPolyphonic);
322 }

Callers 1

Calls 10

isInitialisedFunction · 0.85
getMainController_Method · 0.80
removeErrorMethod · 0.80
createFunction · 0.50
parseFunction · 0.50
forEachFunction · 0.50
getIdMethod · 0.45
getModuleListMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected