Dynamic Multibus Plugins

Hi @fabian,

thanks again for your hints.
I had the same conceptual problem trying to sync back to the host as @Nikolai in the other thread, where you clarified that “the plug-in is mostly at the mercy of the host when it comes to bus layouts”.
So I entirely reworked my stuff to “mercy of the host” and it works fine so far!

But: I still have an issue with the Bus names.
What I wanted is e.g. multiple playback buses and one recording bus.
(in fact I am working on a multi file player and recorder for the JUCE plugin host, which I could contribute to the project later, as discussed here).

One filter node is the recorder and one is the player (playing n files + playback of the recorder file).
So in the player I always wanted to give the last bus a name like “Rec…” if there is a recorder node.
So something like “Play1”, “Play2”, “Play3”, "Rec"
But the canApplyBusCountChange callback only gives me the last added bus.
If a bus is added, I cannot rename the second last, which is “Rec”.
So I would get something like “Play1”, “Play2”, “Play3”, “Rec”, “Play4”.

Removing the last bus to rename it seems not possible within canApplyBusCountChange as it would lead to a recursion.
As the Rec bus also can be removed (by removing that filter node), it is also not a solution to put it at the first place.
For now, I just enumerate all output buses… not too nice, but everything works so far.

Any idea on how to rename existing buses (within canApplyBusCountChange) or how to “insert” a new bus before the last one - or any other idea?
Thanks for any hint… maybe this could be of interest for other use cases also.