Skip to content
Snippets Groups Projects
Commit fd1e5a16 authored by Carola's avatar Carola Committed by Felix Paul Kühne
Browse files

VLCMediaList: call the delegate when media was Added


Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 25d23581
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,7 @@ extern NSString *const VLCMediaListItemDeleted;
* TODO: Documentation VLCMediaListDelegate
*/
@protocol VLCMediaListDelegate
@optional
/**
* TODO: Documentation - [VLCMediaListDelegate mediaList:mediaAdded:atIndex:]
*/
......
......@@ -261,6 +261,9 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
if (index && index > [cachedMedia count])
index = [cachedMedia count];
[cachedMedia insertObject:media atIndex:index];
index = [cachedMedia count] - 1;
if (delegate && [delegate respondsToSelector:@selector(mediaList:mediaAdded:atIndex:)])
[delegate mediaList:self mediaAdded:media atIndex:index];
}
[self didChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndexesInRange:range] forKey:@"media"];
......@@ -268,10 +271,6 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
// [[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaListItemAdded
// object:self
// userInfo:args];
// Let the delegate know that the item was added
// if (delegate && [delegate respondsToSelector:@selector(mediaList:mediaAdded:atIndex:)])
// [delegate mediaList:self mediaAdded:media atIndex:index];
}
- (void)mediaListItemRemoved:(NSNumber *)index
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment