Can I determine if object is in an abstraction?

Nov 26, 2007 at 10:40pm

Can I determine if object is in an abstraction?

Can I reliably find out if I’m instantiated in an abstraction?

ob_filename(patcher) always returns “patcher”, not the abstraction filename.

patcher->p_noedit appears to be always NULL.

#34770
Nov 27, 2007 at 11:29pm

P_noedit is NULL when the object is instantiated because it appears to be set after the patch has been loaded. It will return 1 in a poly~/pfft~/abstraction after the patch is loaded, but not at the time when you probably need it unfortunately. Sorry – this doesn’t help much, but it does explain why you’re getting that result.

Unfortunately because fileload() only takes a name and a path (the version handling arguments takes arguments as well but no more) and hence doesn’t seem to have any way to set patcher flags, I reckon any special patcher flags relating to how the patchers being loaded (by an abstraction etc.) will not be correctly set when the patcher loads. Hence I imagine it’s not possible to find out when your object instantiates whether you’re in an abstraction or not, as all those flags seem to be set after the file is loaded, and the patch returned (when your object has already loaded).

Be interested to find out I’m wrong though…

Alex

#117834
Nov 28, 2007 at 2:12am

Quote: AlexHarker wrote on Wed, 28 November 2007 12:29
—————————————————-
> all those flags seem to be set after the file is loaded, and the
> patch returned (when your object has already loaded).

It would appear it’s even later than that – the limited testing I’ve done indicates that the noedit flag is not set until after all objects in the abstraction have processed their loadbangs, which means I can’t find out what I need to know at loadbang (I don’t need it at instantiation). Sigh.

#117835
Nov 28, 2007 at 2:19am

> It would appear it’s even later than that – the limited testing I’ve done indicates that the noedit flag is not set until after all objects in the abstraction have processed their loadbangs, which means I can’t find out what I need to know at loadbang (I don’t need it at instantiation). Sigh.

Yes and no to it being later- although it amounts to the same thing. I think that fileload() or similar calls loadbang on the patch before returning the pointer to the object that’s called it (I’m using intload to load patches in an external and I don’t seem to call loadbang myself on the patch so it must happen here). Again this helps you not at all, but explains more precisely what is going on….

Alex

#117836

You must be logged in to reply to this topic.