Re: [Rhythmbox-devel] how to get a list of all sources


The sourcelist_model is a Gtk.TreeModel (you can find out by using "print shell.props.sourcelist_model.__doc__" and checking the properties inherited from its parents. There are other ways to find it out). You can then use the Gtk documentation in:
Or better yet, use the tutorial:

About Rhythmbox sources, the sourcelist_model is separated in groups. So the rows you'll get are the groups, the first one for Library and the second for Playlists. And the children of these rows are actual sources (the source object is the fourth in the row) . This code make it more clear:

for group in shell.props.sourcelist_model:
    print 'Group name: ', group[2]
    for source in group.iterchildren():
        for props in source:
            print props

There are other ways to access this information, using the sourcelist_model directly, instead of iterating, it all depends on what you want to do.

I hope this helped, having more questions, just ask.

On Jan 27, 2008 7:19 PM, Christian Bünnig <masala web de> wrote:

I am writing an RB plugin in Python and want to get a list of all
playlists/sources .. but I have no idea how to do this. I tried to get
them via the source list model (shell.props.sourcelist_model) but it is
not obvious how to proceed from this point .. any ideas?

I know I could use the file returned by
but the returned file only contains playlists, not the store, radio or
other library sources. Also I do not like the idea to parse an xml file
if I can talk with RB directly.

Thanks in advance for some help!


rhythmbox-devel mailing list
rhythmbox-devel gnome org

Alexandre Rosenfeld

EC06 - USP São Carlos

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]