]> git.sesse.net Git - vlc/commitdiff
macosx/framework: Added [VLCMediaList initWithArray:] method
authorEmmanuel de Roux <lostbread@free.fr>
Fri, 12 Feb 2010 16:41:41 +0000 (17:41 +0100)
committerPierre d'Herbemont <pdherbemont@free.fr>
Fri, 12 Feb 2010 17:13:27 +0000 (18:13 +0100)
Signed-off-by: Pierre d'Herbemont <pdherbemont@free.fr>
projects/macosx/framework/Headers/Public/VLCMediaList.h
projects/macosx/framework/Sources/VLCMediaList.m

index 94aff02c37d3c3ca426f1836714f5836c12c40b6..196257d386e882e445f06d2cb11aee0afb73cf70 100644 (file)
@@ -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]
index 7d0443602a7641b3a791b90cd603763fd6d98b94..c2f68e7fa7deba93d7e206cfe51910bedd8244bf 100644 (file)
@@ -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)