- (id)applianceController
{
// Disabled until we properly display a menu for that. You can test it by uncommenting those lines, and comment the following line.
- // VLCMediaListAspect * mediaListAspect = [[[[VLCMediaDiscoverer alloc] initWithName:@"freebox"] discoveredMedia] hierarchicalAspect];
+ // VLCMediaListAspect * mediaListAspect = [[[[[VLCMediaDiscoverer alloc] initWithName:@"freebox"] discoveredMedia] retain] hierarchicalAspect];
// VLCApplianceController * controller = [[VLCMediaListController alloc] initWithMediaListAspect:mediaListAspect];
VLCApplianceController * controller = [[VLCApplianceController alloc] initWithPath:[NSHomeDirectory() stringByAppendingPathComponent:@"Movies"]];
_videoLayer = [VLCVideoLayer layer];
_videoLayer.frame = self.bounds;
_videoLayer.autoresizingMask = kCALayerWidthSizable|kCALayerHeightSizable;
+ _videoLayer.fillScreen = YES;
[self addSublayer:_videoLayer];
}
if(_player == nil) {
_player = [[VLCMediaPlayer alloc] initWithVideoLayer:_videoLayer];
}
- else {
- [_player pause];
- }
#endif
NSLog(@"playing media: %@", media);
#import <BackRow/BRListControl.h>
#import <BackRow/BRTextMenuItemLayer.h>
#import <BackRow/BRControllerStack.h>
+#import <BackRow/BRHeaderControl.h>
@interface VLCMediaListController ()
- initWithMediaListAspect:(VLCMediaListAspect *)aMediaListAspect
{
- self = [super init];
-
- self.mediaListAspect = aMediaListAspect;
- [self.mediaListAspect addObserver:self forKeyPath:@"media" options:NSKeyValueChangeRemoval|NSKeyValueChangeInsertion|NSKeyValueChangeSetting context:nil];
- [[self list] setDatasource:self];
- isReloading = NO;
+ return [self initWithMediaListAspect:aMediaListAspect andTitle:nil];
+}
+- initWithMediaListAspect:(VLCMediaListAspect *)aMediaListAspect andTitle:(NSString *)title
+{
+ if( self = [super init] )
+ {
+ self.mediaListAspect = aMediaListAspect;
+ [self.mediaListAspect addObserver:self forKeyPath:@"media" options:NSKeyValueChangeRemoval|NSKeyValueChangeInsertion|NSKeyValueChangeSetting context:nil];
+ [[self list] setDatasource:self];
+ isReloading = NO;
+ if(title)
+ {
+ [[self header] setTitle: title];
+ }
+ }
return self;
}
if(!isReloading)
{
isReloading = YES;
- [self performSelector:@selector(reload) withObject:nil afterDelay:2.];
+ [self performSelector:@selector(reload) withObject:nil afterDelay: [[self list] itemCount] > 10 ? 2. : [[self list] itemCount] ? 0.3 : 0.0];
}
}
else {
BOOL isDirectory = ![[mediaListAspect nodeAtIndex:row] isLeaf];
BRTextMenuItemLayer * item = nil;
-
+
if(isDirectory) {
item = [BRTextMenuItemLayer folderMenuItem];
}
- (void)itemSelected:(NSInteger)row
{
- BOOL isDirectory = ![[mediaListAspect nodeAtIndex:row] isLeaf];
+ VLCMediaListAspectNode * node = [mediaListAspect nodeAtIndex:row];
+ BOOL isDirectory = ![node isLeaf];
BRController * controller = nil;
if(isDirectory) {
- controller = [[[VLCMediaListController alloc] initWithMediaListAspect:[[mediaListAspect nodeAtIndex:row] children]] autorelease];
+ controller = [[[VLCMediaListController alloc] initWithMediaListAspect:[node children] andTitle:[[node media] valueForKeyPath:@"metaDictionary.title"]] autorelease];
}
else {
static VLCPlayerController * playerController = nil;