[Clam-devel] Frontend for automatic generation of plugin code

David García Garzón dgarcia at iua.upf.edu
Thu Aug 7 05:54:25 PDT 2008


On Thursday 07 August 2008 13:15:23 David García Garzón wrote:
> > import clam
> > types_list = [item for item in clam.ProcessingDataPlugin.types()] #
> > workaround: to get a 'python list'
> >
> > for item in types_list:
> > 	print item
> >
> > N4CLAM11FundamentalE
> > N4CLAM11MelCepstrumE
> > N4CLAM11MelSpectrumE
> > N4CLAM17SpectralPeakArrayE
> > N4CLAM5AudioE
> > N4CLAM7LPModelE
> > N4CLAM8SpectrumE
> > St6vectorISt4pairIffESaIS1_EE
> > St6vectorIfSaIfEE
> > f
>
> Those are the keys used in an internal static dictionary that holds the
> type plugins. They are the type_info::name() of the type which is the
> mangled form of the type the compiler/linker uses, and we use it to get
> uniqueness. But methods in PDP do not lookup for such a key but by a
> std::type_info object which i think is not available on python.
>
> I propose to duplicata the interface (lookUp, colorFor, displayNameFor) to
> pass it also a string (mangled name).

Of course, the displayNameFor() is what you want to show the user, and the 
type_info::name() what you use as key for retrieval.

But I just realized that the display name is perfect for the user but no good 
to generate actual code as the display name is changed by hand in some cases,  
and doesn't match programming name for some types (Audio Buffers are 
CLAM::Audio and and AudioStreams are Floats or AudioPorts). 

We can consider them special cases on the dialog.

Maybe we should add new metadata to the type plugins containing the header to 
include and the type as it is called in code.

David.








More information about the clam-devel mailing list