Exemple #1
0
        public AlbumListView() : base()
        {
            renderer    = new ColumnCellAlbum();
            grid_layout = new DataViewLayoutGrid()
            {
                ChildAllocator = () => new DataViewChildAlbum(),
                View           = this
            };
            grid_layout.ChildCountChanged += (o, e) => {
                var artwork_manager = ServiceManager.Get <ArtworkManager> ();
                if (artwork_manager != null && e.Value > 0)
                {
                    int size = (int)((DataViewChildAlbum)grid_layout[0]).ImageSize;
                    artwork_manager.ChangeCacheSize(size, e.Value);
                }
            };
            ViewLayout = grid_layout;

            DisableAlbumGridPref = new SchemaPreference <bool> (DisableAlbumGrid,
                                                                Catalog.GetString("Disable album grid"),
                                                                Catalog.GetString("Disable album grid and show the classic layout instead"),
                                                                ToggleAlbumGrid);

            ServiceManager.SourceManager.SourceRemoved += UninstallPreferences;
            ServiceManager.SourceManager.SourceAdded   += InstallPreferences;
            if (ServiceManager.SourceManager.MusicLibrary != null)
            {
                InstallPreferences();
            }

            ServiceManager.PlayerEngine.ConnectEvent(OnPlayerEvent, PlayerEvent.TrackInfoUpdated);
            Banshee.Metadata.MetadataService.Instance.ArtworkUpdated += OnArtworkUpdated;
        }
            public ColumnCellAlbumAccessible(object bound_object, ColumnCellAlbum cell, ICellAccessibleParent parent)
                : base(bound_object, cell as ColumnCell, parent)
            {
                var bound_album_info = (AlbumInfo)bound_object;

                Name = String.Format("{0} - {1}", bound_album_info.DisplayTitle, bound_album_info.DisplayArtistName);
            }
 public ColumnCellAlbumAccessible (object bound_object, ColumnCellAlbum cell, ICellAccessibleParent parent)
     : base (bound_object, cell as ColumnCell, parent)
 {
     var bound_album_info = bound_object as AlbumInfo;
     if (bound_album_info != null) {
         Name = String.Format ("{0} - {1}",
                              bound_album_info.DisplayTitle,
                              bound_album_info.DisplayArtistName);
     }
 }
Exemple #4
0
        public AlbumListView() : base()
        {
            ColumnCellAlbum renderer = new ColumnCellAlbum();

            column_controller.Add(new Column("Album", renderer, 1.0));
            ColumnController = column_controller;

            RowHeightProvider = renderer.ComputeRowHeight;

            ServiceManager.PlayerEngine.ConnectEvent(OnPlayerEvent, PlayerEvent.TrackInfoUpdated);
        }