[vlc-commits] macosx: allow re-use of the playlist controller for multiple lists

Felix Paul Kühne git at videolan.org
Sun Feb 3 14:51:02 CET 2019


vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Sat Feb  2 16:29:44 2019 +0100| [9ec8a6e95bc220fabde87db9e5082940f5de00f2] | committer: Felix Paul Kühne

macosx: allow re-use of the playlist controller for multiple lists

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9ec8a6e95bc220fabde87db9e5082940f5de00f2
---

 modules/gui/macosx/main/VLCMain.m                   | 2 +-
 modules/gui/macosx/playlist/VLCPlaylistController.h | 2 ++
 modules/gui/macosx/playlist/VLCPlaylistController.m | 5 ++---
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/main/VLCMain.m b/modules/gui/macosx/main/VLCMain.m
index 4c309eac78..de10389fd0 100644
--- a/modules/gui/macosx/main/VLCMain.m
+++ b/modules/gui/macosx/main/VLCMain.m
@@ -227,7 +227,7 @@ static VLCMain *sharedInstance = nil;
 
         [VLCApplication sharedApplication].delegate = self;
 
-        _playlistController = [[VLCPlaylistController alloc] init];
+        _playlistController = [[VLCPlaylistController alloc] initWithPlaylist:vlc_intf_GetMainPlaylist(p_intf)];
         _input_manager = [[VLCInputManager alloc] initWithMain:self];
 
         // first initalize extensions dialog provider, then core dialog
diff --git a/modules/gui/macosx/playlist/VLCPlaylistController.h b/modules/gui/macosx/playlist/VLCPlaylistController.h
index fd15af1952..97e9bf969f 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistController.h
+++ b/modules/gui/macosx/playlist/VLCPlaylistController.h
@@ -35,6 +35,8 @@ extern NSString *VLCPlaybackHasNextChanged;
 
 @interface VLCPlaylistController : NSObject
 
+- (instancetype)initWithPlaylist:(vlc_playlist_t *)playlist;
+
 /**
  * The vlc core playlist controlled by the instance of this class
  * @note You DO SOMETHING WRONG if you need to access this!
diff --git a/modules/gui/macosx/playlist/VLCPlaylistController.m b/modules/gui/macosx/playlist/VLCPlaylistController.m
index c4ba83bc45..9108405c62 100644
--- a/modules/gui/macosx/playlist/VLCPlaylistController.m
+++ b/modules/gui/macosx/playlist/VLCPlaylistController.m
@@ -191,12 +191,11 @@ static const struct vlc_playlist_callbacks playlist_callbacks = {
 
 @implementation VLCPlaylistController
 
-- (instancetype)init
+- (instancetype)initWithPlaylist:(vlc_playlist_t *)playlist
 {
     self = [super init];
     if (self) {
-        intf_thread_t *p_intf = getIntf();
-        _p_playlist = vlc_intf_GetMainPlaylist(p_intf);
+        _p_playlist = playlist;
 
         /* set initial values, further updates through callbacks */
         vlc_playlist_Lock(_p_playlist);



More information about the vlc-commits mailing list