-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-11-15 23:51, Matthias Kronlachner wrote:
hi!
you can find an example how to do two outputs from pix_ object in my pix_freenect external. http://www.matthiaskronlachner.com/wp-content/uploads/2011/11/pix_freenect_0...
i made an additional inlet and outlet for gemstate plus the methods that get called, 2 pixBlock and an additional GemState.
so the pieces of code that are interesting: constructor: m_depthinlet = inlet_new(this->x_obj, &this->x_obj->ob_pd, gensym("gem_state"), gensym("depth_state")); m_depthoutlet = outlet_new(this->x_obj, 0);
setupCallback: class_addmethod(classPtr, (t_method)(&pix_freenect::renderDepthCallback), gensym("depth_state"), A_GIMME, A_NULL);
-> renderDepthCallback() calls the rendering method for the second output -> renderDepth(int argc, t_atom*argv);
most of the code you show deals with how to make a 2nd *inlet* for gemstates, which is exemplified in the GemPixDualObject base clasee.
the complicated thing about having a 2nd *outlet* is of course to generate a valid GemCache (afair just creating a new one should be sufficient for most cases; you might want to copy things like the "dirty" flags over to the "main" m_cache after processing of the 2nd chain is done) and a valid GemState. and then generate a Pd-message containing those two.
there should be a GemOutlet class derived from RTE::Outlet, that handles most of those things for you. (at least the part with generating a valid Pd message from a given GemCache&GemState)
fgamsdr IOhannes