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

Method restoreNetworks

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

Source from the content-addressed store, hash-verified

1652}
1653
1654void DspNetwork::Holder::restoreNetworks(const ValueTree& d)
1655{
1656 auto v = d.getChildWithName("Networks");
1657
1658 if (v.isValid())
1659 {
1660 clearAllNetworks();
1661
1662 for (auto c : v)
1663 {
1664 if (c.getNumChildren() == 0)
1665 {
1666 auto nid = c[PropertyIds::ID].toString();
1667 auto mc = dynamic_cast<ControlledObject*>(this)->getMainController();
1668
1669 auto fh = mc->getActiveFileHandler();
1670
1671 c = fh->getEmbeddedNetwork(nid);
1672 jassert(c.isValid());
1673 }
1674
1675 auto newNetwork = new DspNetwork(dynamic_cast<ProcessorWithScriptingContent*>(this),
1676 c.createCopy(), isPolyphonic());
1677
1678 if (vk != nullptr)
1679 newNetwork->setVoiceKiller(vk);
1680
1681 networks.add(newNetwork);
1682 setActiveNetwork(newNetwork);
1683 }
1684 }
1685}
1686
1687scriptnode::NodeBase* NodeFactory::createNode(ValueTree data, bool createPolyIfAvailable) const
1688{

Callers

nothing calls this directly

Calls 11

getChildWithNameMethod · 0.80
getActiveFileHandlerMethod · 0.80
setVoiceKillerMethod · 0.80
isPolyphonicFunction · 0.50
isValidMethod · 0.45
getNumChildrenMethod · 0.45
toStringMethod · 0.45
getMainControllerMethod · 0.45
getEmbeddedNetworkMethod · 0.45
createCopyMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected