本文整理汇总了C#中Banshee.Collection.TrackInfo.Update方法的典型用法代码示例。如果您正苦于以下问题:C# TrackInfo.Update方法的具体用法?C# TrackInfo.Update怎么用?C# TrackInfo.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Banshee.Collection.TrackInfo
的用法示例。
在下文中一共展示了TrackInfo.Update方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FetchMetadata
void FetchMetadata(TrackInfo track, int fpid)
{
var request = new LastfmRequest ("track.getFingerprintMetadata");
request.AddParameter ("fingerprintid", fpid.ToString ());
request.Send ();
var response = request.GetResponseObject ();
if (response == null)
return;
var json_tracks = (JsonObject)response["tracks"];
var obj_track = json_tracks["track"];
JsonObject json_track = null;
if (obj_track is JsonArray)
json_track = (JsonObject) (((JsonArray)obj_track)[0]);
else if (obj_track is JsonObject)
json_track = (JsonObject)obj_track;
if (json_track !=null) {
track.TrackTitle = (string)json_track["name"];
track.MusicBrainzId = (string)json_track["mbid"];
track.MoreInfoUri = new SafeUri ((string)json_track["url"]);
var json_artist = (JsonObject)json_track["artist"];
if (json_artist != null) {
track.ArtistName = (string)json_artist["name"];
track.ArtistMusicBrainzId = (string)json_artist["mbid"];
}
GetMoreInfo (track);
track.Update ();
if (track == ServiceManager.PlayerEngine.CurrentTrack)
ServiceManager.PlayerEngine.TrackInfoUpdated ();
}
}