Re: [Rhythmbox-devel] Reading songs list
- From: "James \"Doc\" Livingston" <doclivingston gmail com>
- To: Bartosz Wiklak <bwiklak gmail com>
- Cc: rhythmbox-devel <rhythmbox-devel gnome org>
- Subject: Re: [Rhythmbox-devel] Reading songs list
- Date: Sun, 17 Feb 2008 11:40:45 +1100
On Sat, 2008-02-16 at 23:23 +0100, Bartosz Wiklak wrote:
> I know that by colling
> rhythmdb_entry_get_string(entry,RHYTHMDB_PROP_TITLE) I can get current
> playing song title.
> How can I get list of all songs in library/current playlist?
You can get the library via the following:
g_object_get (shell, "library-source", &source, NULL);
or the playing source via:
g_object_get (shell, "selected-source", &source, NULL);
Then retrieve the RhythmDBQueryModel for the source
g_object_get (source, "query-model", &model, NULL);
A RhythmDBQueryModel is a GtkTreeModel, so you can use normal GTK
functions to access it. What do you want to do with the list of songs?
The best way to get the information out depends on what you want to do.
"To find an elephant using mathematical techniques, remove everything
from your search area that is not an elephant. If you find anything,
then it is, by construction, an elephant, Q.E.D."
] [Thread Prev