Re: [Rhythmbox-devel] Reading songs list



On Sat, 2008-02-16 at 23:23 +0100, Bartosz Wiklak wrote:
> Hi,
> 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:

	RBSource *source;
	g_object_get (shell, "library-source", &source, NULL);

or the playing source via:

	RBSource *source;
	g_object_get (shell, "selected-source", &source, NULL);

Then retrieve the RhythmDBQueryModel for the source

	RhythmDBQueryModel *model;
	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.


Cheers,

--
"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."




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