polyglot class

andrea agostini's icon

Hi.
I'm trying to make a polyglot class.

So far, I have managed to instantiate it (that is, as far as I understand, not the class itself but its corresponding js wrapper) from JS and call its methods - which is quite fine for now.

What I'd love to be able to do is:

- being able to send js an instance of the class through the js' inlets (as a t_object within an atom, preceded by a specific message selector)
- use it in JS
- retrieve it from the js' outlets (always with its message selector)
(these points make sense because I have a set of externals dealing with my class, and exchanging instances of it through their inlets and outlets)

- use my class from Java (including passing it through ins and outs)

thanks!
aa

Joshua Kit Clayton's icon

Hi Andrea,

Unfortunately these features are not supported at this time, however, you could coneivably do something like we do with jitter, registering each object using object_register in your own namespace. Then you would need to build a jni interface to class and a method to look up the object and provide a java wrapper. We can consider something along these lines for a future release, but it won't happen in the immediate future.

-Joshua

andrea agostini's icon

Thank you Joshua.

I don't think I'll do all this right now, but it sounds very interesting and probably in the future I'll decide to give it a try.

Would you have some documentation or code snippets to point me towards?

Cheers
aa