[PD-dev] how to create second inlet that accepts both floats and symbols

IOhannes m zmoelnig zmoelnig at iem.at
Thu Jul 18 19:04:35 CEST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2013-07-18 18:41, Ivica Ico Bukvic wrote:
> inlet_new apparently redirects elsewhere, so one could potentially
> do what list_append does (if I am understanding the code
> correctly), but is there an easier way to do this?

basically you ahve two options:
- - allow "lists" at the second inlet, and check whether the list has
only one argument of type A_FLOAT or A_SYMBOL:

  /* creating the inlet */
  inlet_new((t_object*)x, (t_pd*)x, gensym("list"), gensym("list2"));

  /* adding a method for the 2nd inlet */
  class_addmethod(classptr, list2Method, gensym("list2"), A_GIMME, 0);

- - if you want to allow *any* message, you need to create a proxy
object that will act as a receiver for the messages sent to the given
inlet. this is what the [list] family does (but also some other
objects, e.g. iemlib's [any])

- - IIRC, when using flext, you get inlets that allow any message for
free (that is: proxy objects are handled transparently)

gasrd
IOhannes


PS: i was having troubles understanding your actual question. would
you mind putting a the question itself into the body of the email? my
MUA only displays part of the subject, at least where i usually look
for it.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iEYEARECAAYFAlHoIBwACgkQkX2Xpv6ydvSWDACeONzcol5Hbx1LPHyTg3MzKLw6
TO8AnjJOeRZ4XnSXffbBbwpitnilHb7F
=U1t+
-----END PGP SIGNATURE-----



More information about the Pd-dev mailing list