X-Git-Url: https://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;p=vlc.git;a=blobdiff_plain;f=extras%2FMacOSX%2FVLC_app%2FSources%2FVLCController.m;h=067bce040786989463583a8d5e4f01364b820a4d;hp=67ffd06beddc1871b5a376760f6e0d32c54ed423;hb=9d6eca0ca3378d43353c4b248d7824ffee7b6ae1;hpb=7036039baf7039c089b30b2b8970895f1f47337d diff --git a/extras/MacOSX/VLC_app/Sources/VLCController.m b/extras/MacOSX/VLC_app/Sources/VLCController.m index 67ffd06bed..067bce0407 100644 --- a/extras/MacOSX/VLC_app/Sources/VLCController.m +++ b/extras/MacOSX/VLC_app/Sources/VLCController.m @@ -29,16 +29,14 @@ #import "VLCValueTransformer.h" @interface VLCController () -@property (readwrite,retain) NSArray * arrayOfMasters; -@property (readwrite,retain) NSArray * arrayOfVideoViewMasters; +@property (readwrite,retain) NSArray * categories; @end /****************************************************************************** * VLCBrowsableVideoView */ @implementation VLCController -@synthesize arrayOfMasters; -@synthesize arrayOfVideoViewMasters; +@synthesize categories; - (void)awakeFromNib { @@ -53,54 +51,39 @@ [NSValueTransformer setValueTransformer:(id)nonNilAsBool forName:@"NonNilAsBoolTransformer"]; /*********************************** - * arrayOfMasters: MasterView OutlineView content + * categories: Main content */ - NSArray * arrayOfMediaDiscoverer = [NSArray arrayWithObjects: + NSArray * mediaDiscoverers = [NSArray arrayWithObjects: [[[VLCMediaDiscoverer alloc] initWithName:@"shoutcasttv"] autorelease], [[[VLCMediaDiscoverer alloc] initWithName:@"shoutcast"] autorelease], [[[VLCMediaDiscoverer alloc] initWithName:@"sap"] autorelease], [[[VLCMediaDiscoverer alloc] initWithName:@"freebox"] autorelease], nil]; - arrayOfPlaylists = [NSMutableArray arrayWithObjects:[VLCMedia mediaAsNodeWithName:@"Default Playlist"], nil]; + NSArray * playlists = [NSMutableArray arrayWithObjects:[VLCMedia mediaAsNodeWithName:@"Default Playlist"], nil]; - NSDictionary * playlists = [NSMutableDictionary dictionaryWithObjectsAndKeys: - [@"Playlists" uppercaseString], @"descriptionInMasterView", - [@"Playlists" uppercaseString], @"descriptionInVideoView", - [NSNumber numberWithBool:NO], @"selectableInMasterView", - arrayOfPlaylists, @"childrenInMasterView", - arrayOfPlaylists, @"childrenInVideoView", + NSDictionary * playlistsAsDictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys: + [@"Playlists" uppercaseString], @"descriptionInCategoriesList", + @"Playlists", @"descriptionInVideoView", + [NSNumber numberWithBool:NO], @"selectableInCategoriesList", + playlists, @"childrenInCategoriesList", + playlists, @"childrenInVideoView", nil]; - self.arrayOfMasters = [NSArray arrayWithObjects: + self.categories = [NSArray arrayWithObjects: [NSMutableDictionary dictionaryWithObjectsAndKeys: - [@"Service Discovery" uppercaseString], @"descriptionInMasterView", - [NSNumber numberWithBool:NO], @"selectableInMasterView", - arrayOfMediaDiscoverer, @"childrenInMasterView", - nil], - playlists, - nil]; - - - /*********************************** - * videoView setup - */ - self.arrayOfVideoViewMasters = [NSArray arrayWithObjects: - [NSDictionary dictionaryWithObjectsAndKeys: + [@"Service Discovery" uppercaseString], @"descriptionInCategoriesList", @"Service Discovery", @"descriptionInVideoView", - arrayOfMediaDiscoverer, @"childrenInVideoView", + [NSNumber numberWithBool:NO], @"selectableInCategoriesList", + mediaDiscoverers, @"childrenInCategoriesList", + mediaDiscoverers, @"childrenInVideoView", nil], - playlists, + playlistsAsDictionary, nil]; /* Execution will continue in applicationDidFinishLaunching */ [NSApp setDelegate:self]; } -- (void)applicationDidFinishLaunching:(NSNotification *)notification -{ - [self newMainWindow: self]; -} - - (void)newMainWindow:(id)sender { if (![NSBundle loadNibNamed:@"MainWindow" owner:self]) @@ -117,3 +100,10 @@ } @end + +@implementation VLCController (NSAppDelegate) +- (void)applicationDidFinishLaunching:(NSNotification *)notification +{ + [self newMainWindow: self]; +} +@end