Passing arguments in constructor in min-devkit
Hey there :)
I need to do some custom initialisation based on arguments for one of my classes. The documentation states I should use a custom constructor for this and by adding const atoms& args = {}
as an argument, I should be able to parse them individually.
Unfortunately I found out, that the constructor is called already by pressing space after entering the name of my external into the max object box. In my understanding the constructor should only be called after filling in the arguments and pressing enter, or am I misunderstanding this?
In any case, how am I supposed to get the arguments in the constructor, when it does not wait for me entering them?
Sorry if this is completely obvious and thanks in advance!
it's possible you are running into a quirk of min based objects where the object's constructor is called once prior to initializing the min wrapper object. So if the object has never been instantiated in the application lifetime this dummy constructor is called. once this happens all other constructor calls are "legit". You could keep track of this using a static variable if needing to handle these dummy calls differently.
Hey Rob, thanks a lot for the answer!
I think I solved it meanwhile, I thought there was no need for the argument<number> some_arg {};
calls anymore, when processing them in the constructor.
Now I placed all my argument calls as first thing, and then the constructor, which works perfectly!
All the best :)