[PD-dev] info classes

Jonathan Wilkes jancsika at yahoo.com
Thu Nov 15 08:34:40 CET 2012


Here is a quick snapshot of a bundle of classes I'm working on to
provide a standardized way to get properties from parts of pd
that aren't "objectified":

[canvasinfo] get the properties of a canvas
[pdinfo] get info about the running Pd instance
[classinfo] info on a class (still under construction)

I currently have them below [print] in x_interface.c from 0.43, so you
can just drop it in and compile with Pd Vanilla if you want to check it
out.  (I'll make a patch later.)


The props for [canvasinfo] are from my patch on the tracker that adds
a "get" method to canvas.  The nice thing about this particular

interface is that there is only one class per domain which makes
it much easier IMO to learn and remember the tools you need to
inspect data (vs the one class per property approach which I find
cumbersome).  For example, a bang to canvasinfo or pdinfo will print
out a complete sequence of all properties and their values to the
Pd window, so one doesn't even have to memorize the methods in
order to see the values.  Incoming messages are done "pack" style,
so that "symbol method" and "method" work the same, and with
[canvasinfo] "A_SYMBOL A_FLOAT" messages get distributed among
the inlets as lists do.


I only have "dsp" and "version" properties for [pdinfo] so far.  I'm curious
what else would be useful.

[classinfo] just tells whether the incoming symbol is one that will create
an object that is already loaded.  I'm not sure what an incoming bang
would do here, or what more information would be useful.  Actually I
think [declare -lib blah] fails silently, so you could use this as a way to
"catch" missing objects and specify an alternative.


I stole some code from IOhannes to get canvas args without digging
into the innards of g_canvas.c. :)


-Jonathan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: info.zip
Type: application/zip
Size: 4746 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20121114/b78b570b/attachment.zip>


More information about the Pd-dev mailing list