[Sugar-devel] Advice request: XO sound recording
sascha-ml-reply-to-2010-3 at silbe.org
Sun Oct 3 17:19:57 EDT 2010
Excerpts from Art Hunkins's message of Sun Oct 03 21:00:19 +0200 2010:
> Please indicate where, in your wonderful manual (or elsewhere), I can find a
> simple example of retreiving Journal entries. (I cannot readily locate one.)
> I need to retrieve an Ogg Vorbis (.ogg) or other audio file, and insert it
> as a filename string in my script. Presumably this process would be
> instigated by a button press.
What you're looking for is the Object Chooser [1,2]. It doesn't seem to
be mentioned in MYOSA, but there are several activities that use it. One
of them is Turtle Blocks (nee Turtle Art). See
TurtleArtActivity.import_py() . You can tell the Object Chooser what
kind of Journal entries you are interested in by passing it the name of
a "generic MIME type" collection or the bundle ID of an activity in the
what_filter parameter (yes, this API is awkward and could do with some
chooser = ObjectChooser(parent=self, what_filter=mime.GENERIC_TYPE_AUDIO)
The MIME type collections are defined in sugar.mime . Currently
supported types include text, images, audio, video and links. There is
no way to filter for a single MIME type (e.g. only Ogg Vorbis audio
files) or anything else than the predefined collections.
PS: Please remember to trim your quotes.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 490 bytes
Desc: not available
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20101003/554bf2a8/attachment-0001.pgp
More information about the Sugar-devel