I've developed a bunch of plug-ins over the past years using the "indexed" methods in AudioProcessor to let the host access the automated parameters.
The mapping "host index"->"internal parameter" was explicit in each of those methods (be it an array index, a big switch/case, whatever).
Now, with AudioProcessorParameter (which I like for the most part), I get that each parameter is assigned its automation index incrementally, depending on the order of the AudioProcessor::addParameter() calls.
So let's say I start with my plug-in having two parameters for "low" and "high" eq, for example:
processor->addParameter (lowGain); // index: 0 processor->addParameter (highGain); // index: 1
After a first release, I decide to add a "mid" eq. The natural place where I will feel it is appropriate to add it is between those two, so
processor->addParameter (lowGain); // index: 0 processor->addParameter (midGain); // index: 1 processor->addParameter (highGain); // index: 2
Now, all sessions where the "high" of my plug-in was automated (with index 1) will automate the "mid" parameter after the update.
Now I wonder, wouldn't it be appropriate to leave a chance to developers to explictly state which index they want to use, in order to cope with similar scenarios?
Perhaps something along the lines of:
processor->insertParameter (lowGain, 0);
processor->insertParameter (midGain, 2);
processor->insertParameter (highGain, 1);
So that one can add the parameters in their most natural order, and still have the existing parameter indices unchanged throughout the lifetime of the plug-in.
(in my case, I totally would add an enum that lists the parameters in the order they have been added to the project, and then use those as automation indices: ).
enum AutomationIndex { indexLow = 0, indexHigh = 1, indexMid = 2 };
processor->insertParameter (lowGain, indexLow);
processor->insertParameter (midGain, indexMid);
processor->insertParameter (highGain, indexHigh);