The methods Module::onAdd and Module ::onSave are only called on loading/saving a patch, but not on loading/saving a preset.
If I want to save e.g. a wave file within a preset, I could call Module::onSave from Module::dataToJson. But then every time the autosave thread runs, the wave file will also be saved.
Has anyone found a way to distinguish between Module::dataToJson called from saving a preset manually and called from the autosave thread?