[PD-dev] type of x-lets of an abstraction
Georg Holzmann
grhPD at gmx.at
Wed Nov 2 13:10:13 CET 2005
Hallo devs!
I need to know the in-/outlet type of a pd-oject.
Okay, that's not difficult for externals or internals, but I have
problems to implement it for abstractions:
(excerpt without all checking: look at "here the problem starts" )
--------8<----------8<--------
//If I have the object
t_object *obj = the_just_created_abstraction;
// get the inlet
t_inlet *in = obj->ob_inlet;
// check if it is an abstraction
t_gobj *canvas = (t_gobj*)obj;
t_symbol *insym = NULL;
if(pd_class(&canvas->g_pd) == canvas_class)
{
post("is an ABSTRACTION !");
// get the owner g_obj of the inlet
t_gobj *next = &in->i_owner->te_g;
t_object *next_obj = (t_object*)next;
// test: this is working and prints out the name of the abstraction !!
t_binbuf *b=next_obj->te_binbuf;
binbuf_print(b);
//--------------------------------
// here the problem starts:
// I try to get the next object, which
// should be the obj connected to the inlet ???
next = next->g_next;
next_obj = (t_object*)next;
-------8<------------8<---------
and next_obj here is NULL ...
So my question, is next_obj here the object which is connected to the
abstraction, or should it be the object inside the abstraction which is
connected to the inlet ...
... hm - now that I wrote that down I think it is unfortunately the
first case ... so it will be more difficult to get the type ...
Has anyone an idea how to do that (do I have to parse the whole
abstraction for an inlet object, and get it's x position etc. ...) ?
Thanks for any hints,
LG
Georg
More information about the Pd-dev
mailing list