| 263 | } |
| 264 | |
| 265 | void 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 | } |
no test coverage detected