Commit 38c86a7b authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework/VLCMediaListAspect.m: Implement -parentMediaList.

parent 441f5996
...@@ -41,9 +41,11 @@ ...@@ -41,9 +41,11 @@
{ {
void * p_mlv; //< Internal instance of media list view void * p_mlv; //< Internal instance of media list view
NSMutableArray * cachedNode; NSMutableArray * cachedNode;
VLCMediaList *parentMediaList;
} }
- (VLCMedia *)mediaAtIndex:(int)index; - (VLCMedia *)mediaAtIndex:(int)index;
- (VLCMediaListAspectNode *)nodeAtIndex:(int)index; - (VLCMediaListAspectNode *)nodeAtIndex:(int)index;
- (int)count; - (int)count;
@end
\ No newline at end of file - (VLCMediaList *)parentMediaList;
@end
...@@ -105,6 +105,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void * ...@@ -105,6 +105,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
// Release allocated memory // Release allocated memory
libvlc_media_list_view_release(p_mlv); libvlc_media_list_view_release(p_mlv);
[cachedNode release]; [cachedNode release];
[parentMediaList release];
[super dealloc]; [super dealloc];
} }
- (VLCMedia *)mediaAtIndex:(int)index - (VLCMedia *)mediaAtIndex:(int)index
...@@ -150,6 +151,11 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void * ...@@ -150,6 +151,11 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
return result; return result;
} }
- (VLCMediaList *)parentMediaList
{
return [[parentMediaList retain] autorelease];
}
@end @end
@implementation VLCMediaListAspect (LibVLCBridging) @implementation VLCMediaListAspect (LibVLCBridging)
...@@ -164,6 +170,10 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void * ...@@ -164,6 +170,10 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
{ {
p_mlv = p_new_mlv; p_mlv = p_new_mlv;
libvlc_media_list_view_retain(p_mlv); libvlc_media_list_view_retain(p_mlv);
libvlc_media_list_t * p_mlist = libvlc_media_list_view_parent_media_list(p_mlv, NULL);
parentMediaList = [[VLCMediaList mediaListWithLibVLCMediaList: p_mlist] retain];
libvlc_media_list_release( p_mlist );
//libvlc_media_list_lock(p_mlv->p_mlist); //libvlc_media_list_lock(p_mlv->p_mlist);
cachedNode = [[NSMutableArray alloc] initWithCapacity:libvlc_media_list_view_count(p_mlv, NULL)]; cachedNode = [[NSMutableArray alloc] initWithCapacity:libvlc_media_list_view_count(p_mlv, NULL)];
int i, count = libvlc_media_list_view_count(p_mlv, NULL); int i, count = libvlc_media_list_view_count(p_mlv, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment