[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Set library playlist mode to off by default

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Tue Oct 8 08:40:23 UTC 2024



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
d70352cd by Claudio Cambra at 2024-10-08T07:31:28+00:00
macosx: Set library playlist mode to off by default

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

- - - - -
579b6c70 by Claudio Cambra at 2024-10-08T07:31:28+00:00
macosx: Store library playlist mode across app starts

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

- - - - -


2 changed files:

- modules/gui/macosx/playlist/VLCPlaylistController.h
- modules/gui/macosx/playlist/VLCPlaylistController.m


Changes:

=====================================
modules/gui/macosx/playlist/VLCPlaylistController.h
=====================================
@@ -104,7 +104,7 @@ extern NSString *VLCPlaylistItemsRemoved;
  */
 @property (readwrite, nonatomic) enum vlc_playlist_playback_order playbackOrder;
 
- at property (readwrite) BOOL libraryPlaylistMode;
+ at property (readwrite, nonatomic) BOOL libraryPlaylistMode;
 
 /**
  * Define the action to perform after playback of the current media stopped (for any reason)


=====================================
modules/gui/macosx/playlist/VLCPlaylistController.m
=====================================
@@ -42,6 +42,8 @@ NSString *VLCPlaylistCurrentItemIndexChanged = @"VLCPlaylistCurrentItemIndexChan
 NSString *VLCPlaylistItemsAdded = @"VLCPlaylistItemsAdded";
 NSString *VLCPlaylistItemsRemoved = @"VLCPlaylistItemsRemoved";
 
+NSString * const VLCLibraryPlaylistModeDefaultsKey = @"VLCLibraryPlaylistMode";
+
 @interface VLCPlaylistController ()
 {
     NSNotificationCenter *_defaultNotificationCenter;
@@ -244,7 +246,8 @@ static const struct vlc_playlist_callbacks playlist_callbacks = {
         /* set initial values, further updates through callbacks */
         vlc_playlist_Lock(_p_playlist);
         _unsorted = YES;
-        _libraryPlaylistMode = YES;
+        _libraryPlaylistMode =
+            [NSUserDefaults.standardUserDefaults boolForKey:VLCLibraryPlaylistModeDefaultsKey];
         _playbackOrder = vlc_playlist_GetPlaybackOrder(_p_playlist);
         _playbackRepeat = vlc_playlist_GetPlaybackRepeat(_p_playlist);
         _playlistListenerID = vlc_playlist_AddListener(_p_playlist,
@@ -586,6 +589,13 @@ static const struct vlc_playlist_callbacks playlist_callbacks = {
     vlc_playlist_Unlock(_p_playlist);
 }
 
+- (void)setLibraryPlaylistMode:(BOOL)libraryPlaylistMode
+{
+    _libraryPlaylistMode = libraryPlaylistMode;
+    [NSUserDefaults.standardUserDefaults setBool:libraryPlaylistMode
+                                          forKey:VLCLibraryPlaylistModeDefaultsKey];
+}
+
 #pragma mark - properties
 
 - (VLCInputItem *)currentlyPlayingInputItem



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6288393dce77e3e9b838c9f8da668c40a95f3def...579b6c70ad01ba75f7302042da6f771baeff2469

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6288393dce77e3e9b838c9f8da668c40a95f3def...579b6c70ad01ba75f7302042da6f771baeff2469
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