diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj b/extras/package/macosx/VLC.xcodeproj/project.pbxproj index a2f622d02f0c41f46f9b7ba807a7432d873f7b12..33b07afb76d51dd46cb9f6ae4816543275cdfda1 100644 --- a/extras/package/macosx/VLC.xcodeproj/project.pbxproj +++ b/extras/package/macosx/VLC.xcodeproj/project.pbxproj @@ -148,6 +148,9 @@ 7DC21A7422049A6600F98A02 /* VLCOpenInputMetadata.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DC21A7322049A6600F98A02 /* VLCOpenInputMetadata.m */; }; 7DD2F5C52081B73B007EE187 /* VLCRemoteControlService.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DD2F5C42081B73B007EE187 /* VLCRemoteControlService.m */; }; 7DE9C7DD220728420089108F /* VLCPlayerController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DE9C7DC220728420089108F /* VLCPlayerController.m */; }; + 7DFBDCA82269E77500B700A5 /* VLCLibraryController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DFBDCA72269E77500B700A5 /* VLCLibraryController.m */; }; + 7DFBDCAB2269E77F00B700A5 /* VLCLibraryModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DFBDCAA2269E77F00B700A5 /* VLCLibraryModel.m */; }; + 7DFBDCAE2269ED0C00B700A5 /* VLCLibraryDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DFBDCAD2269ED0C00B700A5 /* VLCLibraryDataSource.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -503,6 +506,12 @@ 7DF812EE1B555A340052293C /* VLCPlaybackContinuityController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCPlaybackContinuityController.m; sourceTree = "<group>"; }; 7DF812EF1B555C8E0052293C /* VLCKeyboardBacklightControl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCKeyboardBacklightControl.h; sourceTree = "<group>"; }; 7DF812F01B555C8E0052293C /* VLCKeyboardBacklightControl.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCKeyboardBacklightControl.m; sourceTree = "<group>"; }; + 7DFBDCA62269E77400B700A5 /* VLCLibraryController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryController.h; sourceTree = "<group>"; }; + 7DFBDCA72269E77500B700A5 /* VLCLibraryController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryController.m; sourceTree = "<group>"; }; + 7DFBDCA92269E77F00B700A5 /* VLCLibraryModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryModel.h; sourceTree = "<group>"; }; + 7DFBDCAA2269E77F00B700A5 /* VLCLibraryModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryModel.m; sourceTree = "<group>"; }; + 7DFBDCAC2269ED0C00B700A5 /* VLCLibraryDataSource.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryDataSource.h; sourceTree = "<group>"; }; + 7DFBDCAD2269ED0C00B700A5 /* VLCLibraryDataSource.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryDataSource.m; sourceTree = "<group>"; }; 8E49720006417F6800370C9F /* VLCInformationWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCInformationWindowController.h; sourceTree = "<group>"; }; 8E49720106417F6800370C9F /* VLCInformationWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VLCInformationWindowController.m; sourceTree = "<group>"; }; 8E55FB7F0459B0FD00FB3317 /* VLCOutput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCOutput.h; sourceTree = "<group>"; }; @@ -909,6 +918,12 @@ 7D0F64042202047900FDB91F /* VLCLibraryCollectionViewItem.m */, 7D713D302201AE350042BEB7 /* VLCLibraryWindow.h */, 7D713D312201AE350042BEB7 /* VLCLibraryWindow.m */, + 7DFBDCA62269E77400B700A5 /* VLCLibraryController.h */, + 7DFBDCA72269E77500B700A5 /* VLCLibraryController.m */, + 7DFBDCA92269E77F00B700A5 /* VLCLibraryModel.h */, + 7DFBDCAA2269E77F00B700A5 /* VLCLibraryModel.m */, + 7DFBDCAC2269ED0C00B700A5 /* VLCLibraryDataSource.h */, + 7DFBDCAD2269ED0C00B700A5 /* VLCLibraryDataSource.m */, ); path = library; sourceTree = "<group>"; @@ -1487,6 +1502,7 @@ 1CCC88EE2078A3D500E5626F /* VLCStatusBarIconMainMenu.xib in Sources */, 1CCC88EF2078A3D500E5626F /* VLCFullScreenPanel.xib in Sources */, 1CCC88F02078A3D500E5626F /* About.xib in Sources */, + 7DFBDCA82269E77500B700A5 /* VLCLibraryController.m in Sources */, 1CCC88F12078A3D500E5626F /* AddonManager.xib in Sources */, 1CCC88F22078A3D500E5626F /* AudioEffects.xib in Sources */, 1CCC88F32078A3D500E5626F /* VideoEffects.xib in Sources */, @@ -1504,6 +1520,7 @@ 1CCC88FD2078A3D500E5626F /* Open.xib in Sources */, 1CCC88FE2078A3D500E5626F /* PlaylistAccessoryView.xib in Sources */, 1CCC89002078A3D500E5626F /* PopupPanel.xib in Sources */, + 7DFBDCAB2269E77F00B700A5 /* VLCLibraryModel.m in Sources */, 1CCC89012078A3D500E5626F /* Preferences.xib in Sources */, 7DC21A7422049A6600F98A02 /* VLCOpenInputMetadata.m in Sources */, 1CCC89022078A3D500E5626F /* ResumeDialog.xib in Sources */, @@ -1578,6 +1595,7 @@ 1C3113D11E508C6900D4DD76 /* prefs.m in Sources */, 1C3113D31E508C6900D4DD76 /* VLCResumeDialogController.m in Sources */, 1C3113D51E508C6900D4DD76 /* VLCTextfieldPanelController.m in Sources */, + 7DFBDCAE2269ED0C00B700A5 /* VLCLibraryDataSource.m in Sources */, 1C3113D71E508C6900D4DD76 /* VLCPopupPanelController.m in Sources */, 7D445D8B22032B9200263D34 /* VLCPlaylistTableView.m in Sources */, 1C3113D91E508C6900D4DD76 /* VLCSimplePrefsController.m in Sources */, diff --git a/modules/gui/macosx/Makefile.am b/modules/gui/macosx/Makefile.am index 44c6c6f645d994314bc4d5d283a7eb937a5ccc89..4d8f33a5f654854dcf52daa61e4cb1973cad6bd1 100644 --- a/modules/gui/macosx/Makefile.am +++ b/modules/gui/macosx/Makefile.am @@ -46,6 +46,12 @@ libmacosx_plugin_la_SOURCES = \ gui/macosx/imported/SPMediaKeyTap/SPMediaKeyTap.m \ gui/macosx/library/VLCLibraryCollectionViewItem.h \ gui/macosx/library/VLCLibraryCollectionViewItem.m \ + gui/macosx/library/VLCLibraryController.h \ + gui/macosx/library/VLCLibraryController.m \ + gui/macosx/library/VLCLibraryDataSource.h \ + gui/macosx/library/VLCLibraryDataSource.m \ + gui/macosx/library/VLCLibraryModel.h \ + gui/macosx/library/VLCLibraryModel.m \ gui/macosx/library/VLCLibraryWindow.h \ gui/macosx/library/VLCLibraryWindow.m \ gui/macosx/main/CompatibilityFixes.h \ diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.h b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.h index e4b46e6b7dead983e61b50916fe8e604c14453bc..337acf1fee264b75cf4577a344e65beaf43c04ef 100644 --- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.h +++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.h @@ -24,6 +24,8 @@ NS_ASSUME_NONNULL_BEGIN +extern NSString *VLCLibraryCellIdentifier; + @interface VLCLibraryCollectionViewItem : NSCollectionViewItem @property (readwrite, assign) IBOutlet NSTextField *mediaTitleTextField; diff --git a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m index f3ff065d72e808561759cc4bc6c6f9099e5533e1..82255b6e6d62e0424b4d917c5d4a76cf1d5ab17d 100644 --- a/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m +++ b/modules/gui/macosx/library/VLCLibraryCollectionViewItem.m @@ -22,6 +22,8 @@ #import "VLCLibraryCollectionViewItem.h" +NSString *VLCLibraryCellIdentifier = @"VLCLibraryCellIdentifier"; + @implementation VLCLibraryCollectionViewItem @end diff --git a/modules/gui/macosx/library/VLCLibraryController.h b/modules/gui/macosx/library/VLCLibraryController.h new file mode 100644 index 0000000000000000000000000000000000000000..b5725e712c413292d7c529357c8868ebf73f20af --- /dev/null +++ b/modules/gui/macosx/library/VLCLibraryController.h @@ -0,0 +1,35 @@ +/***************************************************************************** + * VLCLibraryController.h: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2019 VLC authors and VideoLAN + * + * Authors: Felix Paul Kühne <fkuehne # videolan -dot- org> + * + * 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 <Foundation/Foundation.h> + +@class VLCLibraryModel; + +NS_ASSUME_NONNULL_BEGIN + +@interface VLCLibraryController : NSObject + +@property (readonly) VLCLibraryModel *libraryModel; + +@end + +NS_ASSUME_NONNULL_END diff --git a/modules/gui/macosx/library/VLCLibraryController.m b/modules/gui/macosx/library/VLCLibraryController.m new file mode 100644 index 0000000000000000000000000000000000000000..cb75184549ac23f1f28ce22fcb98a5fbd72e7163 --- /dev/null +++ b/modules/gui/macosx/library/VLCLibraryController.m @@ -0,0 +1,89 @@ +/***************************************************************************** + * VLCLibraryController.m: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2019 VLC authors and VideoLAN + * + * Authors: Felix Paul Kühne <fkuehne # videolan -dot- org> + * + * 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 "VLCLibraryController.h" + +#import "main/VLCMain.h" +#import "playlist/VLCPlayerController.h" +#import "library/VLCLibraryModel.h" + +#import <vlc_media_library.h> + +@interface VLCLibraryController() +{ + vlc_medialibrary_t *_p_libraryInstance; +} +@end + +@implementation VLCLibraryController + +- (instancetype)init +{ + self = [super init]; + if (self) { + _p_libraryInstance = vlc_ml_instance_get(getIntf()); + _libraryModel = [[VLCLibraryModel alloc] init]; + + NSNotificationCenter *defaultNotificationCenter = [NSNotificationCenter defaultCenter]; + [defaultNotificationCenter addObserver:self + selector:@selector(applicationWillEnterBackground:) + name:NSApplicationWillResignActiveNotification + object:nil]; + [defaultNotificationCenter addObserver:self + selector:@selector(applicationWillBecomeActive:) + name:NSApplicationWillBecomeActiveNotification + object:nil]; + [defaultNotificationCenter addObserver:self + selector:@selector(playbackStateChanged:) + name:VLCPlayerStateChanged + object:nil]; + } + return self; +} + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + _p_libraryInstance = NULL; +} + +- (void)applicationWillEnterBackground:(NSNotification *)aNotification +{ + vlc_ml_resume_background(_p_libraryInstance); +} + +- (void)applicationWillBecomeActive:(NSNotification *)aNotification +{ + vlc_ml_pause_background(_p_libraryInstance); +} + +- (void)playbackStateChanged:(NSNotification *)aNotification +{ + VLCPlayerController *playerController = aNotification.object; + if (playerController.playerState == VLC_PLAYER_STATE_PLAYING) { + vlc_ml_pause_background(_p_libraryInstance); + } else { + vlc_ml_resume_background(_p_libraryInstance); + } +} + +@end diff --git a/modules/gui/macosx/library/VLCLibraryDataSource.h b/modules/gui/macosx/library/VLCLibraryDataSource.h new file mode 100644 index 0000000000000000000000000000000000000000..94ef80572e99a58c2b77e162b647146157d6244d --- /dev/null +++ b/modules/gui/macosx/library/VLCLibraryDataSource.h @@ -0,0 +1,31 @@ +/***************************************************************************** + * VLCLibraryDataSource.h: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2019 VLC authors and VideoLAN + * + * Authors: Felix Paul Kühne <fkuehne # videolan -dot- org> + * + * 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> + +NS_ASSUME_NONNULL_BEGIN + +@interface VLCLibraryDataSource : NSObject <NSCollectionViewDataSource, NSCollectionViewDelegate> + +@end + +NS_ASSUME_NONNULL_END diff --git a/modules/gui/macosx/library/VLCLibraryDataSource.m b/modules/gui/macosx/library/VLCLibraryDataSource.m new file mode 100644 index 0000000000000000000000000000000000000000..19c7604f06805218582418ff04737eb20dfd39c9 --- /dev/null +++ b/modules/gui/macosx/library/VLCLibraryDataSource.m @@ -0,0 +1,49 @@ +/***************************************************************************** + * VLCLibraryDataSource.m: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2019 VLC authors and VideoLAN + * + * Authors: Felix Paul Kühne <fkuehne # videolan -dot- org> + * + * 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 "VLCLibraryDataSource.h" + +#import "library/VLCLibraryCollectionViewItem.h" + +@implementation VLCLibraryDataSource + +- (NSInteger)collectionView:(NSCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section +{ + return 2; +} + +- (NSCollectionViewItem *)collectionView:(NSCollectionView *)collectionView itemForRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath +{ + VLCLibraryCollectionViewItem *viewItem = [collectionView makeItemWithIdentifier:VLCLibraryCellIdentifier forIndexPath:indexPath]; + + viewItem.mediaTitleTextField.stringValue = @"Custom Cell Label Text"; + viewItem.mediaImageView.image = [NSImage imageNamed: @"noart.png"]; + + return viewItem; +} + +- (void)collectionView:(NSCollectionView *)collectionView didSelectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths +{ + NSLog(@"library selection changed: %@", indexPaths); +} + +@end diff --git a/modules/gui/macosx/library/VLCLibraryModel.h b/modules/gui/macosx/library/VLCLibraryModel.h new file mode 100644 index 0000000000000000000000000000000000000000..abbf18608971484e3fb6b6fc2972c4b010a9531b --- /dev/null +++ b/modules/gui/macosx/library/VLCLibraryModel.h @@ -0,0 +1,35 @@ +/***************************************************************************** + * VLCLibraryModel.h: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2019 VLC authors and VideoLAN + * + * Authors: Felix Paul Kühne <fkuehne # videolan -dot- org> + * + * 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 <Foundation/Foundation.h> + +#import <vlc_media_library.h> + +NS_ASSUME_NONNULL_BEGIN + +@interface VLCLibraryModel : NSObject + +- (instancetype)initWithLibrary:(vlc_medialibrary_t *)library; + +@end + +NS_ASSUME_NONNULL_END diff --git a/modules/gui/macosx/library/VLCLibraryModel.m b/modules/gui/macosx/library/VLCLibraryModel.m new file mode 100644 index 0000000000000000000000000000000000000000..a4544b15983275bf8c6cb25147be1181de2622a0 --- /dev/null +++ b/modules/gui/macosx/library/VLCLibraryModel.m @@ -0,0 +1,42 @@ +/***************************************************************************** + * VLCLibraryModel.m: MacOS X interface module + ***************************************************************************** + * Copyright (C) 2019 VLC authors and VideoLAN + * + * Authors: Felix Paul Kühne <fkuehne # videolan -dot- org> + * + * 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 "VLCLibraryModel.h" + +@interface VLCLibraryModel () +{ + vlc_medialibrary_t *_p_mediaLibrary; +} +@end + +@implementation VLCLibraryModel + +- (instancetype)initWithLibrary:(vlc_medialibrary_t *)library +{ + self = [super init]; + if (self) { + _p_mediaLibrary = library; + } + return self; +} + +@end diff --git a/modules/gui/macosx/library/VLCLibraryWindow.h b/modules/gui/macosx/library/VLCLibraryWindow.h index c81f371a03aeb5f966bac5118c1c9c030c80d583..3d4a208142ee9ae448ddc5402429390f1a48ebcc 100644 --- a/modules/gui/macosx/library/VLCLibraryWindow.h +++ b/modules/gui/macosx/library/VLCLibraryWindow.h @@ -47,8 +47,4 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface VLCLibraryDataSource : NSObject <NSCollectionViewDataSource, NSCollectionViewDelegate> - -@end - NS_ASSUME_NONNULL_END diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m b/modules/gui/macosx/library/VLCLibraryWindow.m index c0b050d072bf11dc04a0c823e19526a91c788709..c0067170a6f9a39d8b09bd7b351cf7ec4455decf 100644 --- a/modules/gui/macosx/library/VLCLibraryWindow.m +++ b/modules/gui/macosx/library/VLCLibraryWindow.m @@ -22,13 +22,15 @@ #import "VLCLibraryWindow.h" #import "extensions/NSString+Helpers.h" -#import "library/VLCLibraryCollectionViewItem.h" #import "main/VLCMain.h" #import "playlist/VLCPlaylistTableCellView.h" #import "playlist/VLCPlaylistController.h" #import "playlist/VLCPlaylistDataSource.h" +#import "library/VLCLibraryDataSource.h" +#import "library/VLCLibraryCollectionViewItem.h" + #import "windows/mainwindow/VLCControlsBarCommon.h" #import "windows/video/VLCFSPanelController.h" #import "windows/video/VLCVoutView.h" @@ -37,8 +39,6 @@ static const float f_min_window_width = 604.; static const float f_min_window_height = 307.; static const float f_playlist_row_height = 72.; -static NSString *VLCLibraryCellIdentifier = @"VLCLibraryCellIdentifier"; - @interface VLCLibraryWindow () { VLCPlaylistDataSource *_playlistDataSource; @@ -176,30 +176,6 @@ static NSString *VLCLibraryCellIdentifier = @"VLCLibraryCellIdentifier"; @end -@implementation VLCLibraryDataSource - -- (NSInteger)collectionView:(NSCollectionView *)collectionView numberOfItemsInSection:(NSInteger)section -{ - return 2; -} - -- (NSCollectionViewItem *)collectionView:(NSCollectionView *)collectionView itemForRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath -{ - VLCLibraryCollectionViewItem *viewItem = [collectionView makeItemWithIdentifier:VLCLibraryCellIdentifier forIndexPath:indexPath]; - - viewItem.mediaTitleTextField.stringValue = @"Custom Cell Label Text"; - viewItem.mediaImageView.image = [NSImage imageNamed: @"noart.png"]; - - return viewItem; -} - -- (void)collectionView:(NSCollectionView *)collectionView didSelectItemsAtIndexPaths:(NSSet<NSIndexPath *> *)indexPaths -{ - NSLog(@"library selection changed: %@", indexPaths); -} - -@end - @implementation VLCLibraryWindowController - (instancetype)initWithLibraryWindow diff --git a/modules/gui/macosx/main/VLCMain.h b/modules/gui/macosx/main/VLCMain.h index 5a51b6ffb1f1b124a87b9337625b3fe592849e6c..7aa74ca1f866ba2dc1ed172b8e112fd80556123d 100644 --- a/modules/gui/macosx/main/VLCMain.h +++ b/modules/gui/macosx/main/VLCMain.h @@ -74,6 +74,7 @@ static NSString * VLCAppleRemoteSettingChangedNotification = @"VLCAppleRemoteSet @class VLCConvertAndSaveWindowController; @class VLCExtensionsManager; @class VLCStatusBarIcon; +@class VLCLibraryController; @class VLCPlaylistController; @class VLCHotkeysController; @@ -83,6 +84,7 @@ static NSString * VLCAppleRemoteSettingChangedNotification = @"VLCAppleRemoteSet @property (readonly) BOOL nativeFullscreenMode; @property (nonatomic, readwrite) BOOL playlistUpdatedSelectorInQueue; @property (readonly) VLCLibraryWindowController *libraryWindowController; +@property (readonly) VLCLibraryController *libraryController; @property (readonly) VLCPlaylistController *playlistController; @property (readonly) VLCHotkeysController *hotkeysController; diff --git a/modules/gui/macosx/main/VLCMain.m b/modules/gui/macosx/main/VLCMain.m index 5bd4cb418b44fbcffde14e8f30aee8418b506dd7..a141edaef7dc315a1ff356c2bd07acb4bd4701bb 100644 --- a/modules/gui/macosx/main/VLCMain.m +++ b/modules/gui/macosx/main/VLCMain.m @@ -62,6 +62,7 @@ #import "panels/VLCVideoEffectsWindowController.h" #import "panels/VLCTrackSynchronizationWindowController.h" +#import "library/VLCLibraryController.h" #import "playlist/VLCPlaylistController.h" #import "playlist/VLCPlayerController.h" #import "playlist/VLCPlaylistModel.h" @@ -246,6 +247,7 @@ static VLCMain *sharedInstance = nil; _hotkeysController = [[VLCHotkeysController alloc] init]; _playlistController = [[VLCPlaylistController alloc] initWithPlaylist:vlc_intf_GetMainPlaylist(p_intf)]; + _libraryController = [[VLCLibraryController alloc] init]; _continuityController = [[VLCPlaybackContinuityController alloc] init]; // first initalize extensions dialog provider, then core dialog diff --git a/po/POTFILES.in b/po/POTFILES.in index 5a1ef31f25e0522c9637026453ce6f0c1b1f6b88..cdcbabda04ebfe16ade5211815b0224f1a88acd8 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -464,6 +464,12 @@ modules/gui/macosx/extensions/misc.h modules/gui/macosx/extensions/misc.m modules/gui/macosx/library/VLCLibraryCollectionViewItem.h modules/gui/macosx/library/VLCLibraryCollectionViewItem.m +modules/gui/macosx/library/VLCLibraryController.h +modules/gui/macosx/library/VLCLibraryController.m +modules/gui/macosx/library/VLCLibraryDataSource.h +modules/gui/macosx/library/VLCLibraryDataSource.m +modules/gui/macosx/library/VLCLibraryModel.h +modules/gui/macosx/library/VLCLibraryModel.m modules/gui/macosx/library/VLCLibraryWindow.h modules/gui/macosx/library/VLCLibraryWindow.m modules/gui/macosx/main/CompatibilityFixes.h