First you need banshee's DatabaseTrackModelProvider which can be found in Banshee.Collection.Database. One way of accessing the DatabaseTrackModelProvider<DatabaseTrackInfo> is using the static attribute Provider in DatabaseTrackInfo.
With this provider it is possible to get the TrackInfo for a track with a certain id using the following code:
TrackInfo ti = DatabaseTrackInfo.Provider.FetchSingle (bid) as TrackInfo;
with bid being the ID used by banshee. In other words bid equals DatabaseTrackInfo.Provider.FetchSingle (bid).TrackId.
The provider can also be used for iterating over all tracks in banshee's database.
foreach (DatabaseTrackInfo dti in DatabaseTrackInfo.Provider.FetchAll ()) { // do something with dti }
No comments:
Post a Comment