Is there a way for a module to get informations on the global Rack context? Like the list of all running modules, and their connections? (so basically a description of the audio graph). Thanks.
In Rack v2, you can use APP->engine->getModuleIds()
.
In Rack v1, you can steal the list from the GUI using this nasty hack: APP->scene->rack->moduleContainer
.
But obviously this won’t work in headless mode.
Thanks. I don’t see any v2 branch here: https://github.com/VCVRack/Rack/branches. Is v2 code visible somewhere? Thanks.
It is not public yet.
There are plenty of open source modules that do this. Look at how they do it. Our Seq++ does this to patch connections between itself and clock modules.
That’s what I meant hope it helps. There’s also a simpler version from the new kitchen-sink here: https://github.com/squinkylabs/SquinkyVCV/blob/e70d4614f2a448ab6ccfc6bd77bccaf86d38ff18/src/WVCOModule.cpp#L50
Might be easier to read - less intricate details about specific plugins.