AAX Wrapper and meta parameters problem

Warning: I’m still using JUCE 4.1 as I’m still recovering from the multibus mess.

With AAX, meta parameters are broken. In AAX_Wrapper setChunk, there’s this:

        pluginInstance->setStateInformation ((void*) chunk->fData, chunk->fSize);

        // Notify Pro Tools that the parameters were updated.
        // Without it a bug happens in these circumstances:
        // * A preset is saved with the RTAS version of the plugin (".tfx" preset format).
        // * The preset is loaded in PT 10 using the AAX version.
        // * The session is then saved, and closed.
        // * The saved session is loaded, but acting as if the preset was never loaded.
        const int numParameters = pluginInstance->getNumParameters();

        for (int i = 0; i < numParameters; ++i)
            SetParameterNormalizedValue (IndexAsParamID (i), (double) pluginInstance->getParameter(i));

So, the wrapper calls setStateInformation, then for those reasons has to set the values for the parameters AGAIN. The problem is this, if there’s a meta parameter, the value for the “slave” parameter may be reset to a WRONG value (compared to the value from setStateInformation).

I’ve fixed it by resetting the values with the stored data value instead of using the (double) pluginInstance->getParameter(i) which is causing the problem.