| 648 | |
| 649 | |
| 650 | var DspNetwork::create(String path, String id) |
| 651 | { |
| 652 | checkValid(); |
| 653 | |
| 654 | var existing = get(id); |
| 655 | |
| 656 | if (auto existingNode = dynamic_cast<NodeBase*>(existing.getObject())) |
| 657 | return var(existingNode); |
| 658 | |
| 659 | ValueTree newNodeData(PropertyIds::Node); |
| 660 | |
| 661 | if (id.isEmpty()) |
| 662 | { |
| 663 | String nameToUse = path.contains(".") ? path.fromFirstOccurrenceOf(".", false, false) : path; |
| 664 | StringArray unused; |
| 665 | id = getNonExistentId(nameToUse, unused); |
| 666 | } |
| 667 | |
| 668 | newNodeData.setProperty(PropertyIds::ID, id, nullptr); |
| 669 | newNodeData.setProperty(PropertyIds::FactoryPath, path, nullptr); |
| 670 | |
| 671 | NodeBase::Ptr newNode = createFromValueTree(isPoly, newNodeData); |
| 672 | |
| 673 | return var(newNode); |
| 674 | } |
| 675 | |
| 676 | juce::var DspNetwork::createAndAdd(String path, String id, var parent) |
| 677 | { |
no test coverage detected