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

Method isWrappable

hi_scripting/scripting/scriptnode/ui/NodeComponent.cpp:1166–1195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1164}
1165
1166int NodeComponent::PopupHelpers::isWrappable(NodeBase* n)
1167{
1168 if (n == nullptr)
1169 return 0;
1170
1171 auto nodeTree = n->getValueTree();
1172
1173 auto p = n->getPath();
1174
1175 auto isOptionalSnex = snex::cppgen::CustomNodeProperties::nodeHasProperty(nodeTree, PropertyIds::IsOptionalSnexNode);
1176
1177 if(isOptionalSnex)
1178 {
1179 auto mode = n->getNodeProperty(PropertyIds::Mode).toString();
1180
1181 isOptionalSnex = mode == "Custom";
1182 }
1183
1184 auto isSnex = p.getIdentifier().toString().contains("snex");
1185 auto isChain = p == NamespacedIdentifier::fromString("container::chain");
1186 auto isExpression = p.getIdentifier().toString().endsWith("expr");
1187
1188 if (isChain)
1189 return 1;
1190
1191 if (isSnex || isOptionalSnex || isExpression)
1192 return 2;
1193
1194 return 0;
1195}
1196
1197void NodeComponent::PopupHelpers::wrapIntoNetwork(NodeBase* node, bool makeCompileable)
1198{

Callers

nothing calls this directly

Calls 8

fromStringFunction · 0.85
getValueTreeMethod · 0.45
getPathMethod · 0.45
toStringMethod · 0.45
getNodePropertyMethod · 0.45
containsMethod · 0.45
getIdentifierMethod · 0.45
endsWithMethod · 0.45

Tested by

no test coverage detected