Standalone Wrapper calling setStateInformation before prepareToPlay

Hi guys,

I’m wondering why the standalone wrapper is loading the plugin state before prepareToPlay.

In the init method we have:

void init (bool enableAudioInput, const String& preferredDefaultDeviceName)
        setupAudioDevices (enableAudioInput, preferredDefaultDeviceName, options.get());

       if (autoOpenMidiDevices)
           startTimer (500);

By moving reloadPluginState() below startPlaying(), everything works as expected and consistent with the plugin behaviour in a DAW.

DAWs won’t necessarily call prepareToPlay first. Both behaviours are valid, and AudioProcessors should be able to cope with either order.