[vlc-commits] [Git][videolan/vlc][master] 5 commits: macosx: Add pipIsActive property to main video view controller

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Nov 14 06:27:36 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
97421017 by Claudio Cambra at 2024-11-14T05:53:41+00:00
macosx: Add pipIsActive property to main video view controller

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

- - - - -
a88028f8 by Claudio Cambra at 2024-11-14T05:53:41+00:00
macosx: Use pipIsActive to check if pip is active when opening pip

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

- - - - -
ec96e816 by Claudio Cambra at 2024-11-14T05:53:41+00:00
macosx: Extract artwork button enablement state update into own method in library window

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

- - - - -
673bca5f by Claudio Cambra at 2024-11-14T05:53:41+00:00
macosx: Disable artwork button in main library window controls bar if PIP is open

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

- - - - -
2a926d88 by Claudio Cambra at 2024-11-14T05:53:41+00:00
macosx: Update artwork button enabled state when disabling video playback view mode in library window

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

- - - - -


3 changed files:

- modules/gui/macosx/library/VLCLibraryWindow.m
- modules/gui/macosx/windows/video/VLCMainVideoViewController.h
- modules/gui/macosx/windows/video/VLCMainVideoViewController.m


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -678,6 +678,11 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
 }
 
 - (void)playerTrackSelectionChanged:(NSNotification *)notification
+{
+    [self updateArtworkButtonEnabledState];
+}
+
+- (void)updateArtworkButtonEnabledState
 {
     VLCPlayerController * const playerController = self.playerController;
     const BOOL videoTrackDisabled =
@@ -686,8 +691,11 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
         !playerController.audioTracksEnabled || !playerController.selectedAudioTrack.selected;
     const BOOL currentItemIsAudio =
         playerController.videoTracks.count == 0 && playerController.audioTracks.count > 0;
+    const BOOL pipOpen = self.videoViewController.pipIsActive;
     const BOOL artworkButtonDisabled =
-        (videoTrackDisabled && audioTrackDisabled) || (videoTrackDisabled && !currentItemIsAudio);
+        (videoTrackDisabled && audioTrackDisabled) ||
+        (videoTrackDisabled && !currentItemIsAudio) ||
+        pipOpen;
     self.artworkButton.enabled = !artworkButtonDisabled;
     self.artworkButton.hidden = artworkButtonDisabled;
     self.controlsBar.thumbnailTrackingView.enabled = !artworkButtonDisabled;
@@ -796,6 +804,7 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
     [self setViewForSelectedSegment];
     [self disableVideoTitleBarMode];
     [self showControlsBarImmediately];
+    [self updateArtworkButtonEnabledState];
     self.splitViewController.multifunctionSidebarViewController.mainVideoModeEnabled = NO;
 }
 


=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewController.h
=====================================
@@ -54,6 +54,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (readwrite, nonatomic) BOOL autohideControls;
 @property (readwrite, nonatomic) BOOL displayLibraryControls;
 @property (readonly) BOOL mouseOnControls;
+ at property (readonly) BOOL pipIsActive;
 
 - (void)showControls;
 - (void)hideControls;


=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewController.m
=====================================
@@ -467,9 +467,14 @@
     [_overlayView setNeedsDisplay:YES];
 }
 
+- (BOOL)pipIsActive
+{
+    return _voutViewController != nil;
+}
+
 - (void)pictureInPictureChanged:(VLCPlayerController *)playerController
 {
-    if (_voutViewController) {
+    if (self.pipIsActive) {
         return;
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/90558b4abc3295a13a7319d2a15a5651b582d364...2a926d8857b6e0394dce88683f2151087f0556a7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/90558b4abc3295a13a7319d2a15a5651b582d364...2a926d8857b6e0394dce88683f2151087f0556a7
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