MacOSX/VLC_app: Better naming scheme for the different UI elements.
[vlc.git] / extras / MacOSX / VLC_app / Sources / VLCController.m
index 2361165..067bce0 100644 (file)
 #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
 {
-   // [NSException raise:@"Hello" format:@"Hello"];
     /***********************************
      * Register our bindings value transformer
      */
     [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])
 
 - (void)addPlaylist:(id)sender
 {
-    [[arrayOfMasters mutableArrayValueForKey:@"[0].childrenInMasterView"] addObject:[VLCMedia mediaAsNodeWithName:@"Untitled Playlist"]];
+    // TODO
+    NSLog(@"unimplemented!");
 }
 
 @end
 
-@implementation VLCController (ExceptionHandlerDelegating)
+@implementation VLCController (NSAppDelegate)
+- (void)applicationDidFinishLaunching:(NSNotification *)notification
+{
+    [self newMainWindow: self];
+}
 @end