<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Em qui, 8 de nov de 2018 às 14:25, Christof Ressi <<a href="mailto:christof.ressi@gmx.at">christof.ressi@gmx.at</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">there's no way around class_addmethod but you can use gensym("") if you want to prevent the user from invoking the code via a message.<br></blockquote><div><br></div><div>how is that so? Cause this is what I was using already...</div><div><br></div><div>"new" method:</div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym(</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"ft1"</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">));</span></p></div><div><br></div><div>"setup": </div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);min-height:13px"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></span><br></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>class_addmethod(classname_class, (t_method)classname_ft1, gensym(</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(209,47,27)">"ft1"</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">), A_FLOAT, </span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">);</span></p></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
note that you can't do that for more than one inlet, obviously.<br>
 <br>
 <br>
<br>
Gesendet: Donnerstag, 08. November 2018 um 17:05 Uhr<br>
Von: "Alexandre Torres Porres" <<a href="mailto:porres@gmail.com" target="_blank">porres@gmail.com</a>><br>
An: pd-dev <<a href="mailto:pd-dev@lists.iem.at" target="_blank">pd-dev@lists.iem.at</a>><br>
Betreff: [PD-dev] simple external question (how to make an inlet acess a function)<br>
<br>
Hi, I'm writing a signal external, it takes a signal in its main inlet and a float in its right inlet.<br>
 <br>
I want the float to be able to access a function in the code, right now I'm using something like:<br>
 <br>
    inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_float, gensym("ft1"));<br>
 <br>
In the "new" method, and then I also need to a class_addmethod included in the setup for "ft1" and I was hoping I didn't need that and could use another alternative.<br>
 <br>
What I think it's not elegant is that this makes the object actually take a "ft1" message in the main signal inlet. I know it's no biggie, but it annoys the hell out of me.<br>
 <br>
So is there any other way to make the inlet access a function inside the code without the need to add a method for it? Or do I just have to deal with it?<br>
 <br>
thanks<br>
 <br>
 _______________________________________________ Pd-dev mailing list <a href="mailto:Pd-dev@lists.iem.at" target="_blank">Pd-dev@lists.iem.at</a> <a href="https://lists.puredata.info/listinfo/pd-dev" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-dev</a><br>
</blockquote></div></div>