Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
9d6eca0c
Commit
9d6eca0c
authored
Jan 02, 2008
by
Pierre d'Herbemont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacOSX/VLC_app: Better naming scheme for the different UI elements.
parent
7036039b
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
721 additions
and
704 deletions
+721
-704
extras/MacOSX/VLC_app/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/VLC_app/English.lproj/MainMenu.nib/classes.nib
+6
-6
extras/MacOSX/VLC_app/English.lproj/MainWindow.xib
extras/MacOSX/VLC_app/English.lproj/MainWindow.xib
+621
-586
extras/MacOSX/VLC_app/Sources/VLCAppBindings.m
extras/MacOSX/VLC_app/Sources/VLCAppBindings.m
+20
-20
extras/MacOSX/VLC_app/Sources/VLCController.h
extras/MacOSX/VLC_app/Sources/VLCController.h
+3
-15
extras/MacOSX/VLC_app/Sources/VLCController.m
extras/MacOSX/VLC_app/Sources/VLCController.m
+24
-34
extras/MacOSX/VLC_app/Sources/VLCMainWindow.h
extras/MacOSX/VLC_app/Sources/VLCMainWindow.h
+7
-6
extras/MacOSX/VLC_app/Sources/VLCMainWindow.m
extras/MacOSX/VLC_app/Sources/VLCMainWindow.m
+40
-37
No files found.
extras/MacOSX/VLC_app/English.lproj/MainMenu.nib/classes.nib
View file @
9d6eca0c
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<dict>
<dict>
<key>
ACTIONS
</key>
<key>
ACTIONS
</key>
<dict>
<dict>
<key>
detailList
ItemDoubleClicked
</key>
<key>
mediaListView
ItemDoubleClicked
</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>
categor
yList
</key>
<key>
categor
iesListView
</key>
<string>
id
</string>
<string>
id
</string>
<key>
detail
ItemFetchedStatus
</key>
<key>
mediaList
ItemFetchedStatus
</key>
<string>
id
</string>
<string>
id
</string>
<key>
detail
ItemsCount
</key>
<key>
mediaList
ItemsCount
</key>
<string>
id
</string>
<string>
id
</string>
<key>
detailList
</key>
<key>
mediaListView
</key>
<string>
id
</string>
<string>
id
</string>
<key>
detail
SearchField
</key>
<key>
mediaList
SearchField
</key>
<string>
id
</string>
<string>
id
</string>
<key>
fillScreenButton
</key>
<key>
fillScreenButton
</key>
<string>
id
</string>
<string>
id
</string>
...
...
extras/MacOSX/VLC_app/English.lproj/MainWindow.xib
View file @
9d6eca0c
This diff is collapsed.
Click to expand it.
extras/MacOSX/VLC_app/Sources/VLCAppBindings.m
View file @
9d6eca0c
...
@@ -28,9 +28,9 @@
...
@@ -28,9 +28,9 @@
/******************************************************************************
/******************************************************************************
* VLCMediaDiscoverer (
MasterView
Bindings)
* VLCMediaDiscoverer (
CategoriesList
Bindings)
*/
*/
@implementation
VLCMediaDiscoverer
(
MasterView
Bindings
)
@implementation
VLCMediaDiscoverer
(
CategoriesList
Bindings
)
+
(
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"
],
@"childrenIn
MasterView
ForDetailView"
,
[
NSSet
setWithObject
:
@"discoveredMedia.flatAspect"
],
@"childrenIn
CategoriesList
ForDetailView"
,
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
*
)
childrenIn
MasterView
-
(
NSArray
*
)
childrenIn
CategoriesList
{
{
return
nil
;
return
nil
;
}
}
-
(
NSString
*
)
descriptionIn
MasterView
-
(
NSString
*
)
descriptionIn
CategoriesList
{
{
return
[
self
localizedName
];
return
[
self
localizedName
];
}
}
-
(
VLCMediaListAspect
*
)
childrenIn
MasterView
ForDetailView
-
(
VLCMediaListAspect
*
)
childrenIn
CategoriesList
ForDetailView
{
{
return
[[
self
discoveredMedia
]
flatAspect
];
return
[[
self
discoveredMedia
]
flatAspect
];
}
}
-
(
BOOL
)
editableIn
MasterView
-
(
BOOL
)
editableIn
CategoriesList
{
{
return
NO
;
return
NO
;
}
}
-
(
BOOL
)
selectableIn
MasterView
-
(
BOOL
)
selectableIn
CategoriesList
{
{
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"
],
@"childrenIn
MasterView
"
,
[
NSSet
setWithObject
:
@"subitems.hierarchicalNodeAspect.media"
],
@"childrenIn
CategoriesList
"
,
[
NSSet
setWithObject
:
@"metaDictionary.title"
],
@"descriptionIn
MasterView
"
,
[
NSSet
setWithObject
:
@"metaDictionary.title"
],
@"descriptionIn
CategoriesList
"
,
[
NSSet
setWithObject
:
@"subitems.flatAspect"
],
@"childrenIn
MasterView
ForDetailView"
,
[
NSSet
setWithObject
:
@"subitems.flatAspect"
],
@"childrenIn
CategoriesList
ForDetailView"
,
[
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
*
)
childrenIn
MasterView
-
(
NSArray
*
)
childrenIn
CategoriesList
{
{
return
[[[
self
subitems
]
hierarchicalNodeAspect
]
valueForKeyPath
:
@"media"
];
return
[[[
self
subitems
]
hierarchicalNodeAspect
]
valueForKeyPath
:
@"media"
];
}
}
-
(
void
)
setDescriptionIn
MasterView
:(
NSString
*
)
description
-
(
void
)
setDescriptionIn
CategoriesList
:(
NSString
*
)
description
{
{
NSLog
(
@"unimplemented: meta edition"
);
NSLog
(
@"unimplemented: meta edition"
);
}
}
-
(
NSString
*
)
descriptionIn
MasterView
-
(
NSString
*
)
descriptionIn
CategoriesList
{
{
return
[[
self
metaDictionary
]
objectForKey
:
@"title"
];
return
[[
self
metaDictionary
]
objectForKey
:
@"title"
];
}
}
-
(
VLCMediaListAspect
*
)
childrenIn
MasterView
ForDetailView
-
(
VLCMediaListAspect
*
)
childrenIn
CategoriesList
ForDetailView
{
{
return
[[
self
subitems
]
flatAspect
];
return
[[
self
subitems
]
flatAspect
];
}
}
-
(
BOOL
)
editableIn
MasterView
-
(
BOOL
)
editableIn
CategoriesList
{
{
return
YES
;
return
YES
;
}
}
-
(
BOOL
)
selectableIn
MasterView
-
(
BOOL
)
selectableIn
CategoriesList
{
{
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
;
...
...
extras/MacOSX/VLC_app/Sources/VLCController.h
View file @
9d6eca0c
...
@@ -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
extras/MacOSX/VLC_app/Sources/VLCController.m
View file @
9d6eca0c
...
@@ -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
];
arrayOfP
laylists
=
[
NSMutableArray
arrayWithObjects
:[
VLCMedia
mediaAsNodeWithName
:
@"Default Playlist"
],
nil
];
NSArray
*
p
laylists
=
[
NSMutableArray
arrayWithObjects
:[
VLCMedia
mediaAsNodeWithName
:
@"Default Playlist"
],
nil
];
NSDictionary
*
playlists
=
[
NSMutableDictionary
dictionaryWithObjectsAndKeys
:
NSDictionary
*
playlists
AsDictionary
=
[
NSMutableDictionary
dictionaryWithObjectsAndKeys
:
[
@"Playlists"
uppercaseString
],
@"descriptionIn
MasterView
"
,
[
@"Playlists"
uppercaseString
],
@"descriptionIn
CategoriesList
"
,
[
@"Playlists"
uppercaseString
]
,
@"descriptionInVideoView"
,
@"Playlists"
,
@"descriptionInVideoView"
,
[
NSNumber
numberWithBool
:
NO
],
@"selectableIn
MasterView
"
,
[
NSNumber
numberWithBool
:
NO
],
@"selectableIn
CategoriesList
"
,
arrayOfPlaylists
,
@"childrenInMasterView
"
,
playlists
,
@"childrenInCategoriesList
"
,
arrayOfP
laylists
,
@"childrenInVideoView"
,
p
laylists
,
@"childrenInVideoView"
,
nil
];
nil
];
self
.
arrayOfMaster
s
=
[
NSArray
arrayWithObjects
:
self
.
categorie
s
=
[
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
,
playlists
AsDictionary
,
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
extras/MacOSX/VLC_app/Sources/VLCMainWindow.h
View file @
9d6eca0c
...
@@ -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
detail
ItemFetchedStatus
;
IBOutlet
id
mediaList
ItemFetchedStatus
;
IBOutlet
id
detail
ItemsCount
;
IBOutlet
id
mediaList
ItemsCount
;
IBOutlet
id
detail
SearchField
;
IBOutlet
id
mediaList
SearchField
;
IBOutlet
NSOutlineView
*
categor
yList
;
IBOutlet
NSOutlineView
*
categor
iesListView
;
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
*
t
reeController
;
NSTreeController
*
categoriesT
reeController
;
VLCMediaArrayController
*
mediaArrayController
;
VLCMediaArrayController
*
mediaArrayController
;
/* Window state */
/* Window state */
...
...
extras/MacOSX/VLC_app/Sources/VLCMainWindow.m
View file @
9d6eca0c
...
@@ -29,9 +29,9 @@
...
@@ -29,9 +29,9 @@
#import "VLCAppAdditions.h"
#import "VLCAppAdditions.h"
/******************************************************************************
/******************************************************************************
* VLCMainWindow (
MasterViewDataSourc
e)
* VLCMainWindow (
CategoriesListDelegat
e)
*/
*/
@implementation
VLCMainWindow
(
MasterView
Delegate
)
@implementation
VLCMainWindow
(
CategoriesList
Delegate
)
-
(
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
*/
*/
/*
t
reeController */
/*
categoriesT
reeController */
t
reeController
=
[[
NSTreeController
alloc
]
init
];
categoriesT
reeController
=
[[
NSTreeController
alloc
]
init
];
[
treeController
setContent
:
controller
.
arrayOfMaster
s
];
[
categoriesTreeController
setContent
:
controller
.
categorie
s
];
[
treeController
setChildrenKeyPath
:
@"childrenInMasterView
"
];
[
categoriesTreeController
setChildrenKeyPath
:
@"childrenInCategoriesList
"
];
//[
t
reeController bind:@"contentArray" toObject:controller withKeyPath:@"arrayOfMasters" options:nil];
//[
categoriesT
reeController bind:@"contentArray" toObject:controller withKeyPath:@"arrayOfMasters" options:nil];
/* Bind the "name" table column */
/* Bind the "name" table column */
tableColumn
=
[
categor
yList
tableColumnWithIdentifier
:
@"name"
];
tableColumn
=
[
categor
iesListView
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 */
[
categor
yList
setSelectionHighlightStyle
:
NSTableViewSelectionHighlightStyleSourceList
];
[
categor
iesListView
setSelectionHighlightStyle
:
NSTableViewSelectionHighlightStyleSourceList
];
[
categor
yList
setDelegate
:
self
];
[
categor
iesListView
setDelegate
:
self
];
[
categor
yList
registerForDraggedTypes
:[
NSArray
arrayWithObjects
:
NSFilenamesPboardType
,
NSURLPboardType
,
@"VLCMediaURLType"
,
nil
]];
[
categor
iesListView
registerForDraggedTypes
:[
NSArray
arrayWithObjects
:
NSFilenamesPboardType
,
NSURLPboardType
,
@"VLCMediaURLType"
,
nil
]];
[
categor
yList
setDataSource
:
self
];
[
categor
iesListView
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
(
detailList
ItemDoubleClicked
:)];
[
mediaListView
setDoubleAction
:
@selector
(
mediaListView
ItemDoubleClicked
:)];
/* 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
];
[
detail
SearchField
bind
:
@"predicate"
toObject
:
mediaArrayController
withKeyPath
:
@"filterPredicate"
options
:
bindingOptions
];
[
mediaList
SearchField
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.childrenInMasterView
ForDetailView.media"
options
:
nil
];
[
mediaArrayController
bind
:
@"contentArray"
toObject
:
categoriesTreeController
withKeyPath
:
@"selection.childrenInCategoriesList
ForDetailView.media"
options
:
nil
];
[
mediaArrayController
bind
:
@"contentMediaList"
toObject
:
treeController
withKeyPath
:
@"selection.childrenInMasterView
ForDetailView.parentMediaList"
options
:
nil
];
[
mediaArrayController
bind
:
@"contentMediaList"
toObject
:
categoriesTreeController
withKeyPath
:
@"selection.childrenInCategoriesList
ForDetailView.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
.
arrayOfVideoViewMaster
s
];
[
videoView
setItemsTree
:
controller
.
categorie
s
];
[
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
*/
*/
[
detail
ItemsCount
bind
:
@"displayPatternValue1"
toObject
:
mediaArrayController
withKeyPath
:
@"arrangedObjects.@count"
options
:
[
NSDictionary
dictionaryWithObject
:
@"%{value1}@ items"
forKey
:
NSDisplayPatternBindingOption
]];
[
mediaList
ItemsCount
bind
:
@"displayPatternValue1"
toObject
:
mediaArrayController
withKeyPath
:
@"arrangedObjects.@count"
options
:
[
NSDictionary
dictionaryWithObject
:
@"%{value1}@ items"
forKey
:
NSDisplayPatternBindingOption
]];
[
detailItemFetchedStatus
bind
:
@"animate"
toObject
:
t
reeController
withKeyPath
:
@"selection.currentlyFetchingItems"
options
:
[
NSDictionary
dictionaryWithObject
:
@"%{value1}@ items"
forKey
:
NSDisplayPatternBindingOption
]];
[
mediaListItemFetchedStatus
bind
:
@"animate"
toObject
:
categoriesT
reeController
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
:
t
reeController
];
[
removePlaylistButton
setTarget
:
categoriesT
reeController
];
[
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 */
[
categor
yList
expandItem
:
nil
expandChildren
:
YES
];
[
categor
iesListView
expandItem
:
nil
expandChildren
:
YES
];
[
categor
yList
selectRowIndexes
:[
NSIndexSet
indexSetWithIndex
:[
categoryList
numberOfRows
]
>
0
?
[
categoryList
numberOfRows
]
-
1
:
0
]
byExtendingSelection
:
NO
];
[
categor
iesListView
selectRowIndexes
:[
NSIndexSet
indexSetWithIndex
:[
categoriesListView
numberOfRows
]
>
0
?
[
categoriesListView
numberOfRows
]
-
1
:
0
]
byExtendingSelection
:
NO
];
}
}
-
(
void
)
dealloc
-
(
void
)
dealloc
{
{
[
navigatorView
release
];
[
navigatorView
release
];
[
mediaPlayer
release
];
[
mediaPlayer
release
];
[
t
reeController
release
];
[
categoriesT
reeController
release
];
[
mediaArrayController
release
];
[
mediaArrayController
release
];
[
super
dealloc
];
[
super
dealloc
];
}
}
-
(
void
)
detailList
ItemDoubleClicked
:(
id
)
sender
-
(
void
)
mediaListView
ItemDoubleClicked
:(
id
)
sender
{
{
[
mediaPlayer
setMedia
:[[
mediaArrayController
selectedObjects
]
objectAtIndex
:
0
]];
[
mediaPlayer
setMedia
:[[
mediaArrayController
selectedObjects
]
objectAtIndex
:
0
]];
[
mediaPlayer
play
];
[
mediaPlayer
play
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment