[PD-dev] getting the classname in an class

Hans-Christoph Steiner hans at eds.org
Mon Oct 29 21:07:06 CET 2007


On Oct 29, 2007, at 3:16 PM, IOhannes m zmoelnig wrote:

> Hans-Christoph Steiner wrote:
>
>> Perhaps atom_getsymbol(binbuf_getvec(x->x_obj.te_binbuf)) could be  
>> defined in m_pd.h as something like "class_getclassname"
>
> this is along the lines of what i tried to suggest in my initial  
> reply to this thread (in the sf-ticket)
>
>
> in addition to that i would like to have something like:
>
> static void myobj_nicesavefn(t_myobj*x, t_symbol**name, int*argc,  
> t_atom**argv) { }
>
> and the developer can decide to set (name) and/or (argc,argv) or  
> leave them to their initial state.
> all the binbuf-bibabo with the typestrings should really be hidden  
> behind this.
>
> mfgas.dr
> IOhannes

If you had class_getclassname(), then it would be used in the  
existing savefn API, in the binbuf_addv().  I don't know enough to  
say how useful your proposal would be.

I ran into a problem applying this to the iemgui (footils/knob and  
moonlib/mknob both use the iemgui API).  Basically, in iemgui, the  
use  "t_iemgui x_gui" instead of "t_object x_obj".  x_gui then has  
"t_object x_obj".  That means adding an extra layer:

atom_getsymbol(binbuf_getvec(x->x_gui.x_obj.te_binbuf)),


.hc


------------------------------------------------------------------------ 
----

                   ¡El pueblo unido jamás será vencido!






More information about the Pd-dev mailing list