[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Give control bar shuffle button an action

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Jan 6 13:12:56 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
d05a2961 by Claudio Cambra at 2023-01-06T12:23:05+00:00
macosx: Give control bar shuffle button an action

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

- - - - -
12ec5c85 by Claudio Cambra at 2023-01-06T12:23:05+00:00
macosx: Give control bar repeat button an action

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

- - - - -


1 changed file:

- modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m


Changes:

=====================================
modules/gui/macosx/windows/mainwindow/VLCControlsBarCommon.m
=====================================
@@ -161,6 +161,9 @@
     [self.forwardButton setAction:@selector(fwd:)];
     [self.backwardButton setAction:@selector(bwd:)];
 
+    self.repeatButton.action = @selector(repeatAction:);
+    self.shuffleButton.action = @selector(shuffleAction:);
+
     [self playerStateUpdated:nil];
     [self repeatStateUpdated:nil];
     [self shuffleStateUpdated:nil];
@@ -302,6 +305,32 @@
     [_playerController toggleFullscreen];
 }
 
+- (IBAction)shuffleAction:(id)sender
+{
+    if (_playlistController.playbackOrder == VLC_PLAYLIST_PLAYBACK_ORDER_NORMAL) {
+        _playlistController.playbackOrder = VLC_PLAYLIST_PLAYBACK_ORDER_RANDOM;
+    } else {
+        _playlistController.playbackOrder = VLC_PLAYLIST_PLAYBACK_ORDER_NORMAL;
+    }
+}
+
+- (IBAction)repeatAction:(id)sender
+{
+    enum vlc_playlist_playback_repeat currentRepeatState = _playlistController.playbackRepeat;
+    switch (currentRepeatState) {
+        case VLC_PLAYLIST_PLAYBACK_REPEAT_ALL:
+            _playlistController.playbackRepeat = VLC_PLAYLIST_PLAYBACK_REPEAT_NONE;
+            break;
+        case VLC_PLAYLIST_PLAYBACK_REPEAT_CURRENT:
+            _playlistController.playbackRepeat = VLC_PLAYLIST_PLAYBACK_REPEAT_ALL;
+            break;
+
+        default:
+            _playlistController.playbackRepeat = VLC_PLAYLIST_PLAYBACK_REPEAT_CURRENT;
+            break;
+    }
+}
+
 #pragma mark -
 #pragma mark Updaters
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7d274452f204e1151c7db64199b98026163f1419...12ec5c85084959b233be549dc2a1b876a077634c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/7d274452f204e1151c7db64199b98026163f1419...12ec5c85084959b233be549dc2a1b876a077634c
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