public void ScrollTo(AlbumInfo album) { cover_manager.Timeline.Timeout = 500; //give 'm some time to load the song etc. ScrollTo (ClutterFlowAlbum.CreateCacheKey (album)); }
public void SetList (LastfmData<RecentTrack> tracks) { tile_view.ClearWidgets (); foreach (RecentTrack track in tracks) { MenuTile tile = new MenuTile (); widget_track_map [tile] = track; tile.PrimaryText = track.Name; tile.SecondaryText = track.Artist; tile.ButtonPressEvent += OnTileActivated; // Unfortunately the recently loved list doesn't include what album the song is on if (!String.IsNullOrEmpty (track.Album)) { AlbumInfo album = new AlbumInfo (track.Album); album.ArtistName = track.Artist; Gdk.Pixbuf pb = artwork_manager == null ? null : artwork_manager.LookupScalePixbuf (album.ArtworkId, 40); if (pb != null) { tile.Pixbuf = pb; } } tile_view.AddNumberedWidget (tile); } tile_view.ShowAll (); }
private ClutterFlowBaseActor AddActorToList(AlbumInfo generator, SortedList<AlbumInfo, ClutterFlowBaseActor> list, CoverManager cover_manager) { if (generator == null) { generator = new AlbumInfo (AlbumInfo.UnknownAlbumTitle); } string key = ClutterFlowAlbum.CreateCacheKey(generator); ClutterFlowBaseActor actor = null; if (!Cache.TryGetValue (key, out actor)) { actor = new ClutterFlowAlbum (generator, cover_manager); actor.Hide (); Cache.Add (key, actor); } actor.SortLabel = Comparer.GetSortLabel (generator); list[generator] = actor; actor.Index = list.Count; return actor; }