[vlc-commits] [Git][videolan/vlc][master] 5 commits: macosx: Add starter VLCLibraryAbstractMediaLibrarySegmentViewController

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Feb 7 06:23:30 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
dc9bbe84 by Claudio Cambra at 2025-02-07T06:09:39+00:00
macosx: Add starter VLCLibraryAbstractMediaLibrarySegmentViewController

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

- - - - -
90071878 by Claudio Cambra at 2025-02-07T06:09:39+00:00
macosx: Use VLCMediaSbtractMediaLibrarySegmentViewController for all media library segment view controllers

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

- - - - -
42953e87 by Claudio Cambra at 2025-02-07T06:09:39+00:00
macosx: Move all the connect/disconnect related properties and method to the abstract media library segment view controller

These methods are not useful for the media source view controller

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

- - - - -
55bad759 by Claudio Cambra at 2025-02-07T06:09:39+00:00
macosx: Only try to disconnect segment view controller if it is a media library segment

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

- - - - -
898e706c by Claudio Cambra at 2025-02-07T06:09:39+00:00
macosx: Reconnect media library segment view controller after disabling video playback appearance

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

- - - - -


12 changed files:

- extras/package/macosx/VLC.xcodeproj/project.pbxproj
- modules/gui/macosx/Makefile.am
- + modules/gui/macosx/library/VLCLibraryAbstractMediaLibrarySegmentViewController.h
- + modules/gui/macosx/library/VLCLibraryAbstractMediaLibrarySegmentViewController.m
- modules/gui/macosx/library/VLCLibraryAbstractSegmentViewController.h
- modules/gui/macosx/library/VLCLibraryAbstractSegmentViewController.m
- modules/gui/macosx/library/VLCLibraryWindow.m
- modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.h
- modules/gui/macosx/library/groups-library/VLCLibraryGroupsViewController.h
- modules/gui/macosx/library/home-library/VLCLibraryHomeViewController.h
- modules/gui/macosx/library/playlist-library/VLCLibraryPlaylistViewController.h
- modules/gui/macosx/library/video-library/VLCLibraryVideoViewController.h


Changes:

=====================================
extras/package/macosx/VLC.xcodeproj/project.pbxproj
=====================================
@@ -161,6 +161,7 @@
 		53F0E92D299B002300491D49 /* VLCInputNodePathControlItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 53F0E92C299B002300491D49 /* VLCInputNodePathControlItem.m */; };
 		53F0E930299B17DF00491D49 /* VLCInputNodePathControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 53F0E92F299B17DF00491D49 /* VLCInputNodePathControl.m */; };
 		53F399802AC6D6B400B86241 /* VLCLibraryHomeViewVideoCarouselContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 53F3997F2AC6D6B400B86241 /* VLCLibraryHomeViewVideoCarouselContainerView.m */; };
+		53F7B23C2D545FCF00F3B38F /* VLCLibraryAbstractMediaLibrarySegmentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 53F7B23B2D545FCF00F3B38F /* VLCLibraryAbstractMediaLibrarySegmentViewController.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 */; };
@@ -486,6 +487,8 @@
 		53F3997D2AC6D50500B86241 /* VLCLibraryHomeViewVideoContainerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCLibraryHomeViewVideoContainerView.h; sourceTree = "<group>"; };
 		53F3997E2AC6D67F00B86241 /* VLCLibraryHomeViewVideoCarouselContainerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VLCLibraryHomeViewVideoCarouselContainerView.h; sourceTree = "<group>"; };
 		53F3997F2AC6D6B400B86241 /* VLCLibraryHomeViewVideoCarouselContainerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryHomeViewVideoCarouselContainerView.m; sourceTree = "<group>"; };
+		53F7B23A2D545FCF00F3B38F /* VLCLibraryAbstractMediaLibrarySegmentViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = VLCLibraryAbstractMediaLibrarySegmentViewController.h; sourceTree = "<group>"; };
+		53F7B23B2D545FCF00F3B38F /* VLCLibraryAbstractMediaLibrarySegmentViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = VLCLibraryAbstractMediaLibrarySegmentViewController.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>"; };
@@ -1333,6 +1336,8 @@
 				53F0E92C299B002300491D49 /* VLCInputNodePathControlItem.m */,
 				5360E9A62C5CF6270046BA8B /* VLCLibraryAbstractGroupingDataSource.h */,
 				5360E9A72C5CF6270046BA8B /* VLCLibraryAbstractGroupingDataSource.m */,
