AudioGraphIOProcessor seems to fill in plug-in descriptions backwards


#1

I’d like to get some thoughts on what I think might be a pretty minor bug in the AudioGraphIOProcessor that I ran into while trying to save/restore AudioProcessorGraphs.

Note the following code from AudioGraphIOProcessor::fillInPluginDescription:

    d.numInputChannels = getMainBusNumInputChannels();
if (type == audioOutputNode && graph != nullptr)
    d.numInputChannels = graph->getMainBusNumInputChannels();

    d.numOutputChannels = getMainBusNumOutputChannels();
if (type == audioInputNode && graph != nullptr)
    d.numOutputChannels = graph->getMainBusNumOutputChannels();

As far as I understand, the graph’s are reflected as outputs from the input IOProcessor and the graph outputs are reflected as inputs from the output IOProcessor, and calling getMainBusNum<Input/Output>Channels() seems to support this.

If I’m reading this code correctly, if a graph is available, the I/O is saved with exactly the opposite information.

Should the code rather be as follows for input and output nodes respectively?

    d.numOutputChannels = graph->getMainBusNumInputChannels();
    d.numInputChannels = graph->getMainBusNumOutputChannels();

As a workaround I’ve just been saving/restoring graph I/O configuration directly from the graph as opposed to allowing the nodes to inform the restoration of saved graphs.

I want to make sure this wasn’t intentional for some case I’m not considering, but obviously this is pretty easy to work around and isn’t the biggest bug in the world, if it is indeed a bug.