[o_outline_view setTarget: self];
[o_outline_view setDelegate: self];
[o_outline_view setDataSource: self];
+ [o_outline_view setAllowsEmptySelection: NO];
vlc_object_release( p_playlist );
[self initStrings];
vlc_object_release( p_playlist );
}
+- (void)outlineViewSelectionDidChange:(NSNotification *)notification
+{
+ // FIXME: unsafe
+ playlist_item_t * p_item = [[o_outline_view itemAtRow:[o_outline_view selectedRow]] pointerValue];
+
+ if( p_item )
+ {
+ /* update our info-panel to reflect the new item */
+ [[[VLCMain sharedInstance] getInfo] updatePanelWithItem:p_item->p_input];
+ }
+}
+
+- (BOOL)isSelectionEmpty
+{
+ return [o_outline_view selectedRow] == -1;
+}
+
- (void)updateRowSelection
{
int i_row;
unsigned int j;
+ // FIXME: unsafe
playlist_t *p_playlist = pl_Yield( VLCIntf );
playlist_item_t *p_item, *p_temp_item;
NSMutableArray *o_array = [NSMutableArray array];
}
+ /* update our info-panel to reflect the new item */
+ [[[VLCMain sharedInstance] getInfo] updatePanelWithItem:p_item->p_input];
+
vlc_object_release( p_playlist );
- /* update our info-panel to reflect the new item */
- [[[VLCMain sharedInstance] getInfo] updatePanel];
}
/* Check if p_item is a child of p_node recursively. We need to check the item
p_item = NULL;
}
}
- playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, true, p_node, p_item );
+ playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, false, p_node, p_item );
}
vlc_object_release( p_playlist );
}
int i_item;
playlist_t * p_playlist = pl_Yield( VLCIntf );
+ PL_LOCK;
for( i_item = 0; i_item < (int)[o_array count]; i_item++ )
{
input_item_t *p_input;
/* Add the item */
/* FIXME: playlist_AddInput() can fail */
+
playlist_AddInput( p_playlist, p_input, PLAYLIST_INSERT,
i_position == -1 ? PLAYLIST_END : i_position + i_item, true,
- false );
+ true );
if( i_item == 0 && !b_enqueue )
{
p_item = playlist_ItemGetByInput( p_playlist, p_input, true );
playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, true, NULL, p_item );
}
- else
- {
- playlist_item_t *p_item;
- p_item = playlist_ItemGetByInput( p_playlist, p_input, true );
- playlist_Control( p_playlist, PLAYLIST_SKIP, true, p_item );
- }
vlc_gc_decref( p_input );
}
+ PL_UNLOCK;
+
[self playlistUpdated];
vlc_object_release( p_playlist );
}
p_item = playlist_ItemGetByInput( p_playlist, p_input, true );
playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, true, NULL, p_item );
}
- else
- {
- playlist_item_t *p_item;
- p_item = playlist_ItemGetByInput( p_playlist, p_input, true );
- playlist_Control( p_playlist, PLAYLIST_SKIP, true, p_item );
- }
vlc_gc_decref( p_input );
}
[self playlistUpdated];
pt = [o_outline_view convertPoint: [o_event locationInWindow]
fromView: nil];
- b_item_sel = ( [o_outline_view rowAtPoint: pt] != -1 &&
- [o_outline_view selectedRow] != -1 );
+ NSInteger row = [o_outline_view rowAtPoint:pt];
+ if( row != -1 )
+ [o_outline_view selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
+
+ b_item_sel = ( row != -1 && [o_outline_view selectedRow] != -1 );
b_rows = [o_outline_view numberOfRows] != 0;
[o_mi_play setEnabled: b_item_sel];