Playlist view gets updated to display new information.
Info dialog gets updates (shows only information about currently
played input at the moment).
close #13729
- (PLRootType)currentRootType;
- (BOOL)editAllowed;
-
+// updates from core
- (void)addItem:(int)i_item withParentNode:(int)i_node;
- (void)removeItem:(int)i_item;
+- (void)updateItem:(input_item_t *)p_input_item;
+
- (PLItem *)currentlyPlayingItem;
+// sorting / searching
- (void)sortForColumn:(NSString *)o_column withMode:(int)i_mode;
- (void)searchUpdate:(NSString *)o_search;
@synthesize rootItem=_rootItem;
@synthesize draggedItems=_draggedItems;
+#pragma mark -
+#pragma mark Init and Stuff
- (id)initWithOutlineView:(NSOutlineView *)outlineView playlist:(playlist_t *)pl rootItem:(playlist_item_t *)root playlistObject:(id)plObj;
{
return nil;
}
+#pragma mark -
+#pragma mark Core events
- (void)addItem:(int)i_item withParentNode:(int)i_node
{
[_outlineView reloadItem:o_parent reloadChildren:YES];
}
+- (void)updateItem:(input_item_t *)p_input_item
+{
+ PL_LOCK;
+ playlist_item_t *pl_item = playlist_ItemGetByInput(p_playlist, p_input_item);
+ if (!pl_item) {
+ PL_UNLOCK;
+ return;
+ }
+ PLItem *item = [self findItemByPlaylistId:pl_item->i_id];
+ PL_UNLOCK;
+
+ if (!item)
+ return;
+
+ NSInteger row = [_outlineView rowForItem:item];
+ if (row == -1)
+ return;
+
+ [_outlineView reloadDataForRowIndexes:[NSIndexSet indexSetWithIndex:row]
+ columnIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [[_outlineView tableColumns] count])]];
+
+}
+
- (PLItem *)currentlyPlayingItem
{
PLItem *item = nil;
return item;
}
+#pragma mark -
+#pragma mark Sorting / Searching
+
- (void)sortForColumn:(NSString *)o_column withMode:(int)i_mode
{
int i_column = 0;
- (void)updatePlaybackPosition;
- (void)updateName;
- (void)updateRecordState: (BOOL)b_value;
-- (void)updateInfoandMetaPanel;
+- (void)updateMetaAndInfo;
- (void)updateMainMenu;
- (void)updateMainWindow;
- (void)showMainWindow;
case INPUT_EVENT_ITEM_INFO:
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateMainMenu) withObject: nil waitUntilDone:NO];
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateName) withObject: nil waitUntilDone:NO];
- [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateInfoandMetaPanel) withObject: nil waitUntilDone:NO];
+ [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateMetaAndInfo) withObject: nil waitUntilDone:NO];
break;
case INPUT_EVENT_BOOKMARK:
break;
case INPUT_EVENT_ITEM_NAME:
[[VLCMain sharedInstance] performSelectorOnMainThread:@selector(updateName) withObject: nil waitUntilDone:NO];
- // TODO update playlist item with new name
-// [[VLCMain sharedInstance] performSelectorOnMainThread:@selector(playlistUpdated) withObject: nil waitUntilDone:NO];
break;
case INPUT_EVENT_AUDIO_DELAY:
}
}
+ [self updateMetaAndInfo];
+
[o_mainwindow updateWindow];
[self updateDelays];
[self updateMainMenu];
[o_mainmenu updateRecordState:b_value];
}
-- (void)updateInfoandMetaPanel
+- (void)updateMetaAndInfo
{
- [o_playlist outlineViewSelectionDidChange:nil];
+ if (!p_current_input) {
+ [[self info] updatePanelWithItem:nil];
+ return;
+ }
+
+ input_item_t *p_input_item = input_GetItem(p_current_input);
+
+ [[[self playlist] model] updateItem:p_input_item];
+ [[self info] updatePanelWithItem:p_input_item];
}
- (void)resumeItunesPlayback:(id)sender
if (!item)
return;
- [[[VLCMain sharedInstance] info] updatePanelWithItem: [item input]];
-
// select item
NSInteger itemIndex = [o_outline_view rowForItem:item];
if (itemIndex < 0) {