Commit 9d6eca0c authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/VLC_app: Better naming scheme for the different UI elements.

parent 7036039b
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<dict> <dict>
<key>ACTIONS</key> <key>ACTIONS</key>
<dict> <dict>
<key>detailListItemDoubleClicked</key> <key>mediaListViewItemDoubleClicked</key>
<string>id</string> <string>id</string>
<key>newMainWindow</key> <key>newMainWindow</key>
<string>id</string> <string>id</string>
...@@ -18,15 +18,15 @@ ...@@ -18,15 +18,15 @@
<string>ObjC</string> <string>ObjC</string>
<key>OUTLETS</key> <key>OUTLETS</key>
<dict> <dict>
<key>categoryList</key> <key>categoriesListView</key>
<string>id</string> <string>id</string>
<key>detailItemFetchedStatus</key> <key>mediaListItemFetchedStatus</key>
<string>id</string> <string>id</string>
<key>detailItemsCount</key> <key>mediaListItemsCount</key>
<string>id</string> <string>id</string>
<key>detailList</key> <key>mediaListView</key>
<string>id</string> <string>id</string>
<key>detailSearchField</key> <key>mediaListSearchField</key>
<string>id</string> <string>id</string>
<key>fillScreenButton</key> <key>fillScreenButton</key>
<string>id</string> <string>id</string>
......
...@@ -28,9 +28,9 @@ ...@@ -28,9 +28,9 @@
/****************************************************************************** /******************************************************************************
* VLCMediaDiscoverer (MasterViewBindings) * VLCMediaDiscoverer (CategoriesListBindings)
*/ */
@implementation VLCMediaDiscoverer (MasterViewBindings) @implementation VLCMediaDiscoverer (CategoriesListBindings)
+(void)initialize +(void)initialize
{ {
[VLCMediaDiscoverer setKeys:[NSArray arrayWithObject:@"running"] triggerChangeNotificationsForDependentKey:@"currentlyFetchingItems"]; [VLCMediaDiscoverer setKeys:[NSArray arrayWithObject:@"running"] triggerChangeNotificationsForDependentKey:@"currentlyFetchingItems"];
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
if( !dict ) if( !dict )
{ {
dict = [[NSDictionary dictionaryWithObjectsAndKeys: dict = [[NSDictionary dictionaryWithObjectsAndKeys:
[NSSet setWithObject:@"discoveredMedia.flatAspect"], @"childrenInMasterViewForDetailView", [NSSet setWithObject:@"discoveredMedia.flatAspect"], @"childrenInCategoriesListForDetailView",
nil] retain]; nil] retain];
} }
return [dict objectForKey: key]; return [dict objectForKey: key];
...@@ -62,24 +62,24 @@ ...@@ -62,24 +62,24 @@
return sdImage; return sdImage;
} }
/* MasterView specific bindings */ /* CategoriesList specific bindings */
- (NSArray *)childrenInMasterView - (NSArray *)childrenInCategoriesList
{ {
return nil; return nil;
} }
- (NSString *)descriptionInMasterView - (NSString *)descriptionInCategoriesList
{ {
return [self localizedName]; return [self localizedName];
} }
- (VLCMediaListAspect *)childrenInMasterViewForDetailView - (VLCMediaListAspect *)childrenInCategoriesListForDetailView
{ {
return [[self discoveredMedia] flatAspect]; return [[self discoveredMedia] flatAspect];
} }
- (BOOL)editableInMasterView - (BOOL)editableInCategoriesList
{ {
return NO; return NO;
} }
- (BOOL)selectableInMasterView - (BOOL)selectableInCategoriesList
{ {
return YES; return YES;
} }
...@@ -113,9 +113,9 @@ ...@@ -113,9 +113,9 @@
if( !dict ) if( !dict )
{ {
dict = [[NSDictionary dictionaryWithObjectsAndKeys: dict = [[NSDictionary dictionaryWithObjectsAndKeys:
[NSSet setWithObject:@"subitems.hierarchicalNodeAspect.media"], @"childrenInMasterView", [NSSet setWithObject:@"subitems.hierarchicalNodeAspect.media"], @"childrenInCategoriesList",
[NSSet setWithObject:@"metaDictionary.title"], @"descriptionInMasterView", [NSSet setWithObject:@"metaDictionary.title"], @"descriptionInCategoriesList",
[NSSet setWithObject:@"subitems.flatAspect"], @"childrenInMasterViewForDetailView", [NSSet setWithObject:@"subitems.flatAspect"], @"childrenInCategoriesListForDetailView",
[NSSet setWithObject:@"metaDictionary.title"], @"descriptionInVideoView", [NSSet setWithObject:@"metaDictionary.title"], @"descriptionInVideoView",
[NSSet setWithObject:@"state"], @"stateAsImage", [NSSet setWithObject:@"state"], @"stateAsImage",
nil] retain]; nil] retain];
...@@ -123,28 +123,28 @@ ...@@ -123,28 +123,28 @@
return [dict objectForKey: key]; return [dict objectForKey: key];
} }
/* MasterView specific bindings */ /* CategoriesList specific bindings */
- (NSArray *)childrenInMasterView - (NSArray *)childrenInCategoriesList
{ {
return [[[self subitems] hierarchicalNodeAspect] valueForKeyPath:@"media"]; return [[[self subitems] hierarchicalNodeAspect] valueForKeyPath:@"media"];
} }
- (void)setDescriptionInMasterView:(NSString *)description - (void)setDescriptionInCategoriesList:(NSString *)description
{ {
NSLog(@"unimplemented: meta edition"); NSLog(@"unimplemented: meta edition");
} }
- (NSString *)descriptionInMasterView - (NSString *)descriptionInCategoriesList
{ {
return [[self metaDictionary] objectForKey:@"title"]; return [[self metaDictionary] objectForKey:@"title"];
} }
- (VLCMediaListAspect *)childrenInMasterViewForDetailView - (VLCMediaListAspect *)childrenInCategoriesListForDetailView
{ {
return [[self subitems] flatAspect]; return [[self subitems] flatAspect];
} }
- (BOOL)editableInMasterView - (BOOL)editableInCategoriesList
{ {
return YES; return YES;
} }
- (BOOL)selectableInMasterView - (BOOL)selectableInCategoriesList
{ {
return YES; return YES;
} }
...@@ -170,7 +170,7 @@ ...@@ -170,7 +170,7 @@
return [[self metaDictionary] objectForKey:@"title"]; return [[self metaDictionary] objectForKey:@"title"];
} }
/* DetailList specific bindings */ /* mediaListView specific bindings */
- (NSImage *)stateAsImage - (NSImage *)stateAsImage
{ {
static NSImage * playing = nil; static NSImage * playing = nil;
......
...@@ -25,26 +25,14 @@ ...@@ -25,26 +25,14 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import <VLC/VLC.h> #import <VLC/VLC.h>
#import "VLCMediaArrayController.h"
#import "VLCBrowsableVideoView.h"
@class VLCMainWindow; @class VLCMainWindow;
#define VLCPanic( ex ) __VLCPanic( ex, __FUNCTION__, __FILE__, __LINE__ )
static inline void __VLCPanic( const char * str, const char * function, const char * file, int line_number )
{
NSRunCriticalAlertPanel( @"Error", [NSString stringWithFormat:@"The following error was encountered: %s (%s:%d %s)", str, file, line_number, function], @"Quit", nil, nil );
exit( -1 );
}
@interface VLCController : NSObject @interface VLCController : NSObject
{ {
NSMutableArray * arrayOfPlaylists; NSArray * categories;
NSArray * arrayOfMasters;
NSArray * arrayOfVideoViewMasters;
} }
@property (readonly, retain) NSArray * arrayOfMasters; @property (readonly, retain) NSArray * categories;
@property (readonly, retain) NSArray * arrayOfVideoViewMasters;
- (void)newMainWindow:(id)sender; - (void)newMainWindow:(id)sender;
- (void)addPlaylist:(id)sender;
@end @end
...@@ -29,16 +29,14 @@ ...@@ -29,16 +29,14 @@
#import "VLCValueTransformer.h" #import "VLCValueTransformer.h"
@interface VLCController () @interface VLCController ()
@property (readwrite,retain) NSArray * arrayOfMasters; @property (readwrite,retain) NSArray * categories;
@property (readwrite,retain) NSArray * arrayOfVideoViewMasters;
@end @end
/****************************************************************************** /******************************************************************************
* VLCBrowsableVideoView * VLCBrowsableVideoView
*/ */
@implementation VLCController @implementation VLCController
@synthesize arrayOfMasters; @synthesize categories;
@synthesize arrayOfVideoViewMasters;
- (void)awakeFromNib - (void)awakeFromNib
{ {
...@@ -53,54 +51,39 @@ ...@@ -53,54 +51,39 @@
[NSValueTransformer setValueTransformer:(id)nonNilAsBool forName:@"NonNilAsBoolTransformer"]; [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:@"shoutcasttv"] autorelease],
[[[VLCMediaDiscoverer alloc] initWithName:@"shoutcast"] autorelease], [[[VLCMediaDiscoverer alloc] initWithName:@"shoutcast"] autorelease],
[[[VLCMediaDiscoverer alloc] initWithName:@"sap"] autorelease], [[[VLCMediaDiscoverer alloc] initWithName:@"sap"] autorelease],
[[[VLCMediaDiscoverer alloc] initWithName:@"freebox"] autorelease], nil]; [[[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: NSDictionary * playlistsAsDictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys:
[@"Playlists" uppercaseString], @"descriptionInMasterView", [@"Playlists" uppercaseString], @"descriptionInCategoriesList",
[@"Playlists" uppercaseString], @"descriptionInVideoView", @"Playlists", @"descriptionInVideoView",
[NSNumber numberWithBool:NO], @"selectableInMasterView", [NSNumber numberWithBool:NO], @"selectableInCategoriesList",
arrayOfPlaylists, @"childrenInMasterView", playlists, @"childrenInCategoriesList",
arrayOfPlaylists, @"childrenInVideoView", playlists, @"childrenInVideoView",
nil]; nil];
self.arrayOfMasters = [NSArray arrayWithObjects: self.categories = [NSArray arrayWithObjects:
[NSMutableDictionary dictionaryWithObjectsAndKeys: [NSMutableDictionary dictionaryWithObjectsAndKeys:
[@"Service Discovery" uppercaseString], @"descriptionInMasterView", [@"Service Discovery" uppercaseString], @"descriptionInCategoriesList",
[NSNumber numberWithBool:NO], @"selectableInMasterView",
arrayOfMediaDiscoverer, @"childrenInMasterView",
nil],
playlists,
nil];
/***********************************
* videoView setup
*/
self.arrayOfVideoViewMasters = [NSArray arrayWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:
@"Service Discovery", @"descriptionInVideoView", @"Service Discovery", @"descriptionInVideoView",
arrayOfMediaDiscoverer, @"childrenInVideoView", [NSNumber numberWithBool:NO], @"selectableInCategoriesList",
mediaDiscoverers, @"childrenInCategoriesList",
mediaDiscoverers, @"childrenInVideoView",
nil], nil],
playlists, playlistsAsDictionary,
nil]; nil];
/* Execution will continue in applicationDidFinishLaunching */ /* Execution will continue in applicationDidFinishLaunching */
[NSApp setDelegate:self]; [NSApp setDelegate:self];
} }
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
[self newMainWindow: self];
}
- (void)newMainWindow:(id)sender - (void)newMainWindow:(id)sender
{ {
if (![NSBundle loadNibNamed:@"MainWindow" owner:self]) if (![NSBundle loadNibNamed:@"MainWindow" owner:self])
...@@ -117,3 +100,10 @@ ...@@ -117,3 +100,10 @@
} }
@end @end
@implementation VLCController (NSAppDelegate)
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
[self newMainWindow: self];
}
@end
...@@ -26,15 +26,16 @@ ...@@ -26,15 +26,16 @@
#import "VLCController.h" #import "VLCController.h"
#import "VLCMediaArrayController.h" #import "VLCMediaArrayController.h"
#import "VLCAppAdditions.h" #import "VLCAppAdditions.h"
#import "VLCBrowsableVideoView.h"
@interface VLCMainWindow : NSWindow { @interface VLCMainWindow : NSWindow {
/* IB elements */ /* IB elements */
IBOutlet id detailItemFetchedStatus; IBOutlet id mediaListItemFetchedStatus;
IBOutlet id detailItemsCount; IBOutlet id mediaListItemsCount;
IBOutlet id detailSearchField; IBOutlet id mediaListSearchField;
IBOutlet NSOutlineView * categoryList; IBOutlet NSOutlineView * categoriesListView;
IBOutlet NSTableView * detailList; IBOutlet NSTableView * mediaListView;
IBOutlet VLCBrowsableVideoView * videoView; IBOutlet VLCBrowsableVideoView * videoView;
IBOutlet id fillScreenButton; IBOutlet id fillScreenButton;
...@@ -57,7 +58,7 @@ ...@@ -57,7 +58,7 @@
IBOutlet VLCController * controller; /* This is a VLCController binded to the File's Owner of the nib */ IBOutlet VLCController * controller; /* This is a VLCController binded to the File's Owner of the nib */
/* Controllers */ /* Controllers */
NSTreeController * treeController; NSTreeController * categoriesTreeController;
VLCMediaArrayController * mediaArrayController; VLCMediaArrayController * mediaArrayController;
/* Window state */ /* Window state */
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
#import "VLCAppAdditions.h" #import "VLCAppAdditions.h"
/****************************************************************************** /******************************************************************************
* VLCMainWindow (MasterViewDataSource) * VLCMainWindow (CategoriesListDelegate)
*/ */
@implementation VLCMainWindow (MasterViewDelegate) @implementation VLCMainWindow (CategoriesListDelegate)
- (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item
{ {
return [[item representedObject] isKindOfClass:[NSDictionary class]]; return [[item representedObject] isKindOfClass:[NSDictionary class]];
...@@ -46,7 +46,10 @@ ...@@ -46,7 +46,10 @@
} }
@end @end
@implementation VLCMainWindow (MasterViewDataSource) /******************************************************************************
* VLCMainWindow (CategoriesListDataSource)
*/
@implementation VLCMainWindow (CategoriesListDataSource)
/* Drag and drop */ /* Drag and drop */
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id < NSDraggingInfo >)info item:(id)item childIndex:(NSInteger)index - (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id < NSDraggingInfo >)info item:(id)item childIndex:(NSInteger)index
{ {
...@@ -113,21 +116,21 @@ ...@@ -113,21 +116,21 @@
mediaPlayer = [[VLCMediaPlayer alloc] initWithVideoView:videoView]; mediaPlayer = [[VLCMediaPlayer alloc] initWithVideoView:videoView];
/*********************************** /***********************************
* MasterView OutlineView content * CategoriesList OutlineView content
*/ */
/* treeController */ /* categoriesTreeController */
treeController = [[NSTreeController alloc] init]; categoriesTreeController = [[NSTreeController alloc] init];
[treeController setContent:controller.arrayOfMasters]; [categoriesTreeController setContent:controller.categories];
[treeController setChildrenKeyPath:@"childrenInMasterView"]; [categoriesTreeController setChildrenKeyPath:@"childrenInCategoriesList"];
//[treeController bind:@"contentArray" toObject:controller withKeyPath:@"arrayOfMasters" options:nil]; //[categoriesTreeController bind:@"contentArray" toObject:controller withKeyPath:@"arrayOfMasters" options:nil];
/* Bind the "name" table column */ /* Bind the "name" table column */
tableColumn = [categoryList tableColumnWithIdentifier:@"name"]; tableColumn = [categoriesListView tableColumnWithIdentifier:@"name"];
[tableColumn bind:@"value" toObject: treeController withKeyPath:@"arrangedObjects.descriptionInMasterView" options:nil]; [tableColumn bind:@"value" toObject: categoriesTreeController withKeyPath:@"arrangedObjects.descriptionInCategoriesList" options:nil];
[tableColumn setEditable:YES]; [tableColumn setEditable:YES];
/* FIXME: this doesn't work obviously. */ /* FIXME: this doesn't work obviously. */
[tableColumn bind:@"editable" toObject: treeController withKeyPath:@"arrangedObjects.editableInMasterView" options:nil]; [tableColumn bind:@"editable" toObject: categoriesTreeController withKeyPath:@"arrangedObjects.editableInCategoriesList" options:nil];
/* Use an ImageAndTextCell in the "name" table column */ /* Use an ImageAndTextCell in the "name" table column */
ImageAndTextCell * cell = [[ImageAndTextCell alloc] init]; ImageAndTextCell * cell = [[ImageAndTextCell alloc] init];
...@@ -137,52 +140,52 @@ ...@@ -137,52 +140,52 @@
[tableColumn setDataCell:cell]; [tableColumn setDataCell:cell];
/* Other setup */ /* Other setup */
[categoryList setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSourceList]; [categoriesListView setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSourceList];
[categoryList setDelegate:self]; [categoriesListView setDelegate:self];
[categoryList registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, NSURLPboardType, @"VLCMediaURLType", nil]]; [categoriesListView registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, NSURLPboardType, @"VLCMediaURLType", nil]];
[categoryList setDataSource: self]; [categoriesListView setDataSource: self];
/*********************************** /***********************************
* detailList setup * mediaListView setup
*/ */
mediaArrayController = [[VLCMediaArrayController alloc] init]; mediaArrayController = [[VLCMediaArrayController alloc] init];
/* 1- Drag and drop */ /* 1- Drag and drop */
[detailList registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, NSURLPboardType, nil]]; [mediaListView registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, NSURLPboardType, nil]];
[detailList setDataSource:mediaArrayController]; [mediaListView setDataSource:mediaArrayController];
/* 2- Double click */ /* 2- Double click */
[detailList setTarget:self]; [mediaListView setTarget:self];
[detailList setDoubleAction:@selector(detailListItemDoubleClicked:)]; [mediaListView setDoubleAction:@selector(mediaListViewItemDoubleClicked:)];
/* 3- binding for "title" column */ /* 3- binding for "title" column */
tableColumn = [detailList tableColumnWithIdentifier:@"title"]; tableColumn = [mediaListView tableColumnWithIdentifier:@"title"];
[tableColumn bind:@"value" toObject: mediaArrayController withKeyPath:@"arrangedObjects.metaDictionary.title" options:nil]; [tableColumn bind:@"value" toObject: mediaArrayController withKeyPath:@"arrangedObjects.metaDictionary.title" options:nil];
/* 4- binding for "state" column */ /* 4- binding for "state" column */
tableColumn = [detailList tableColumnWithIdentifier:@"state"]; tableColumn = [mediaListView tableColumnWithIdentifier:@"state"];
[tableColumn bind:@"value" toObject: mediaArrayController withKeyPath:@"arrangedObjects.stateAsImage" options:nil]; [tableColumn bind:@"value" toObject: mediaArrayController withKeyPath:@"arrangedObjects.stateAsImage" options:nil];
/* 5- Search & Predicate */ /* 5- Search & Predicate */
NSMutableDictionary * bindingOptions = [NSMutableDictionary dictionary]; NSMutableDictionary * bindingOptions = [NSMutableDictionary dictionary];
[bindingOptions setObject:@"metaDictionary.title contains[c] $value" forKey:NSPredicateFormatBindingOption]; [bindingOptions setObject:@"metaDictionary.title contains[c] $value" forKey:NSPredicateFormatBindingOption];
[bindingOptions setObject:@"No Title" forKey:NSDisplayNameBindingOption]; [bindingOptions setObject:@"No Title" forKey:NSDisplayNameBindingOption];
[detailSearchField bind:@"predicate" toObject: mediaArrayController withKeyPath:@"filterPredicate" options:bindingOptions]; [mediaListSearchField bind:@"predicate" toObject: mediaArrayController withKeyPath:@"filterPredicate" options:bindingOptions];
/* 6- Bind the @"contentArray" and contentMediaList of the mediaArrayController */ /* 6- Bind the @"contentArray" and contentMediaList of the mediaArrayController */
[mediaArrayController bind:@"contentArray" toObject:treeController withKeyPath:@"selection.childrenInMasterViewForDetailView.media" options:nil]; [mediaArrayController bind:@"contentArray" toObject:categoriesTreeController withKeyPath:@"selection.childrenInCategoriesListForDetailView.media" options:nil];
[mediaArrayController bind:@"contentMediaList" toObject:treeController withKeyPath:@"selection.childrenInMasterViewForDetailView.parentMediaList" options:nil]; [mediaArrayController bind:@"contentMediaList" toObject:categoriesTreeController withKeyPath:@"selection.childrenInCategoriesListForDetailView.parentMediaList" options:nil];
/* 7- Aspect */ /* 7- Aspect */
[detailList setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSourceList]; [mediaListView setSelectionHighlightStyle:NSTableViewSelectionHighlightStyleSourceList];
[detailList setAllowsTypeSelect:YES]; [mediaListView setAllowsTypeSelect:YES];
/*********************************** /***********************************
* videoView setup * videoView setup
*/ */
[videoView setItemsTree:controller.arrayOfVideoViewMasters]; [videoView setItemsTree:controller.categories];
[videoView setNodeKeyPath:@"childrenInVideoView"]; [videoView setNodeKeyPath:@"childrenInVideoView"];
[videoView setContentKeyPath:@"descriptionInVideoView"]; [videoView setContentKeyPath:@"descriptionInVideoView"];
[videoView setTarget:self]; [videoView setTarget:self];
...@@ -193,8 +196,8 @@ ...@@ -193,8 +196,8 @@
* Other interface element setup * Other interface element setup
*/ */
[detailItemsCount bind:@"displayPatternValue1" toObject:mediaArrayController withKeyPath:@"arrangedObjects.@count" options:[NSDictionary dictionaryWithObject:@"%{value1}@ items" forKey:NSDisplayPatternBindingOption]]; [mediaListItemsCount bind:@"displayPatternValue1" toObject:mediaArrayController withKeyPath:@"arrangedObjects.@count" options:[NSDictionary dictionaryWithObject:@"%{value1}@ items" forKey:NSDisplayPatternBindingOption]];
[detailItemFetchedStatus bind:@"animate" toObject:treeController withKeyPath:@"selection.currentlyFetchingItems" options:[NSDictionary dictionaryWithObject:@"%{value1}@ items" forKey:NSDisplayPatternBindingOption]]; [mediaListItemFetchedStatus bind:@"animate" toObject:categoriesTreeController withKeyPath:@"selection.currentlyFetchingItems" options:[NSDictionary dictionaryWithObject:@"%{value1}@ items" forKey:NSDisplayPatternBindingOption]];
[fillScreenButton bind:@"value" toObject:videoView withKeyPath:@"fillScreen" options: [NSDictionary dictionaryWithObject:NSNegateBooleanTransformerName forKey:NSValueTransformerNameBindingOption]]; [fillScreenButton bind:@"value" toObject:videoView withKeyPath:@"fillScreen" options: [NSDictionary dictionaryWithObject:NSNegateBooleanTransformerName forKey:NSValueTransformerNameBindingOption]];
[fullScreenButton bind:@"value" toObject:videoView withKeyPath:@"fullScreen" options: nil]; [fullScreenButton bind:@"value" toObject:videoView withKeyPath:@"fullScreen" options: nil];
...@@ -213,8 +216,8 @@ ...@@ -213,8 +216,8 @@
[navigatorViewToggleButton bind:@"value" toObject:self withKeyPath:@"navigatorViewVisible" options: nil]; [navigatorViewToggleButton bind:@"value" toObject:self withKeyPath:@"navigatorViewVisible" options: nil];
/* Playlist buttons */ /* Playlist buttons */
[removePlaylistButton bind:@"enabled" toObject:treeController withKeyPath:@"selection.editableInMasterView" options: nil]; [removePlaylistButton bind:@"enabled" toObject:categoriesTreeController withKeyPath:@"selection.editableInCategoriesList" options: nil];
[removePlaylistButton setTarget:treeController]; [removePlaylistButton setTarget:categoriesTreeController];
[removePlaylistButton setAction:@selector(remove:)]; [removePlaylistButton setAction:@selector(remove:)];
[addPlaylistButton setTarget:controller]; [addPlaylistButton setTarget:controller];
[addPlaylistButton setAction:@selector(addPlaylist:)]; [addPlaylistButton setAction:@selector(addPlaylist:)];
...@@ -222,20 +225,20 @@ ...@@ -222,20 +225,20 @@
[mainSplitView setDelegate:self]; [mainSplitView setDelegate:self];
/* Last minute setup */ /* Last minute setup */
[categoryList expandItem:nil expandChildren:YES]; [categoriesListView expandItem:nil expandChildren:YES];
[categoryList selectRowIndexes:[NSIndexSet indexSetWithIndex:[categoryList numberOfRows] > 0 ? [categoryList numberOfRows]-1 : 0] byExtendingSelection:NO]; [categoriesListView selectRowIndexes:[NSIndexSet indexSetWithIndex:[categoriesListView numberOfRows] > 0 ? [categoriesListView numberOfRows]-1 : 0] byExtendingSelection:NO];
} }
- (void)dealloc - (void)dealloc
{ {
[navigatorView release]; [navigatorView release];
[mediaPlayer release]; [mediaPlayer release];
[treeController release]; [categoriesTreeController release];
[mediaArrayController release]; [mediaArrayController release];
[super dealloc]; [super dealloc];
} }
- (void)detailListItemDoubleClicked:(id)sender - (void)mediaListViewItemDoubleClicked:(id)sender
{ {
[mediaPlayer setMedia:[[mediaArrayController selectedObjects] objectAtIndex:0]]; [mediaPlayer setMedia:[[mediaArrayController selectedObjects] objectAtIndex:0]];
[mediaPlayer play]; [mediaPlayer play];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment