From 17207ab162e0c8f38b7f0c9fe45483222f710e0c Mon Sep 17 00:00:00 2001 From: Emmanuel de Roux Date: Fri, 12 Feb 2010 17:41:41 +0100 Subject: [PATCH] macosx/framework: Added [VLCMediaList initWithArray:] method Signed-off-by: Pierre d'Herbemont --- .../macosx/framework/Headers/Public/VLCMediaList.h | 6 ++++++ projects/macosx/framework/Sources/VLCMediaList.m | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/projects/macosx/framework/Headers/Public/VLCMediaList.h b/projects/macosx/framework/Headers/Public/VLCMediaList.h index 94aff02c37..196257d386 100644 --- a/projects/macosx/framework/Headers/Public/VLCMediaList.h +++ b/projects/macosx/framework/Headers/Public/VLCMediaList.h @@ -57,6 +57,12 @@ extern NSString * VLCMediaListItemDeleted; NSMutableArray * cachedMedia; //< Private copy of media objects. } +/** + * Init a MediaList with the media contained in array. + * \array an array of VLCMedia. + */ +- (id)initWithArray:(NSArray *)array; + /* Operations */ /** * TODO: Documentation - [VLCMediaList lock] diff --git a/projects/macosx/framework/Sources/VLCMediaList.m b/projects/macosx/framework/Sources/VLCMediaList.m index 7d0443602a..c2f68e7fa7 100644 --- a/projects/macosx/framework/Sources/VLCMediaList.m +++ b/projects/macosx/framework/Sources/VLCMediaList.m @@ -86,6 +86,17 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use return self; } +- (id)initWithArray:(NSArray *)array +{ + self = [self init]; + if (!self) + return nil; + + for (VLCMedia *media in array) + [self addMedia:media]; + return self; +} + - (void)release { @synchronized(self) -- 2.39.2