[PD-dev] Multiple Instance of pdlib
IOhannes m zmoelnig
zmoelnig at iem.at
Mon Feb 24 09:50:48 CET 2014
-----BEGIN PGP SIGNED MESSAGE-----
On 2014-02-23 20:46, Dan Wilcox wrote:
> Any further updates on this front? If a consensus is made, we could
> outline a roadmap and move to the task of implementation. At this
> point, I think breaking externals would be less of an issue if said
> breakage would be manageable via about find/replace. I'd be willing
> to handle that, at the least.
i was going to ask something along these lines as well, but more libpd
when i (last) looked into the libpd API, i noticed that libpd works on
a global namespace as well...what i mean is, that the API (at least
the C-API, i haven't checked the others) does not allow to specify an
"instance" of pd.
the current API looks like:
int libpd_process_float(int ticks, const float *in, float *out);
obviously with this API it will *never* be possible to initialize
multiple instances of libpd.
so i would have expected something along:
typedef struct libpd_ libpd_t;
int libpd_process_float(libpd_t*instance, int ticks, ...);
now obviously we *currently* cannot have multiple instances of pd
(afaiu, that's what dan's question is about).
but i fail to see why libpd doesn't provide the API for this, even if
the "instance" pointer would not be used (until Pd does support
e.g. the application programmer would have to check that libpd_init()
returns non-NULL anyhow, and in the current implementation it would
always return NULL but the first time being called.
this would have allowed for a transition to multiple instances without
having to change the API...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Icedove - http://www.enigmail.net/
-----END PGP SIGNATURE-----
More information about the Pd-dev