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

Method ConnectionBase

hi_scripting/scripting/scriptnode/api/NodeBase.cpp:1575–1614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1573};
1574
1575ConnectionBase::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
1616scriptnode::parameter::dynamic_base::Ptr ConnectionBase::createParameterFromConnectionTree(NodeBase* n, const ValueTree& connectionTree, bool scaleInput)
1617{

Callers

nothing calls this directly

Calls 10

findParentTreeOfTypeFunction · 0.85
getNodeForValueTreeMethod · 0.80
getNodeWithIdMethod · 0.80
ParameterIteratorClass · 0.70
getScriptProcessorMethod · 0.45
getTypeMethod · 0.45
toStringMethod · 0.45
getIdMethod · 0.45
getValueTreeMethod · 0.45
getParentMethod · 0.45

Tested by

no test coverage detected