[PD-dev] How to construct a dynamic length list in PD external?

Mike McGonagle mjmogo at gmail.com
Sun Mar 22 14:11:21 CET 2009


Why not just create a binbuf object, append all the atoms to it, and
then extract the length and atoms vector...

t_atom a;
t_binbuf b = binbuf_new();
while(more_data) {
   SETSYMBOL(&a, camera_data);
   binbuf_add(b, 1, &a);
}
outlet_anything(x -> x_obj.ob_outlet, &s_list, binbuf_getnatom(b),
binbuf_getvec(b));
binbuf_free(b);

Mike

On Fri, Mar 20, 2009 at 6:07 PM, B. Bogart <ben at ekran.org> wrote:
> Hey all,
>
> I searched the archives and looked at some of the code in SVN, but I'm
> still unsure how to do this.
>
> I have a nested for loop that grabs the config options from the PTP
> camera. The length depends on the camera and its mode.
>
> How can I append each name to a list suitable to be used by outlet_list?
>
> Anyone keeping a collection of PD C external snippets?
>
> Thanks,
> B.
>
> _______________________________________________
> Pd-dev mailing list
> Pd-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev
>



-- 

Fred Allen  - "The first time I sang in the church choir; two hundred
people changed their religion."




More information about the Pd-dev mailing list