Changeset 632ef79dbc8feb1e106aaddcab412cea65ddbea1
- Timestamp:
- 02/14/08 02:00:07
(5 months ago)
- Author:
- Pierre d'Herbemont <pdherbemont@videolan.org>
- git-committer:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1202950807 +0000
- git-parent:
[e651381f1fd0d7d29b31e5e3625af7977886d045]
- git-author:
- Pierre d'Herbemont <pdherbemont@videolan.org> 1202950807 +0000
- Message:
frontrow_plugin: Cleanups, and improvement such as audio volume settings.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r0eef312 |
r632ef79 |
|
| 29 | 29 | { |
|---|
| 30 | 30 | // Disabled until we properly display a menu for that. You can test it by uncommenting those lines, and comment the following line. |
|---|
| 31 | | // VLCMediaListAspect * mediaListAspect = [[[[VLCMediaDiscoverer alloc] initWithName:@"freebox"] discoveredMedia] hierarchicalAspect]; |
|---|
| | 31 | // VLCMediaListAspect * mediaListAspect = [[[[[VLCMediaDiscoverer alloc] initWithName:@"freebox"] discoveredMedia] retain] hierarchicalAspect]; |
|---|
| 32 | 32 | // VLCApplianceController * controller = [[VLCMediaListController alloc] initWithMediaListAspect:mediaListAspect]; |
|---|
| 33 | 33 | |
|---|
| r0eef312 |
r632ef79 |
|
| 46 | 46 | _videoLayer.frame = self.bounds; |
|---|
| 47 | 47 | _videoLayer.autoresizingMask = kCALayerWidthSizable|kCALayerHeightSizable; |
|---|
| | 48 | _videoLayer.fillScreen = YES; |
|---|
| 48 | 49 | [self addSublayer:_videoLayer]; |
|---|
| 49 | 50 | } |
|---|
| … | … | |
| 51 | 52 | if(_player == nil) { |
|---|
| 52 | 53 | _player = [[VLCMediaPlayer alloc] initWithVideoLayer:_videoLayer]; |
|---|
| 53 | | } |
|---|
| 54 | | else { |
|---|
| 55 | | [_player pause]; |
|---|
| 56 | 54 | } |
|---|
| 57 | 55 | #endif |
|---|
| r0eef312 |
r632ef79 |
|
| 18 | 18 | |
|---|
| 19 | 19 | - initWithMediaListAspect:(VLCMediaListAspect *)mediaListAspect; |
|---|
| 20 | | |
|---|
| | 20 | - initWithMediaListAspect:(VLCMediaListAspect *)aMediaListAspect andTitle:(NSString *)title; |
|---|
| 21 | 21 | @end |
|---|
| r0eef312 |
r632ef79 |
|
| 13 | 13 | #import <BackRow/BRTextMenuItemLayer.h> |
|---|
| 14 | 14 | #import <BackRow/BRControllerStack.h> |
|---|
| | 15 | #import <BackRow/BRHeaderControl.h> |
|---|
| 15 | 16 | |
|---|
| 16 | 17 | @interface VLCMediaListController () |
|---|
| … | … | |
| 26 | 27 | - initWithMediaListAspect:(VLCMediaListAspect *)aMediaListAspect |
|---|
| 27 | 28 | { |
|---|
| 28 | | self = [super init]; |
|---|
| 29 | | |
|---|
| 30 | | self.mediaListAspect = aMediaListAspect; |
|---|
| 31 | | [self.mediaListAspect addObserver:self forKeyPath:@"media" options:NSKeyValueChangeRemoval|NSKeyValueChangeInsertion|NSKeyValueChangeSetting context:nil]; |
|---|
| 32 | | [[self list] setDatasource:self]; |
|---|
| 33 | | isReloading = NO; |
|---|
| | 29 | return [self initWithMediaListAspect:aMediaListAspect andTitle:nil]; |
|---|
| | 30 | } |
|---|
| 34 | 31 | |
|---|
| | 32 | - initWithMediaListAspect:(VLCMediaListAspect *)aMediaListAspect andTitle:(NSString *)title |
|---|
| | 33 | { |
|---|
| | 34 | if( self = [super init] ) |
|---|
| | 35 | { |
|---|
| | 36 | self.mediaListAspect = aMediaListAspect; |
|---|
| | 37 | [self.mediaListAspect addObserver:self forKeyPath:@"media" options:NSKeyValueChangeRemoval|NSKeyValueChangeInsertion|NSKeyValueChangeSetting context:nil]; |
|---|
| | 38 | [[self list] setDatasource:self]; |
|---|
| | 39 | isReloading = NO; |
|---|
| | 40 | if(title) |
|---|
| | 41 | { |
|---|
| | 42 | [[self header] setTitle: title]; |
|---|
| | 43 | } |
|---|
| | 44 | } |
|---|
| 35 | 45 | return self; |
|---|
| 36 | 46 | } |
|---|
| … | … | |
| 49 | 59 | { |
|---|
| 50 | 60 | isReloading = YES; |
|---|
| 51 | | [self performSelector:@selector(reload) withObject:nil afterDelay:2.]; |
|---|
| | 61 | [self performSelector:@selector(reload) withObject:nil afterDelay: [[self list] itemCount] > 10 ? 2. : [[self list] itemCount] ? 0.3 : 0.0]; |
|---|
| 52 | 62 | } |
|---|
| 53 | 63 | } |
|---|
| … | … | |
| 104 | 114 | |
|---|
| 105 | 115 | BRTextMenuItemLayer * item = nil; |
|---|
| 106 | | |
|---|
| | 116 | |
|---|
| 107 | 117 | if(isDirectory) { |
|---|
| 108 | 118 | item = [BRTextMenuItemLayer folderMenuItem]; |
|---|
| … | … | |
| 119 | 129 | - (void)itemSelected:(NSInteger)row |
|---|
| 120 | 130 | { |
|---|
| 121 | | BOOL isDirectory = ![[mediaListAspect nodeAtIndex:row] isLeaf]; |
|---|
| | 131 | VLCMediaListAspectNode * node = [mediaListAspect nodeAtIndex:row]; |
|---|
| | 132 | BOOL isDirectory = ![node isLeaf]; |
|---|
| 122 | 133 | |
|---|
| 123 | 134 | BRController * controller = nil; |
|---|
| 124 | 135 | |
|---|
| 125 | 136 | if(isDirectory) { |
|---|
| 126 | | controller = [[[VLCMediaListController alloc] initWithMediaListAspect:[[mediaListAspect nodeAtIndex:row] children]] autorelease]; |
|---|
| | 137 | controller = [[[VLCMediaListController alloc] initWithMediaListAspect:[node children] andTitle:[[node media] valueForKeyPath:@"metaDictionary.title"]] autorelease]; |
|---|
| 127 | 138 | } |
|---|
| 128 | 139 | else { |
|---|
| r0eef312 |
r632ef79 |
|
| 69 | 69 | break; |
|---|
| 70 | 70 | } |
|---|
| | 71 | case BREventUpUsage: |
|---|
| | 72 | { |
|---|
| | 73 | NSLog(@"UP"); |
|---|
| | 74 | [[[VLCLibrary sharedLibrary] audio] setVolume:[[[VLCLibrary sharedLibrary] audio] volume]+20]; |
|---|
| | 75 | break; |
|---|
| | 76 | } |
|---|
| | 77 | case BREventDownUsage: |
|---|
| | 78 | { |
|---|
| | 79 | NSLog(@"DOWN"); |
|---|
| | 80 | [[[VLCLibrary sharedLibrary] audio] setVolume:[[[VLCLibrary sharedLibrary] audio] volume]-20]; |
|---|
| | 81 | break; |
|---|
| | 82 | } |
|---|
| 71 | 83 | case BREventMenuUsage: |
|---|
| 72 | 84 | [[self stack] popController]; |
|---|