mirror of
https://code.videolan.org/videolan/vlc
synced 2024-09-28 23:09:59 +02:00
macosx: Add mediaSourceInputItemAtRow method to VLCMediaSourceDataSource
Signed-off-by: Claudio Cambra <developer@claudiocambra.com>
This commit is contained in:
parent
61d1019fa2
commit
b6ff85a803
@ -24,6 +24,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class VLCInputItem;
|
||||
@class VLCInputNode;
|
||||
@class VLCMediaSource;
|
||||
|
||||
@ -37,6 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (readwrite) BOOL gridViewMode;
|
||||
|
||||
- (void)setupViews;
|
||||
- (VLCInputItem*)mediaSourceInputItemAtRow:(NSInteger)tableViewRow;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -120,12 +120,7 @@
|
||||
cellView.identifier = @"VLCMediaSourceTableViewCellIdentifier";
|
||||
}
|
||||
|
||||
VLCInputNode *rootNode = _nodeToDisplay;
|
||||
NSArray *nodeChildren = rootNode.children;
|
||||
VLCInputNode *childNode = nodeChildren[row];
|
||||
VLCInputItem *childRootInput = childNode.inputItem;
|
||||
cellView.representedInputItem = childRootInput;
|
||||
|
||||
cellView.representedInputItem = [self mediaSourceInputItemAtRow:row];
|
||||
return cellView;
|
||||
}
|
||||
|
||||
@ -156,6 +151,23 @@
|
||||
[self performActionForNode:childNode allowPlayback:YES];
|
||||
}
|
||||
|
||||
- (VLCInputItem*)mediaSourceInputItemAtRow:(NSInteger)tableViewRow
|
||||
{
|
||||
if (_nodeToDisplay == nil) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
VLCInputNode *rootNode = _nodeToDisplay;
|
||||
NSArray *nodeChildren = rootNode.children;
|
||||
|
||||
if (nodeChildren == nil || nodeChildren.count == 0) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
VLCInputNode *childNode = nodeChildren[tableViewRow];
|
||||
return childNode.inputItem;
|
||||
}
|
||||
|
||||
#pragma mark - generic actions
|
||||
|
||||
- (void)performActionForNode:(VLCInputNode *)node allowPlayback:(BOOL)allowPlayback
|
||||
|
Loading…
Reference in New Issue
Block a user