[vlc-commits] [Git][videolan/vlc][master] 5 commits: macosx: More strictly define types contained in internal arrays of favorites data source

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Mon Jul 21 11:31:11 UTC 2025



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
2accc679 by Claudio Cambra at 2025-07-21T11:10:47+00:00
macosx: More strictly define types contained in internal arrays of favorites data source

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
a82b3146 by Claudio Cambra at 2025-07-21T11:10:47+00:00
macosx: Present child albums of genres and artists in favorites table view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
c6f92a9d by Claudio Cambra at 2025-07-21T11:10:47+00:00
macosx: Register album table cell view in selection table view for favorites vc

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
83a7b72d by Claudio Cambra at 2025-07-21T11:10:47+00:00
macosx: Implement custom table view delegate for favorites for custom items and sizings

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
6fc3342e by Claudio Cambra at 2025-07-21T11:10:47+00:00
macosx: Ensure horizontal scroller is not shown in favorites library group selection table view scroll view

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


6 changed files:

- extras/package/macosx/VLC.xcodeproj/project.pbxproj
- modules/gui/macosx/Makefile.am
- modules/gui/macosx/library/favorites-library/VLCLibraryFavoritesDataSource.m
- + modules/gui/macosx/library/favorites-library/VLCLibraryFavoritesTableViewDelegate.h
- + modules/gui/macosx/library/favorites-library/VLCLibraryFavoritesTableViewDelegate.m
- modules/gui/macosx/library/favorites-library/VLCLibraryFavoritesViewController.m


Changes:

=====================================
extras/package/macosx/VLC.xcodeproj/project.pbxproj
=====================================
@@ -176,6 +176,7 @@
 		53F7B2372D4D499400F3B38F /* VLCFileDragRecognisingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 53F7B2362D4D499400F3B38F /* VLCFileDragRecognisingView.m */; };
 		53F7B23C2D545FCF00F3B38F /* VLCLibraryAbstractMediaLibrarySegmentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53F7B23B2D545FCF00F3B38F /* VLCLibraryAbstractMediaLibrarySegmentViewController.m */; };
 		53F89E372E23DC4C008080C1 /* VLCLibraryMoviesDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 53F89E362E23DC4C008080C1 /* VLCLibraryMoviesDataSource.m */; };
+		53F89E3A2E2CFB1A008080C1 /* VLCLibraryFavoritesTableViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 53F89E392E2CFB1A008080C1 /* VLCLibraryFavoritesTableViewDelegate.m */; };
 		6B0292E61F43256300A50082 /* VLCBottomBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0292E51F43256300A50082 /* VLCBottomBarView.m */; };
 		6B0AB0F01F1AC8B3003A1B4E /* VLCPlaybackProgressSlider.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0AB0ED1F1AC8B3003A1B4E /* VLCPlaybackProgressSlider.m */; };
 		6B0AB0F11F1AC8B3003A1B4E /* VLCPlaybackProgressSliderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0AB0EF1F1AC8B3003A1B4E /* VLCPlaybackProgressSliderCell.m */; };
@@ -397,8 +398,8 @@
 		536283E3291146BC00640C15 /* VLCLibraryCollectionViewMediaItemSupplementaryDetailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryCollectionViewMediaItemSupplementaryDetailView.m; sourceTree = "<group>"; };
 		536283E5291146BC00640C15 /* VLCLibraryCollectionViewSupplementaryDetailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryCollectionViewSupplementaryDetailView.m; sourceTree = "<group>"; };
 		536283E6291146BC00640C15 /* VLCLibraryCollectionViewSupplementaryDetailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCLibraryCollectionViewSupplementaryDetailView.h; sourceTree = "<group>"; };
-		536283E8291146BC00640C15 /* VLCLibraryCollectionViewMediaItemListSupplementaryDetailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCLibraryCollectionViewMediaItemListSupplementaryDetailView.h; sourceTree = "<group>"; };
 		536283E7291146BC00640C15 /* VLCLibraryCollectionViewAudioGroupSupplementaryDetailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCLibraryCollectionViewAudioGroupSupplementaryDetailView.h; sourceTree = "<group>"; };
+		536283E8291146BC00640C15 /* VLCLibraryCollectionViewMediaItemListSupplementaryDetailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCLibraryCollectionViewMediaItemListSupplementaryDetailView.h; sourceTree = "<group>"; };
 		536283E9291146BC00640C15 /* VLCLibraryCollectionViewAudioGroupSupplementaryDetailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryCollectionViewAudioGroupSupplementaryDetailView.m; sourceTree = "<group>"; };
 		536283EA291146BC00640C15 /* VLCLibraryCollectionViewMediaItemSupplementaryDetailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCLibraryCollectionViewMediaItemSupplementaryDetailView.h; sourceTree = "<group>"; };
 		536283EC291146BC00640C15 /* VLCLibrarySongTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCLibrarySongTableCellView.m; sourceTree = "<group>"; };
@@ -534,6 +535,8 @@
 		53F7B23B2D545FCF00F3B38F /* VLCLibraryAbstractMediaLibrarySegmentViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryAbstractMediaLibrarySegmentViewController.m; sourceTree = "<group>"; };
 		53F89E352E23DC4C008080C1 /* VLCLibraryMoviesDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryMoviesDataSource.h; sourceTree = "<group>"; };
 		53F89E362E23DC4C008080C1 /* VLCLibraryMoviesDataSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryMoviesDataSource.m; sourceTree = "<group>"; };
+		53F89E382E2CFB1A008080C1 /* VLCLibraryFavoritesTableViewDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryFavoritesTableViewDelegate.h; sourceTree = "<group>"; };
+		53F89E392E2CFB1A008080C1 /* VLCLibraryFavoritesTableViewDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryFavoritesTableViewDelegate.m; sourceTree = "<group>"; };
 		5CCED71014C0D4A90057F8D1 /* VLCExtensionsDialogProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCExtensionsDialogProvider.h; sourceTree = "<group>"; };
 		5CCED71114C0D4A90057F8D1 /* VLCExtensionsDialogProvider.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCExtensionsDialogProvider.m; sourceTree = "<group>"; };
 		5CCED71214C0D4A90057F8D1 /* VLCExtensionsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCExtensionsManager.h; sourceTree = "<group>"; };
@@ -1752,10 +1755,12 @@
 		53E511252E1ACB6C0048CEFC /* favorites-library */ = {
 			isa = PBXGroup;
 			children = (
-				53E511262E1AD14A0048CEFC /* VLCLibraryFavoritesViewController.h */,
-				53E511272E1AD14A0048CEFC /* VLCLibraryFavoritesViewController.m */,
 				53E511292E1ADA9F0048CEFC /* VLCLibraryFavoritesDataSource.h */,
 				53E5112A2E1ADA9F0048CEFC /* VLCLibraryFavoritesDataSource.m */,
+				53F89E382E2CFB1A008080C1 /* VLCLibraryFavoritesTableViewDelegate.h */,
+				53F89E392E2CFB1A008080C1 /* VLCLibraryFavoritesTableViewDelegate.m */,
+				53E511262E1AD14A0048CEFC /* VLCLibraryFavoritesViewController.h */,
+				53E511272E1AD14A0048CEFC /* VLCLibraryFavoritesViewController.m */,
 			);
 			path = "favorites-library";
 			sourceTree = "<group>";
@@ -2325,6 +2330,7 @@
 				5317FE04294E3DD3001702F0 /* VLCLibraryCollectionViewDelegate.m in Sources */,
 				536EFC39295E521600F4CB13 /* VLCLibraryVideoViewController.m in Sources */,
 				53ED472B29C8FF9D00795DB1 /* VLCLibraryAlbumTracksTableViewDelegate.m in Sources */,
+				53F89E3A2E2CFB1A008080C1 /* VLCLibraryFavoritesTableViewDelegate.m in Sources */,
 				53628402291147C500640C15 /* VLCBasicView.m in Sources */,
 				7DFBDCAB2269E77F00B700A5 /* VLCLibraryModel.m in Sources */,
 				1CCC89012078A3D500E5626F /* Preferences.xib in Sources */,


=====================================
modules/gui/macosx/Makefile.am
=====================================
@@ -295,6 +295,8 @@ libmacosx_plugin_la_SOURCES = \
 	gui/macosx/library/audio-library/VLCLibrarySongsTableViewSongPlayingTableCellView.m \
 	gui/macosx/library/favorites-library/VLCLibraryFavoritesDataSource.h \
 	gui/macosx/library/favorites-library/VLCLibraryFavoritesDataSource.m \
+	gui/macosx/library/favorites-library/VLCLibraryFavoritesTableViewDelegate.h \
+	gui/macosx/library/favorites-library/VLCLibraryFavoritesTableViewDelegate.m \
 	gui/macosx/library/favorites-library/VLCLibraryFavoritesViewController.h \
 	gui/macosx/library/favorites-library/VLCLibraryFavoritesViewController.m \
 	gui/macosx/library/media-source/VLCLibraryMediaSourceViewController.h \


=====================================
modules/gui/macosx/library/favorites-library/VLCLibraryFavoritesDataSource.m
=====================================
@@ -46,13 +46,14 @@ NSString * const VLCLibraryFavoritesDataSourceDisplayedCollectionChangedNotifica
 
 @interface VLCLibraryFavoritesDataSource ()
 {
-    NSArray *_favoriteVideoMediaArray;
-    NSArray *_favoriteAudioMediaArray;
-    NSArray *_favoriteAlbumsArray;
-    NSArray *_favoriteArtistsArray;
-    NSArray *_favoriteGenresArray;
+    NSArray<VLCMediaLibraryMediaItem *> *_favoriteVideoMediaArray;
+    NSArray<VLCMediaLibraryMediaItem *> *_favoriteAudioMediaArray;
+    NSArray<VLCMediaLibraryAlbum *> *_favoriteAlbumsArray;
+    NSArray<VLCMediaLibraryArtist *> *_favoriteArtistsArray;
+    NSArray<VLCMediaLibraryGenre *> *_favoriteGenresArray;
     VLCLibraryCollectionViewFlowLayout *_collectionViewFlowLayout;
     NSArray<NSNumber *> *_visibleSectionMapping; // Maps visible sections to VLCLibraryFavoritesSection values
+    NSMutableDictionary<NSNumber *, NSArray<id<VLCMediaLibraryItemProtocol>> *> *_flattenedRowMappings; // Maps row indices to items for flattened artist/genre views
 }
 
 @end
@@ -63,12 +64,13 @@ NSString * const VLCLibraryFavoritesDataSourceDisplayedCollectionChangedNotifica
 {
     self = [super init];
     if (self) {
+        _flattenedRowMappings = [NSMutableDictionary dictionary];
         [self connect];
     }
     return self;
 }
 
-- (NSArray *)arrayForSection:(VLCLibraryFavoritesSection)section
+- (NSArray<id<VLCMediaLibraryItemProtocol>> *)arrayForSection:(VLCLibraryFavoritesSection)section
 {
     switch (section) {
         case VLCLibraryFavoritesSectionVideoMedia:
@@ -196,6 +198,21 @@ NSString * const VLCLibraryFavoritesDataSourceDisplayedCollectionChangedNotifica
                                                     withMediaItems:[mediaItems copy]];
 }
 
+- (NSArray *)buildFlattenedArrayForAudioGroupSection:(VLCLibraryFavoritesSection)section
+{
+    NSParameterAssert([self isAudioGroupSection:section]);
+    NSArray<id<VLCMediaLibraryAudioGroupProtocol>> * const sectionArray = 
+        (NSArray<id<VLCMediaLibraryAudioGroupProtocol>> *)[self arrayForSection:section];
+    NSMutableArray * const flattenedArray = [NSMutableArray array];
+    
+    for (id<VLCMediaLibraryAudioGroupProtocol> audioGroup in sectionArray) {
+        [flattenedArray addObject:audioGroup];
+        [flattenedArray addObjectsFromArray:audioGroup.albums];
+    }
+    
+    return [flattenedArray copy];
+}
+
 #pragma mark - Notification handlers
 
 - (void)libraryModelFavoriteVideoMediaListReset:(NSNotification * const)notification
@@ -273,6 +290,8 @@ NSString * const VLCLibraryFavoritesDataSourceDisplayedCollectionChangedNotifica
     _favoriteGenresArray = [self.libraryModel listOfFavoriteGenres];
 
     [self updateVisibleSectionMapping];
+    
+    [_flattenedRowMappings removeAllObjects];
 
     if (self.masterTableView.dataSource == self) {
         [self.masterTableView reloadData];
@@ -297,6 +316,18 @@ NSString * const VLCLibraryFavoritesDataSourceDisplayedCollectionChangedNotifica
         return _visibleSectionMapping.count;
     } else if (tableView == self.detailTableView && self.masterTableView.selectedRow > -1) {
         const VLCLibraryFavoritesSection section = [self sectionForVisibleIndex:self.masterTableView.selectedRow];
+        
+        // For artist and genre sections, return the flattened count
+        if ([self isAudioGroupSection:section]) {
+            NSArray * const flattenedArray = _flattenedRowMappings[@(section)];
+            if (flattenedArray) {
+                return flattenedArray.count;
+            }
+            NSArray * const newFlattenedArray = [self buildFlattenedArrayForAudioGroupSection:section];
+            _flattenedRowMappings[@(section)] = newFlattenedArray;
+            return newFlattenedArray.count;
+        }
+        
         return [self arrayForSection:section].count;
     }
     
@@ -314,14 +345,20 @@ NSString * const VLCLibraryFavoritesDataSourceDisplayedCollectionChangedNotifica
 {
     if (tableView == self.masterTableView) {
         // For master table, return a group descriptor object
-        if (row >= 0 && row < _visibleSectionMapping.count) {
-            const VLCLibraryFavoritesSection section = [self sectionForVisibleIndex:row];
-            return [self createGroupDescriptorForSection:section];
-        }
+        NSParameterAssert(row >= 0 && row < _visibleSectionMapping.count);
+        return [self createGroupDescriptorForSection:[self sectionForVisibleIndex:row]];
     } else if (tableView == self.detailTableView && self.masterTableView.selectedRow > -1) {
-        VLCLibraryFavoritesSection section = [self sectionForVisibleIndex:self.masterTableView.selectedRow];
-        NSArray * const sectionArray = [self arrayForSection:section];
-        if (row >= 0 && row < sectionArray.count) {
+        const VLCLibraryFavoritesSection section = [self sectionForVisibleIndex:self.masterTableView.selectedRow];
+        
+        // For artist and genre sections, use the flattened array
+        if ([self isAudioGroupSection:section]) {
+            NSArray<id<VLCMediaLibraryItemProtocol>> * const flattenedArray = _flattenedRowMappings[@(section)];
+            NSParameterAssert(flattenedArray && row < flattenedArray.count);
+            return flattenedArray[row];
+        } else {
+            // For other sections, use the regular array
+            NSArray<id<VLCMediaLibraryItemProtocol>> * const sectionArray = [self arrayForSection:section];
+            NSParameterAssert(sectionArray && row >= 0 && row < sectionArray.count);
             return sectionArray[row];
         }
     }


=====================================
modules/gui/macosx/library/favorites-library/VLCLibraryFavoritesTableViewDelegate.h
=====================================
@@ -0,0 +1,33 @@
+/*****************************************************************************
+ * VLCLibraryFavoritesTableViewDelegate.h: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2025 VLC authors and VideoLAN
+ *
+ * Authors: Claudio Cambra <developer at claudiocambra.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import <Cocoa/Cocoa.h>
+
+#import "library/VLCLibraryMasterDetailViewTableViewDelegate.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+ at interface VLCLibraryFavoritesTableViewDelegate : VLCLibraryMasterDetailViewTableViewDelegate
+
+ at end
+
+NS_ASSUME_NONNULL_END
\ No newline at end of file


=====================================
modules/gui/macosx/library/favorites-library/VLCLibraryFavoritesTableViewDelegate.m
=====================================
@@ -0,0 +1,87 @@
+/*****************************************************************************
+ * VLCLibraryFavoritesTableViewDelegate.m: MacOS X interface module
+ *****************************************************************************
+ * Copyright (C) 2025 VLC authors and VideoLAN
+ *
+ * Authors: Claudio Cambra <developer at claudiocambra.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#import "VLCLibraryFavoritesTableViewDelegate.h"
+#include <Foundation/Foundation.h>
+
+#import "library/VLCLibraryDataTypes.h"
+#import "library/VLCLibraryRepresentedItem.h"
+#import "library/VLCLibraryTableCellView.h"
+#import "library/VLCLibraryTableCellViewProtocol.h"
+#import "library/VLCLibraryTableViewDataSource.h"
+#import "library/audio-library/VLCLibraryAlbumTableCellView.h"
+
+ at implementation VLCLibraryFavoritesTableViewDelegate
+
+- (NSView *)tableView:(NSTableView *)tableView
+   viewForTableColumn:(NSTableColumn *)tableColumn
+                  row:(NSInteger)row
+{
+    if (![tableView.dataSource conformsToProtocol:@protocol(VLCLibraryTableViewDataSource)]) {
+        return [super tableView:tableView viewForTableColumn:tableColumn row:row];
+    }
+
+    NSObject<VLCLibraryTableViewDataSource> * const vlcDataSource = 
+        (NSObject<VLCLibraryTableViewDataSource>*)tableView.dataSource;
+    NSAssert(vlcDataSource != nil, @"Should be a valid data source");
+
+    id<VLCMediaLibraryItemProtocol> const libraryItem =
+        [vlcDataSource libraryItemAtRow:row forTableView:tableView];
+    if (libraryItem == nil)
+        return nil;
+
+    VLCLibraryRepresentedItem * const representedItem = 
+        [[VLCLibraryRepresentedItem alloc] initWithItem:libraryItem
+                                             parentType:vlcDataSource.currentParentType];
+
+    const BOOL isAlbum = [libraryItem isKindOfClass:VLCMediaLibraryAlbum.class];
+
+    NSString * const cellIdentifier =
+        isAlbum ? VLCAudioLibraryCellIdentifier : VLCLibraryTableCellViewIdentifier;
+    NSView<VLCLibraryTableCellViewProtocol> * const cellView =
+        (NSView<VLCLibraryTableCellViewProtocol> *)[tableView makeViewWithIdentifier:cellIdentifier 
+                                                                               owner:self];
+    if (cellView == nil)
+        return [super tableView:tableView viewForTableColumn:tableColumn row:row];
+
+    [cellView setRepresentedItem:representedItem];
+    return cellView;
+}
+
+- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row
+{
+    if (![tableView.dataSource conformsToProtocol:@protocol(VLCLibraryTableViewDataSource)]) {
+        return tableView.rowHeight;
+    }
+
+    NSObject<VLCLibraryTableViewDataSource> * const vlcDataSource = 
+        (NSObject<VLCLibraryTableViewDataSource>*)tableView.dataSource;
+    id<VLCMediaLibraryItemProtocol> const libraryItem = [vlcDataSource libraryItemAtRow:row 
+                                                                           forTableView:tableView];
+
+    if ([libraryItem isKindOfClass:VLCMediaLibraryAlbum.class]) {
+        return VLCLibraryAlbumTableCellView.defaultHeight;
+    }
+    return tableView.rowHeight;
+}
+
+ at end
\ No newline at end of file


=====================================
modules/gui/macosx/library/favorites-library/VLCLibraryFavoritesViewController.m
=====================================
@@ -40,12 +40,14 @@
 #import "library/VLCLibraryWindow.h"
 #import "library/VLCLibraryWindowPersistentPreferences.h"
 #import "library/favorites-library/VLCLibraryFavoritesDataSource.h"
+#import "library/favorites-library/VLCLibraryFavoritesTableViewDelegate.h"
+#import "library/audio-library/VLCLibraryAlbumTableCellView.h"
 #import "library/audio-library/VLCLibraryCollectionViewAudioGroupSupplementaryDetailView.h"
 #import "main/VLCMain.h"
 
 @interface VLCLibraryFavoritesViewController ()
 {
-    VLCLibraryMasterDetailViewTableViewDelegate *_favoritesLibraryTableViewDelegate;
+    VLCLibraryFavoritesTableViewDelegate *_favoritesLibraryTableViewDelegate;
     VLCLibraryTwoPaneSplitViewDelegate *_splitViewDelegate;
     VLCLibraryCollectionViewDelegate *_collectionViewDelegate;
     VLCLibraryCollectionViewFlowLayout *_collectionViewLayout;
@@ -63,7 +65,7 @@
     self = [super initWithLibraryWindow:libraryWindow];
     
     if (self) {
-        _favoritesLibraryTableViewDelegate = [[VLCLibraryMasterDetailViewTableViewDelegate alloc] init];
+        _favoritesLibraryTableViewDelegate = [[VLCLibraryFavoritesTableViewDelegate alloc] init];
         _splitViewDelegate = [[VLCLibraryTwoPaneSplitViewDelegate alloc] init];
         
         [self setupProperties];
@@ -109,15 +111,23 @@
         [[NSNib alloc] initWithNibNamed:NSStringFromClass(VLCLibraryTableCellView.class)
                                  bundle:nil];
     [self.favoritesLibraryGroupsTableView registerNib:tableCellViewNib
-                                        forIdentifier:@"VLCLibraryTableViewCellIdentifier"];
+                                        forIdentifier:VLCLibraryTableCellViewIdentifier];
     [self.favoritesLibraryGroupSelectionTableView registerNib:tableCellViewNib 
-                                                forIdentifier:@"VLCLibraryTableViewCellIdentifier"];
+                                                forIdentifier:VLCLibraryTableCellViewIdentifier];
+    
+    // Register album cell view for artist/genre sections
+    NSNib * const albumCellViewNib =
+        [[NSNib alloc] initWithNibNamed:NSStringFromClass(VLCLibraryAlbumTableCellView.class)
+                                 bundle:nil];
+    [self.favoritesLibraryGroupSelectionTableView registerNib:albumCellViewNib
+                                                forIdentifier:VLCAudioLibraryCellIdentifier];
     
     self.favoritesLibraryGroupsTableView.headerView = nil;
     self.favoritesLibraryGroupSelectionTableView.headerView = nil;
     
     self.favoritesLibraryGroupsTableView.rowHeight = VLCLibraryUIUnits.mediumTableViewRowHeight;
     self.favoritesLibraryGroupSelectionTableView.rowHeight = VLCLibraryUIUnits.mediumTableViewRowHeight;
+                                                
 }
 
 - (void)setupCollectionView
@@ -225,6 +235,7 @@
     self.favoritesLibraryGroupSelectionTableViewScrollView.automaticallyAdjustsContentInsets = NO;
     self.favoritesLibraryGroupSelectionTableViewScrollView.contentInsets = defaultInsets;
     self.favoritesLibraryGroupSelectionTableViewScrollView.scrollerInsets = scrollerInsets;
+    self.favoritesLibraryGroupSelectionTableViewScrollView.hasHorizontalScroller = NO;
 
     self.favoritesLibraryGroupsTableViewScrollView.documentView = self.favoritesLibraryGroupsTableView;
     self.favoritesLibraryGroupSelectionTableViewScrollView.documentView = self.favoritesLibraryGroupSelectionTableView;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8fa23df284bf9a8eefb2095f794cc78de3a1a4e8...6fc3342e8a1712e1b9028e4006f70a76b0ab9e0e

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/8fa23df284bf9a8eefb2095f794cc78de3a1a4e8...6fc3342e8a1712e1b9028e4006f70a76b0ab9e0e
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list