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

Method setNumChannels

hi_scripting/scripting/api/ScriptingApiObjects.cpp:3639–3658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3637}
3638
3639void ScriptingObjects::ScriptRoutingMatrix::setNumChannels(int numSourceChannels)
3640{
3641 if (!isPositiveAndBelow(numSourceChannels, NUM_MAX_CHANNELS + 1))
3642 {
3643 reportScriptError("illegal channel amount: " + String(numSourceChannels));
3644 RETURN_VOID_IF_NO_THROW();
3645 }
3646
3647 if (auto r = dynamic_cast<RoutableProcessor*>(rp.get()))
3648 {
3649 if (!r->getMatrix().resizingIsAllowed())
3650 {
3651 reportScriptError("Can't resize this matrix");
3652 RETURN_VOID_IF_NO_THROW();
3653 }
3654
3655 r->getMatrix().setNumSourceChannels(numSourceChannels);
3656 r->getMatrix().setNumAllowedConnections(numSourceChannels);
3657 }
3658}
3659
3660bool ScriptingObjects::ScriptRoutingMatrix::addConnection(int sourceIndex, int destinationIndex)
3661{

Callers 2

prepareToPlayMethod · 0.45
connectionChangedMethod · 0.45

Calls 6

isPositiveAndBelowFunction · 0.85
resizingIsAllowedMethod · 0.80
setNumSourceChannelsMethod · 0.80
StringClass · 0.50
getMethod · 0.45

Tested by

no test coverage detected