Some questions about communication between host and plugin

Hi, I am currently trying to understand the communication between a host and a plugin with its all details. First parts were the buslayouts and channels.
I read the buslayout documentation and it is ok. As far as i know host decides almost everything, and plug in responds that to inform the host whether it can handle that change or not. But let’s say that I need to know whether my plug in is running on a mono track or stereo. According to this info i want to change gui&processor of my plug-in so that it will adapt itself to be mono or stereo . If the track is a mono one, my effect will have a mono input and it will only display (let’s say) 2 sliders. But if it track is a stereo than everything will be set to create stereo inputs and it will have 4 sliders. Each pair will control one channel. At this point which class or document should i look at ? Can you suggest me a resource that focuses on these things with explaining the implementation.

You technically don’t have knowledge about that inside a plugin. The plugin could be running in a host that doesn’t even have “tracks”. The host just queries the plugin for supported I/O configurations and chooses some which it determines suitable for itself. (For example in Reaper, even if you have only mono audio files on a track, it will use the plugin as stereo anyway, at least with VST2 plugins. They appear to have some user choosable option to force VST3 plugins to process as mono, though.)

Anyway, if you need to know the current I/O configuration of the plugin set by the host, you should be able to get that with AudioProcessor:: getBusesLayout. Your GUI editor can access that and set up the GUI accordingly. (But don’t be surprised if the plugin is set to process as stereo even when the host’s track appears to be mono.)