[PD-dev] how do I go about pd_bind()ing multiple symbols to one object and distinguish between them?

Claude Heiland-Allen claudiusmaximus at goto10.org
Sat Mar 3 08:24:04 CET 2007


Hi,

I'm writing an external, and I want it to have multiple named receivers 
that do different things (something that seems trivial for an 
abstraction but rather tricky for an external).

I worked out how to have multiple 'anything' inlets using a proxy class 
(modelled after the [list ...] internals), but I'm stuck when it comes 
to multiple 'anything' receivers.

If i just do:

   pd_bind(myobject, gensym("blah"));
   pd_bind(myobject, gensym("glah"));

then myobject can't distinguish whether the message got sent to "blah" 
or "glah", which is loss of information that I need.

So, I somehow need to create fake objects (one for each receiver) that 
forward the messages to the real object (adding in some extra info 
unique to the receiver).

The problem is I don't know how to create the fake objects.  Anyone have 
any ideas / example code / tips to offer?


Claude


PS:

It would have been nicer if instead of:

   pd_bind(object, symbol)

there was also something like:

   pd_bind_method(object, symbol, method)

or even better:

   pd_bind_method(object, symbol, method, methoddata)


-- 
http://claudiusmaximus.goto10.org




More information about the Pd-dev mailing list