[vlc-commits] macosx/library: add class skeleton
Felix Paul Kühne
git at videolan.org
Mon Apr 29 19:26:39 CEST 2019
vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Fri Apr 19 13:54:26 2019 +0200| [f3cb7306e273e48e8dd769acd78d2a6d6c5276ca] | committer: Felix Paul Kühne
macosx/library: add class skeleton
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f3cb7306e273e48e8dd769acd78d2a6d6c5276ca
---
.../package/macosx/VLC.xcodeproj/project.pbxproj | 18 +++++
modules/gui/macosx/Makefile.am | 6 ++
.../macosx/library/VLCLibraryCollectionViewItem.h | 2 +
.../macosx/library/VLCLibraryCollectionViewItem.m | 2 +
modules/gui/macosx/library/VLCLibraryController.h | 35 +++++++++
modules/gui/macosx/library/VLCLibraryController.m | 89 ++++++++++++++++++++++
modules/gui/macosx/library/VLCLibraryDataSource.h | 31 ++++++++
modules/gui/macosx/library/VLCLibraryDataSource.m | 49 ++++++++++++
modules/gui/macosx/library/VLCLibraryModel.h | 35 +++++++++
modules/gui/macosx/library/VLCLibraryModel.m | 42 ++++++++++
modules/gui/macosx/library/VLCLibraryWindow.h | 4 -
modules/gui/macosx/library/VLCLibraryWindow.m | 30 +-------
modules/gui/macosx/main/VLCMain.h | 2 +
modules/gui/macosx/main/VLCMain.m | 2 +
po/POTFILES.in | 6 ++
15 files changed, 322 insertions(+), 31 deletions(-)
diff --git a/extras/package/macosx/VLC.xcodeproj/project.pbxproj b/extras/package/macosx/VLC.xcodeproj/project.pbxproj
index a2f622d02f..33b07afb76 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 44c6c6f645..4d8f33a5f6 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 e4b46e6b7d..337acf1fee 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 f3ff065d72..82255b6e6d 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 0000000000..b5725e712c
--- /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>
+
+ at class VLCLibraryModel;
+
+NS_ASSUME_NONNULL_BEGIN
+
+ at interface VLCLibraryController : NSObject
+
+ at property (readonly) VLCLibraryModel *libraryModel;
+
+ at 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 0000000000..cb75184549
--- /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>
+
+ at interface VLCLibraryController()
+{
+ vlc_medialibrary_t *_p_libraryInstance;
+}
+ at end
+
+ at 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);
+ }
+}
+
+ at end
diff --git a/modules/gui/macosx/library/VLCLibraryDataSource.h b/modules/gui/macosx/library/VLCLibraryDataSource.h
new file mode 100644
index 0000000000..94ef80572e
--- /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
+
+ at interface VLCLibraryDataSource : NSObject <NSCollectionViewDataSource, NSCollectionViewDelegate>
+
+ at 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 0000000000..19c7604f06
--- /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"
+
+ at 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);
+}
+
+ at end
diff --git a/modules/gui/macosx/library/VLCLibraryModel.h b/modules/gui/macosx/library/VLCLibraryModel.h
new file mode 100644
index 0000000000..abbf186089
--- /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
+
+ at interface VLCLibraryModel : NSObject
+
+- (instancetype)initWithLibrary:(vlc_medialibrary_t *)library;
+
+ at 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 0000000000..a4544b1598
--- /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"
+
+ at interface VLCLibraryModel ()
+{
+ vlc_medialibrary_t *_p_mediaLibrary;
+}
+ at end
+
+ at implementation VLCLibraryModel
+
+- (instancetype)initWithLibrary:(vlc_medialibrary_t *)library
+{
+ self = [super init];
+ if (self) {
+ _p_mediaLibrary = library;
+ }
+ return self;
+}
+
+ at end
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.h b/modules/gui/macosx/library/VLCLibraryWindow.h
index c81f371a03..3d4a208142 100644
--- a/modules/gui/macosx/library/VLCLibraryWindow.h
+++ b/modules/gui/macosx/library/VLCLibraryWindow.h
@@ -47,8 +47,4 @@ NS_ASSUME_NONNULL_BEGIN
@end
- at interface VLCLibraryDataSource : NSObject <NSCollectionViewDataSource, NSCollectionViewDelegate>
-
- at end
-
NS_ASSUME_NONNULL_END
diff --git a/modules/gui/macosx/library/VLCLibraryWindow.m b/modules/gui/macosx/library/VLCLibraryWindow.m
index c0b050d072..c0067170a6 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
- at 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);
-}
-
- at end
-
@implementation VLCLibraryWindowController
- (instancetype)initWithLibraryWindow
diff --git a/modules/gui/macosx/main/VLCMain.h b/modules/gui/macosx/main/VLCMain.h
index 5a51b6ffb1..7aa74ca1f8 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;
+ at 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;
+ at 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 5bd4cb418b..a141edaef7 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 5a1ef31f25..cdcbabda04 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
More information about the vlc-commits
mailing list