| 1573 | }; |
| 1574 | |
| 1575 | ConnectionBase::ConnectionBase(DspNetwork* network_, ValueTree data_) : |
| 1576 | ConstScriptingObject(network_->getScriptProcessor(), 0), |
| 1577 | network(network_), |
| 1578 | data(data_) |
| 1579 | { |
| 1580 | jassert(data.getType() == PropertyIds::Connection || data.getType() == PropertyIds::ModulationTarget); |
| 1581 | |
| 1582 | ADD_API_METHOD_0(getTarget); |
| 1583 | ADD_API_METHOD_1(getSourceNode); |
| 1584 | ADD_API_METHOD_0(disconnect); |
| 1585 | ADD_API_METHOD_0(isConnected); |
| 1586 | ADD_API_METHOD_0(getConnectionType); |
| 1587 | ADD_API_METHOD_0(getUpdateRate); |
| 1588 | |
| 1589 | auto nodeId = data[PropertyIds::NodeId].toString(); |
| 1590 | |
| 1591 | auto nodeTree = findParentTreeOfType(data, PropertyIds::Node); |
| 1592 | sourceNode = network->getNodeForValueTree(nodeTree); |
| 1593 | |
| 1594 | if (auto targetNode = network->getNodeWithId(nodeId)) |
| 1595 | { |
| 1596 | for(auto p: NodeBase::ParameterIterator(*targetNode)) |
| 1597 | { |
| 1598 | if (p->getId() == data[PropertyIds::ParameterId].toString()) |
| 1599 | { |
| 1600 | targetParameter = p; |
| 1601 | break; |
| 1602 | } |
| 1603 | } |
| 1604 | } |
| 1605 | |
| 1606 | if ((sourceInSignalChain = Helpers::findRealSource(sourceNode))) |
| 1607 | { |
| 1608 | if (targetParameter != nullptr) |
| 1609 | { |
| 1610 | auto containerTree = Helpers::findCommonParent(sourceInSignalChain->getValueTree(), targetParameter->data); |
| 1611 | commonContainer = network->getNodeForValueTree(containerTree.getParent()); |
| 1612 | } |
| 1613 | } |
| 1614 | } |
| 1615 | |
| 1616 | scriptnode::parameter::dynamic_base::Ptr ConnectionBase::createParameterFromConnectionTree(NodeBase* n, const ValueTree& connectionTree, bool scaleInput) |
| 1617 | { |
nothing calls this directly
no test coverage detected