Thanks for your reply. To be more specific, my goal is to have the plugin react differently depending on the number of outputs (i.e., the number of channels in the track). So in prepareToPlay() I use getNumOutputChannels() to determine the current number of outputs and perform different actions.
It works fine in Protools and Logic. However it does not work in Reaper and Live since getNumOutputChannels() always return 8 (even if the plugin is in a stereo or 5.1 track) ...
As far as I understand, the VST norm supports different channel configurations. The number of outputs should be set in setSpeakerArrangement(), which is implemented in Juce : https://github.com/julianstorer/JUCE/blob/master/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp#L893
However, the function is not called... I don't know why. On the Reaper forum I was told that Reaper implements this call (via effSetSpeakerArrangement) each time the number of channels in the track changes. In my case the number of outputs is only set at init by https://github.com/julianstorer/JUCE/blob/master/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp#L252 and it is set to the maximum number of channels, not to the number of channels in the track (as it should be).