Commit 95ce3115 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework/VLCMediaListAspect: Code cleanup and use Objective-C 2.0...

MacOSX/Framework/VLCMediaListAspect: Code cleanup and use Objective-C 2.0 @property. (Patch by Enrique Osuna).
parent 31bf40d0
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
{ {
void * p_mlv; //< Internal instance of media list view void * p_mlv; //< Internal instance of media list view
NSMutableArray * cachedNode; NSMutableArray * cachedNode;
VLCMediaList *parentMediaList; VLCMediaList * parentMediaList;
BOOL ownHisMediaList; BOOL ownHisMediaList;
} }
- (VLCMedia *)mediaAtIndex:(int)index; - (VLCMedia *)mediaAtIndex:(int)index;
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
@end @end
/* libvlc event callback */ /* libvlc event callback */
static void HandleMediaListViewItemAdded(const libvlc_event_t *event, void *user_data) static void HandleMediaListViewItemAdded(const libvlc_event_t * event, void * user_data)
{ {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id self = user_data; id self = user_data;
...@@ -111,7 +111,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void * ...@@ -111,7 +111,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
} }
- (NSString *)description - (NSString *)description
{ {
NSMutableString *content = [NSMutableString string]; NSMutableString * content = [NSMutableString string];
int i; int i;
for( i = 0; i < [self count]; i++) for( i = 0; i < [self count]; i++)
{ {
...@@ -124,7 +124,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void * ...@@ -124,7 +124,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
{ {
libvlc_exception_t p_e; libvlc_exception_t p_e;
libvlc_exception_init( &p_e ); libvlc_exception_init( &p_e );
libvlc_media_descriptor_t *p_md = libvlc_media_list_view_item_at_index( p_mlv, index, &p_e ); libvlc_media_descriptor_t * p_md = libvlc_media_list_view_item_at_index( p_mlv, index, &p_e );
quit_on_exception( &p_e ); quit_on_exception( &p_e );
// Returns local object for media descriptor, searchs for user data first. If not found it creates a // Returns local object for media descriptor, searchs for user data first. If not found it creates a
...@@ -136,7 +136,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void * ...@@ -136,7 +136,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
{ {
libvlc_exception_t p_e; libvlc_exception_t p_e;
libvlc_exception_init( &p_e ); libvlc_exception_init( &p_e );
libvlc_media_list_view_t *p_sub_mlv = libvlc_media_list_view_children_at_index( p_mlv, index, &p_e ); libvlc_media_list_view_t * p_sub_mlv = libvlc_media_list_view_children_at_index( p_mlv, index, &p_e );
quit_on_exception( &p_e ); quit_on_exception( &p_e );
if( !p_sub_mlv ) if( !p_sub_mlv )
...@@ -237,7 +237,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void * ...@@ -237,7 +237,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
libvlc_exception_t e; libvlc_exception_t e;
libvlc_exception_init( &e ); libvlc_exception_init( &e );
libvlc_event_manager_t *p_em = libvlc_media_list_event_manager( p_mlv, &e ); libvlc_event_manager_t * p_em = libvlc_media_list_event_manager( p_mlv, &e );
/* Add internal callback */ /* Add internal callback */
libvlc_event_attach( p_em, libvlc_MediaListViewItemAdded, HandleMediaListViewItemAdded, self, &e ); libvlc_event_attach( p_em, libvlc_MediaListViewItemAdded, HandleMediaListViewItemAdded, self, &e );
......
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