-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
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 specific: 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:
<snip> void libpd_init(void); int libpd_process_float(int ticks, const float *in, float *out); // ... </snip>
obviously with this API it will *never* be possible to initialize multiple instances of libpd. so i would have expected something along: <snip> typedef struct libpd_ libpd_t; libpd_t*libpd_init(void); int libpd_process_float(libpd_t*instance, int ticks, ...); // ... libpd_deinit(libpd_t*instance); </snip>
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 multiple instances).
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...
ghsdft IOhannes