AudioProcessorGraph suggestion

Hi Jules,

could you please implement this function?
( I need to know which connections getting illegal after input/output-plugin channel configuration changed, … )

void AudioProcessorGraph::getIllegalConnectionsCopy(Array<AudioProcessorGraph::Connection> &illegalConnections)
{
	

	for (int i = connections.size(); --i >= 0;)
	{
		const Connection* const c = connections.getUnchecked(i);

		const Node* const source = getNodeForId (c->sourceNodeId);
		const Node* const dest = getNodeForId (c->destNodeId);

		if (source == nullptr || dest == nullptr
			|| (c->sourceChannelIndex != midiChannelIndex
			&& ! isPositiveAndBelow (c->sourceChannelIndex, source->processor->getNumOutputChannels()))
			|| (c->sourceChannelIndex == midiChannelIndex
			&& ! source->processor->producesMidi())
			|| (c->destChannelIndex != midiChannelIndex
			&& ! isPositiveAndBelow (c->destChannelIndex, dest->processor->getNumInputChannels()))
			|| (c->destChannelIndex == midiChannelIndex
			&& ! dest->processor->acceptsMidi()))
		{
			illegalConnections.add(Connection(c->sourceFilterID,c->sourceFilterChannel,c->destFilterID,c->destFilterChannel));
		}
	}
}

Well, ok, but I wouldn’t do it like that… A better design would be to add a isConnectionLegal() method, which would be more widely useful, and which could also be re-used inside the removeIllegalConnections() method, so wouldn’t duplicate any code.

thanks, a isConnectionLegal() would be also ok!

Very nice addition indeed!

I’d like to suggest a parameter mapping feature as well…
being able to select and map parameters of plugins that live inside the AudioProcessorGraph and have them available as parameters of the AudioProcessorGraph
is of course doable by creating a derived class, but it’d be a nice addition to have that in the main Juce branch…
something to consider when running out of ideas to implement :wink:

I’ll implement this feature myself for the piece of software I’m writing, so I can of course post it when I’m done with it.