I’m facing a strange behaviour under Pro Tools.
Our plugins read some preferences regarding a default editor layout from a preference file on processor construction. If a first fresh instance is loaded in an empty project, this works well. If I change the default preference through the first instances editor, the preference gets successfully written to the preference file.
Now if a second instance of the plugin is added to the same track, I see the following behaviour with the debugger attached:
- Processor gets constructed. It reads the correct state from the preference file and sets an according state in the ValueTree used to manage our state
- Now the Pro Tools automation thread kicks in and calls setStateInformation. There is no previous call to getStateInformation, so it seems to apply a cached “default” state. This state contains the previous preference the first instance read when being created
- After this is done, the editor is constructed and reads the preference state from the
ValueTree. Result: It does not read the state the processor just wrote to the value tree but an outdated state.
So what’s happening here? I’m extremely confused as this behaviour doesn’t make that much sense. Anyone that came across the same?