Post init callback
-
I have need to trigger some components in my secondary scripts from my main interface script at init. The problem is the init function of the main script triggers before all of the other scripts are initialiased. My current solution is to use a timer in the main script to delay this action but this is imprecise.
A better way I think would be to have a post init callback that triggers after everything (not just the main script) is ready.
-
@d-healey That would be nice to have indeed...
In the waiting, what if you do the opposite? check from the secondary scripts the state of the interface script components?
Or even a script at the end of the "script chain", so it is the last one to be triggered and checks for everything that you need? I never tried such a thing...
-
@d-healey It should work. I just tested and the component's CBs are called before the init of the next script begins...
-
@ustk said in Post init callback:
what if you do the opposite? check from the secondary scripts the state of the interface script components?
The timer is fine for me for now until we have a proper solution.
-
@d-healey I have kind of the same issue with the samplerate. It is not ready at init so I use a timer that sets all the depending variables.
Not a neat solution because I cannot use const variables since they cannot be updated later. -
@d-healey said in Post init callback:
The timer is fine for me for now until we have a proper solution.
Problem with the timer. If you reopen a saved session in the DAW it will run the timer and reload the default preset. I think the same problem will exist with a post init callback too...
-
Did this ever get implemented? I seem to recall @Christoph posting something about it recently but I cant find anything with a forum search.