| 1685 | } |
| 1686 | |
| 1687 | scriptnode::NodeBase* NodeFactory::createNode(ValueTree data, bool createPolyIfAvailable) const |
| 1688 | { |
| 1689 | auto path = data[PropertyIds::FactoryPath].toString(); |
| 1690 | auto className = Identifier(path.upToFirstOccurrenceOf(".", false, false)); |
| 1691 | |
| 1692 | if (className != getId()) |
| 1693 | return nullptr; |
| 1694 | |
| 1695 | auto id = Identifier(path.fromFirstOccurrenceOf(".", false, false)); |
| 1696 | |
| 1697 | if (createPolyIfAvailable) |
| 1698 | { |
| 1699 | for (const auto& item : polyNodes) |
| 1700 | { |
| 1701 | if (item.id == id) |
| 1702 | { |
| 1703 | auto newNode = item.cb(network.get(), data); |
| 1704 | |
| 1705 | return newNode; |
| 1706 | } |
| 1707 | } |
| 1708 | } |
| 1709 | |
| 1710 | for (const auto& item : monoNodes) |
| 1711 | { |
| 1712 | if (item.id == id) |
| 1713 | { |
| 1714 | auto newNode = item.cb(network.get(), data); |
| 1715 | |
| 1716 | return newNode; |
| 1717 | } |
| 1718 | } |
| 1719 | |
| 1720 | return nullptr; |
| 1721 | } |
| 1722 | |
| 1723 | DspNetwork::SelectionUpdater::SelectionUpdater(DspNetwork& parent_) : |
| 1724 | parent(parent_) |
no test coverage detected