Welcome to %s forums

BrainModular Users Forum

Login Register

SDK callback after initialization completely finished

Tell us what you'd like Usine to do
Post Reply
sm_jamieson
Member
Posts: 559
Contact:

Unread post by sm_jamieson » 24 Feb 2018, 13:42

A user module initialization consists roughly of the query callbacks, parameter type callbacks, module init, initial parameter changed callbacks, settings changed callbacks and the onSetChunk().
Sometimes I need to know that all the stored parameters and settings have been applied, before some other initialization actions are performed. A new callback called something like "onAfterInit()" would do the job.
This would be called after the module is initialized and all stored parameter values and settings have been applied, and also after onSetChunk() has been called.

If there are input wires attached to the parameters or settings, then the values coming down those wires could obviously come in after onAfterInit(), since these might be coming from elsewhere in the patch or workspace, in which case you would need to know when the whole workspace has been initialized.

But particularly for Settings that do not have wires connected, I need to know that no stored settings will overwrite new settings made. This unlikely to happen by user interaction, but if the module want to initialize settings and ignore the stored ones, currently a delay must be used that is hopefully long enough.

I suppose another way of looking at the settings issue, is I need to know if a setting change is due to the system applying it or the user doing it from the UI. I'll raise a separate request about improvement to onSettingsHasChanged().

Thanks,
Simon.

sm_jamieson
Member
Posts: 559
Contact:

Unread post by sm_jamieson » 24 Feb 2018, 16:44

I have looked in more detail at the process after a module is loaded, and it appears that onProcess() is not first called until after the init process and all the settings applied etc.
I don't know if this is always the case, but it seems reasonable. If so, that would be sufficient.
Perhaps Senso could confirm.

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests