There is a simple way to check if a cable is connected.
But is there a way to figure out where it goes?
There is a simple way to check if a cable is connected.
But is there a way to figure out where it goes?
There are many modules that traverse cables to find the modules that they’re connected to.
I don’t find a connectedTo()
in the VCV Rack API (use the search box on the Rack API site), so I assume you’re asking how one would implement it.
Note sure if there’s a more direct way to get the cable on an input or output, but you can at least do this:
APP->engine->getCableIds
to get the ids of all the cables.APP->engine->getCable(cable->id)
to get the cable.inputModule
or outputModule
to see if it’s your module id.inputId
and outputId
to see the input id or output id of the corresponding module the cable is connected to.Paul is exactly right
https://github.com/baconpaul/BaconPlugs/blob/d2962bebfe25aeb10348734f68b9635b877b10e2/src/LintBuddy.cpp#L294 here’s an example where lintbuddy uses this to probe modules it connects to for instance