[Rhythmbox-devel] Accessing Playlist Data




Hi there,

I'm writing a plugin that enable users to export music files of the selected playlist which is quite similar to the sendto plugin but let you save files directly to the disk.

But I can't find a way to get a reference to the currently selected playlist item.

I did get the reference to the playlist header item as:

display_page_model = shell.props.display_page_model.props.child_model

playlist = [x for x in display_page_model if x[1].props.id == "playlists"][0]
        playlist_iter = playlist.iterchildren()
        for i in playlist_iter:
            playlist_source = i[1]

Here I see AutoPlaylistSource, StaticPlaylistSource objects which seems to be not iterable. I think I'd need to get an array of playback URIs of songs in the selected playlist.

I'm quite new to Gtk and think this as an great opportunity for me learn and contribute. Any help is highly appreciated!

Code: https://github.com/reversiblean/export-playlist/blob/master/export-playlist.py

Thanks,

Gayan





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