+				53F7B23A2D545FCF00F3B38F /* VLCLibraryAbstractMediaLibrarySegmentViewController.h */,
+				53F7B23B2D545FCF00F3B38F /* VLCLibraryAbstractMediaLibrarySegmentViewController.m */,
 				530F32B12C8C757600233C03 /* VLCLibraryAbstractSegmentViewController.h */,
 				530F32B22C8C757600233C03 /* VLCLibraryAbstractSegmentViewController.m */,
 				53088E132AD7802C00C21358 /* VLCLibraryCarouselViewItemView.h */,
@@ -2388,6 +2393,7 @@
 				7DFBDCB4226CD00900B700A5 /* VLCLibraryDataTypes.m in Sources */,
 				53A1F1172AB7168000686BAA /* VLCLibraryAllAudioGroupsMediaLibraryItem.m in Sources */,
 				1C3113DF1E508C6900D4DD76 /* VLCVideoEffectsWindowController.m in Sources */,
+				53F7B23C2D545FCF00F3B38F /* VLCLibraryAbstractMediaLibrarySegmentViewController.m in Sources */,
 				53F0E92D299B002300491D49 /* VLCInputNodePathControlItem.m in Sources */,
 				1C3113E11E508C6900D4DD76 /* VLCVoutView.m in Sources */,
 				539668872D37B483005CD9D4 /* VLCLibraryMediaSourceViewNavigationStack.m in Sources */,


=====================================
modules/gui/macosx/Makefile.am
=====================================
@@ -101,6 +101,8 @@ libmacosx_plugin_la_SOURCES = \
 	gui/macosx/library/VLCInputNodePathControlItem.m \
 	gui/macosx/library/VLCLibraryAbstractGroupingDataSource.h \
 	gui/macosx/library/VLCLibraryAbstractGroupingDataSource.m \
+	gui/macosx/library/VLCLibraryAbstractMediaLibrarySegmentViewController.h \
+	gui/macosx/library/VLCLibraryAbstractMediaLibrarySegmentViewController.m \
 	gui/macosx/library/VLCLibraryAbstractSegmentViewController.h \
 	gui/macosx/library/VLCLibraryAbstractSegmentViewController.m \
 	gui/macosx/library/VLCLibraryCarouselViewItemView.h \


