Is the threadSafeRestore feature supported on the MOD host? I’m trying to schedule a worker task in the state restore function, but I get the following error: “The Worker Schedule feature is only allowed in the audio threading class”. I’m running this on MOD Desktop for debugging purposes.
And I’m writing the plugin in Rust, so it might be there’s something missing there. But I would like to know if it should work in the first place.
You should call the worker thread from the audio callback thread only.
What I do when I need the worker to do some work on state restore is, set a flag ( and the needed variables) on restore. The flag then would be checked in the audio callback, and, when it is set, the worker get called from the audio thread.
Thanks for the info! This is how I approached it originally. From reading the docs (LV2 State) on threadSafeRestore I thought the worker could be called from the restore function directly. But this will do then.