[vlc-commits] [Git][videolan/vlc][master] 3 commits: macosx: Don't update the playlist data source every time the current item changes

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Mar 15 11:28:39 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
92dce528 by Claudio Cambra at 2023-03-15T10:58:56+00:00
macosx: Don't update the playlist data source every time the current item changes

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

- - - - -
4b2b05ca by Claudio Cambra at 2023-03-15T10:58:56+00:00
macosx: Add method to VLCPlaylistDataSource to scroll to the current playlist item

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

- - - - -
e6785a0f by Claudio Cambra at 2023-03-15T10:58:56+00:00
macosx: Scroll to current playlist item when playlist controller detects current item change

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

- - - - -


3 changed files:

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


Changes:

=====================================
modules/gui/macosx/playlist/VLCPlaylistController.m
=====================================
@@ -341,7 +341,7 @@ static const struct vlc_playlist_callbacks playlist_callbacks = {
 - (void)currentPlaylistItemChanged:(size_t)index
 {
     _currentPlaylistIndex = index;
-    [_playlistDataSource playlistUpdated];
+    [_playlistDataSource scrollToCurrentPlaylistItem];
     [_defaultNotificationCenter postNotificationName:VLCPlaylistCurrentItemChanged object:self];
 }
 


=====================================
modules/gui/macosx/playlist/VLCPlaylistDataSource.h
=====================================
@@ -36,6 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (void)prepareForUse;
 - (void)playlistUpdated;
+- (void)scrollToCurrentPlaylistItem;
 
 @end
 


=====================================
modules/gui/macosx/playlist/VLCPlaylistDataSource.m
=====================================
@@ -180,4 +180,9 @@ static NSString *VLCPlaylistCellIdentifier = @"VLCPlaylistCellIdentifier";
     return YES;
 }
 
+- (void)scrollToCurrentPlaylistItem
+{
+    [_tableView scrollRowToVisible:_playlistController.currentPlaylistIndex];
+}
+
 @end



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/79b837b2b341b7f3e5302d4aad10acdb6b631c35...e6785a0f4545b216b4e157dfd1c7d92fbc5b8a6c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/79b837b2b341b7f3e5302d4aad10acdb6b631c35...e6785a0f4545b216b4e157dfd1c7d92fbc5b8a6c
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