=====================================
modules/gui/macosx/library/VLCLibraryAbstractMediaLibrarySegmentViewController.h
=====================================
@@ -0,0 +1,42 @@
+/*****************************************************************************
+ * VLCLibraryAbstractMediaLibrarySegmentViewController.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 "VLCLibraryAbstractSegmentViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+ at protocol VLCLibraryDataSource;
+
+ at interface VLCLibraryAbstractMediaLibrarySegmentViewController : VLCLibraryAbstractSegmentViewController
+
+ at property (readonly) BOOL connected; // Meaning to library model notifications
+
+// Implement getters for these properties in subclass
+ at property (readonly) NSArray<NSLayoutConstraint *> *placeholderImageViewSizeConstraints;
+ at property (readonly) id<VLCLibraryDataSource> currentDataSource;
+
+- (void)connect;
+- (void)disconnect;
+
+ at end
+
+NS_ASSUME_NONNULL_END


=====================================
modules/gui/macosx/library/VLCLibraryAbstractMediaLibrarySegmentViewController.m
=====================================
@@ -0,0 +1,53 @@
+/*****************************************************************************
+ * VLCLibraryAbstractMediaLibrarySegmentViewController.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 "VLCLibraryAbstractMediaLibrarySegmentViewController.h"
+
+#import "library/VLCLibraryDataSource.h"
+
+ at implementation VLCLibraryAbstractMediaLibrarySegmentViewController
+
+- (id<VLCLibraryDataSource>)currentDataSource
+{
+    return nil;
+}
+
+// A note on the connected property.
+// This does not necessarily reflect the connection state of the data sources themselves.
+// We may disconnect the data sources via the view controllers when we detect that long loads are
+// taking place. However, keeping the connection state in the view controller allows us to
+// reconnect the data sources once the long loads are over (or not reconnect them, if the view
+// controller was originally disconnected, for example if the embedded video view is open)
+
+- (void)connect
+{
+    [self.currentDataSource connect];
+    _connected = YES;
+}
+
+- (void)disconnect
+{
+    [self.currentDataSource disconnect];
+    _connected = NO;
+}
+
+ at end


=====================================
modules/gui/macosx/library/VLCLibraryAbstractSegmentViewController.h
=====================================
@@ -25,7 +25,6 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @class VLCLibraryWindow;
- at protocol VLCLibraryDataSource;
 
 @interface VLCLibraryAbstractSegmentViewController : NSObject
 
@@ -35,16 +34,8 @@ NS_ASSUME_NONNULL_BEGIN
 @property (readonly, weak) NSImageView *placeholderImageView;
 @property (readonly, weak) NSTextField *placeholderLabel;
 
-// Implement getters for these properties in subclass
- at property (readonly) NSArray<NSLayoutConstraint *> *placeholderImageViewSizeConstraints;
- at property (readonly) id<VLCLibraryDataSource> currentDataSource;
- at property (readonly) BOOL connected; // Meaning to library model notifications
-
 - (instancetype)initWithLibraryWindow:(VLCLibraryWindow *)libraryWindow;
 
-- (void)connect;
-- (void)disconnect;
-
 @end
 
 NS_ASSUME_NONNULL_END


=====================================
modules/gui/macosx/library/VLCLibraryAbstractSegmentViewController.m
=====================================
@@ -22,7 +22,6 @@
 
 #import "VLCLibraryAbstractSegmentViewController.h"
 
-#import "library/VLCLibraryDataSource.h"
 #import "library/VLCLibraryWindow.h"
 
 @implementation VLCLibraryAbstractSegmentViewController
@@ -41,29 +40,4 @@
     return self;
 }
 
-- (id<VLCLibraryDataSource>)currentDataSource
-{
-    [self doesNotRecognizeSelector:_cmd];
-    return nil;
-}
-
-// A note on the connected property.
-// This does not necessarily reflect the connection state of the data sources themselves.
-// We may disconnect the data sources via the view controllers when we detect that long loads are
-// taking place. However, keeping the connection state in the view controller allows us to
-// reconnect the data sources once the long loads are over (or not reconnect them, if the view
-// controller was originally disconnected, for example if the embedded video view is open)
-
-- (void)connect
-{
-    [self.currentDataSource connect];
-    _connected = YES;
-}
-
-- (void)disconnect
-{
-    [self.currentDataSource disconnect];
-    _connected = NO;
-}
-
 @end


=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -38,6 +38,7 @@
 #import "playqueue/VLCPlayQueueController.h"
 
 #import "library/VLCInputItem.h"
+#import "library/VLCLibraryAbstractMediaLibrarySegmentViewController.h"
 #import "library/VLCLibraryController.h"
 #import "library/VLCLibraryCollectionViewItem.h"
 #import "library/VLCLibraryCollectionViewSupplementaryElementView.h"
@@ -594,7 +595,9 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
 
     self.splitViewController.multifunctionSidebarViewController.mainVideoModeEnabled = YES;
 
-    [self.librarySegmentViewController disconnect];
+    if ([self.librarySegmentViewController isKindOfClass:VLCLibraryAbstractMediaLibrarySegmentViewController.class]) {
+        [(VLCLibraryAbstractMediaLibrarySegmentViewController *)self.librarySegmentViewController disconnect];
+    }
 }
 
 - (void)disableVideoPlaybackAppearance
@@ -613,6 +616,10 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
     if (self.presentLoadingOverlayOnVideoPlaybackHide) {
         [self showLoadingOverlay];
     }
+
+    if ([self.librarySegmentViewController isKindOfClass:VLCLibraryAbstractMediaLibrarySegmentViewController.class]) {
+        [(VLCLibraryAbstractMediaLibrarySegmentViewController *)self.librarySegmentViewController connect];
+    }
 }
 
 - (void)showLoadingOverlay


=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.h
=====================================
@@ -23,7 +23,7 @@
 #import <Cocoa/Cocoa.h>
 
 #import "library/VLCLibrarySegment.h"
-#import "library/VLCLibraryAbstractSegmentViewController.h"
+#import "library/VLCLibraryAbstractMediaLibrarySegmentViewController.h"
 
 @class VLCLibraryAudioDataSource;
 @class VLCLibraryAudioGroupDataSource;
@@ -34,7 +34,7 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
- at interface VLCLibraryAudioViewController : VLCLibraryAbstractSegmentViewController
+ at interface VLCLibraryAudioViewController : VLCLibraryAbstractMediaLibrarySegmentViewController
 
 @property (readonly, weak) NSView *audioLibraryView;
 @property (readonly, weak) NSSplitView *audioLibrarySplitView;


=====================================
modules/gui/macosx/library/groups-library/VLCLibraryGroupsViewController.h
=====================================
@@ -22,7 +22,7 @@
 
 #import <Cocoa/Cocoa.h>
 
-#import "library/VLCLibraryAbstractSegmentViewController.h"
+#import "library/VLCLibraryAbstractMediaLibrarySegmentViewController.h"
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -34,7 +34,7 @@ NS_ASSUME_NONNULL_BEGIN
 @class VLCLibraryWindow;
 @class VLCMediaLibraryGroup;
 
- at interface VLCLibraryGroupsViewController : VLCLibraryAbstractSegmentViewController<NSSplitViewDelegate>
+ at interface VLCLibraryGroupsViewController : VLCLibraryAbstractMediaLibrarySegmentViewController<NSSplitViewDelegate>
 
 @property (readonly) NSScrollView *collectionViewScrollView;
 @property (readonly) VLCLibraryCollectionView *collectionView;


=====================================
modules/gui/macosx/library/home-library/VLCLibraryHomeViewController.h
=====================================
@@ -22,7 +22,7 @@
 
 #import <Cocoa/Cocoa.h>
 
-#import "library/VLCLibraryAbstractSegmentViewController.h"
+#import "library/VLCLibraryAbstractMediaLibrarySegmentViewController.h"
 
 @class VLCLibraryWindow;
 @class VLCLibraryHomeViewStackViewController;
@@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 // Controller for the home library views
 
- at interface VLCLibraryHomeViewController : VLCLibraryAbstractSegmentViewController
+ at interface VLCLibraryHomeViewController : VLCLibraryAbstractMediaLibrarySegmentViewController
 
 @property (readonly, weak) NSView *homeLibraryView;
 @property (readonly, weak) NSScrollView *homeLibraryStackViewScrollView;


=====================================
modules/gui/macosx/library/playlist-library/VLCLibraryPlaylistViewController.h
=====================================
@@ -22,7 +22,7 @@
 
 #import <Cocoa/Cocoa.h>
 
-#import "library/VLCLibraryAbstractSegmentViewController.h"
+#import "library/VLCLibraryAbstractMediaLibrarySegmentViewController.h"
 
 #include <vlc_media_library.h>
 
@@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
 @class VLCLibraryTableView;
 @class VLCLibraryWindow;
 
- at interface VLCLibraryPlaylistViewController : VLCLibraryAbstractSegmentViewController<NSSplitViewDelegate>
+ at interface VLCLibraryPlaylistViewController : VLCLibraryAbstractMediaLibrarySegmentViewController<NSSplitViewDelegate>
 
 @property (readonly) NSSplitView *listViewSplitView;
 @property (readonly) NSScrollView *masterTableViewScrollView;


=====================================
modules/gui/macosx/library/video-library/VLCLibraryVideoViewController.h
=====================================
@@ -22,7 +22,7 @@
 
 #import <Cocoa/Cocoa.h>
 
-#import "library/VLCLibraryAbstractSegmentViewController.h"
+#import "library/VLCLibraryAbstractMediaLibrarySegmentViewController.h"
 
 @class VLCLibraryCollectionView;
 @class VLCLibraryWindow;
@@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 // Controller for the video library views
 
- at interface VLCLibraryVideoViewController : VLCLibraryAbstractSegmentViewController
+ at interface VLCLibraryVideoViewController : VLCLibraryAbstractMediaLibrarySegmentViewController
 
 @property (readonly, weak) NSView *videoLibraryView;
 @property (readonly, weak) NSSplitView *videoLibrarySplitView;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/beecec04ced528de9f4e37e80e221f991c7a483f...898e706c58c9f4ad31833bd20a8d6171a43c5f69

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/beecec04ced528de9f4e37e80e221f991c7a483f...898e706c58c9f4ad31833bd20a8d6171a43c5f69
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