Guenter,
Glad to have your thoughts on this (I have been meaning to look at Gem for
the purpose of C++ wrappers for a while, but haven't gotten around to it).
I think that it is going to be difficult to make externals much simplier -
the C api is pretty straight forward as it is. I was thinking more in
terms of providing subclasses of the wrapper base class that define
standard types of objects - 1 in / 1 out cotrol object, 1 control in / 1
dsp out, etc. Implement a few virtual functions and you have an
object. Does anyone have any better ideas?
I almost think what would be better would be an object 'wizard' - a simple script to ask some questions and generate all of the boiler plate code for you and you just fill in the functions. More interesting would be to get it to generate all of the boiler plate code for PD, Max/MSP, and jMax (along the lines of fiddle)! Any thoughts?
Karl
On Fri, 3 Nov 2000, Guenter Geiger wrote:
Gem is really targeted for doing graphics, so it is only partly useable as a base class for pd external objects (look at src/Base/CPPExtern.h).
The C++ wrapping of Gem does not really (IMO) take away the complexity of creating externals.
This said, it may be a good starting point to investigate how it can be done.
I haven't really analyzed the design thouroughly, the drawbacks of GEM's wrapping are:
uses #define instead of templates ( this makes it easier portable to some extend). altough the defines reduce the amount of typeing needed for each external, they do not really clarify what is happening.
adding of messages becomes more complex than in plain C.
despite that, having a C++ wrapper would be great, though I think creating a decent API is not that simple. Do you have any concrete suggestions ?
Guenter
Karl MacMillan writes:
Have you looked at Gem?
Karl
On Tue, 1 Aug 2000, Larry Troxler wrote:
Just wondering, has anyone thought about writing some C++ classes that wrap the existing PD code that is used to create classes?
I'm not suggesting modifying the existing PD core, but rather, having some classes that encapsulate it, in order to make it easier to code new externs, and to make it more understandable what is going on.
Larry
-- _____________________________________________________ | Karl W. MacMillan | | Computer Music Department | | Peabody Institute of the Johns Hopkins University | | karlmac@peabody.jhu.edu | | www.peabody.jhu.edu/~karlmac |