atom feed5 messages in at.iem.pd-dev[PD-dev] how do I go about pd_bind()i...
FromSent OnAttachments
Claude Heiland-AllenMar 2, 2007 11:23 pm 
Frank BarknechtMar 3, 2007 12:32 am 
Claude Heiland-AllenMar 3, 2007 2:27 am 
Frank BarknechtMar 3, 2007 2:49 am 
Claude Heiland-AllenMar 4, 2007 9:15 am.gz
Subject:[PD-dev] how do I go about pd_bind()ing multiple symbols to one object and distinguish between them?
From:Claude Heiland-Allen (clau@goto10.org)
Date:Mar 2, 2007 11:23:41 pm
List:at.iem.pd-dev

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)