Skip to content

Commit

Permalink
Also allow receiving messages on signal inlets
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyschoen committed Mar 4, 2024
1 parent ba8c0fa commit 6f23487
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pdlua.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,18 @@ static void pdlua_proxyinlet_anything
pdlua_dispatch(p->owner, p->id, s, argc, argv);
}

static void pdlua_proxyinlet_fwd
(
t_pdlua_proxyinlet *p, /**< The proxy inlet that received the message. */
t_symbol *s, /**< The message selector. */
int argc, /**< The message length. */
t_atom *argv /**< The atoms in the message. */
)
{
if(!argc) return;
pdlua_dispatch(p->owner, p->id, atom_getsymbol(argv), argc-1, argv+1);
}

/** Proxy inlet initialization. */
static void pdlua_proxyinlet_init
(
Expand All @@ -380,8 +392,10 @@ static void pdlua_proxyinlet_init
static void pdlua_proxyinlet_setup(void)
{
pdlua_proxyinlet_class = class_new(gensym("pdlua proxy inlet"), 0, 0, sizeof(t_pdlua_proxyinlet), 0, 0);
if (pdlua_proxyinlet_class)
if (pdlua_proxyinlet_class) {
class_addanything(pdlua_proxyinlet_class, pdlua_proxyinlet_anything);
class_addmethod(pdlua_proxyinlet_class, pdlua_proxyinlet_fwd, gensym("fwd"), A_GIMME, 0);
}
}

/** Proxy receive 'anything' method. */
Expand Down Expand Up @@ -1141,6 +1155,7 @@ static int pdlua_object_createinlets(lua_State *L)
* \li \c 2 Number of inlets.
* */
{

PDLUA_DEBUG("pdlua_object_createinlets: stack top is %d", lua_gettop(L));
if (lua_islightuserdata(L, 1))
{
Expand Down

0 comments on commit 6f23487

Please sign in to comment.