Best way to determine plug-in input channel count for updating editor?


#1

Hi all,

I have a plug-in that supports both mono and stereo input. As such, I would like the editor to contain extra components for the stereo version. What is the best way to determine how many input channels there are so the editor updated accordingly?

Currently I am checking the number of channels in the process block and that doesn’t seem to update quick enough in AAX in time for the changes to be executed in the editor’s constructor.

Thoughts? Thanks for you input.

-s


#2

The AudioProcessorEditor constructor references the processor and stores it in a public member variable called processor. So you can use that to access the processor and check the BusesLayout or call getTotalNumInputChannels() or getTotalNumOutputChannels().

You’ll want the editor to monitor the processor for changes using a ChangeBroadcaster for example (see the comments for AudioProcessor::createEditorIfNeeded().


#3

Thanks for the reply Andrew, I didn’t realize that I could access those variables from there - guess I’ll pay more attention to the API from now on. Change broadcaster sounds like a good call for monitoring. Thanks again.