[vlc-devel] commit: macosx/framework: Added [VLCMediaList initWithArray:] method ( Emmanuel de Roux )
git version control
git at videolan.org
Fri Feb 12 18:14:14 CET 2010
vlc | branch: master | Emmanuel de Roux <lostbread at free.fr> | Fri Feb 12 17:41:41 2010 +0100| [17207ab162e0c8f38b7f0c9fe45483222f710e0c] | committer: Pierre d'Herbemont
macosx/framework: Added [VLCMediaList initWithArray:] method
Signed-off-by: Pierre d'Herbemont <pdherbemont at free.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=17207ab162e0c8f38b7f0c9fe45483222f710e0c
---
.../macosx/framework/Headers/Public/VLCMediaList.h | 6 ++++++
projects/macosx/framework/Sources/VLCMediaList.m | 11 +++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/projects/macosx/framework/Headers/Public/VLCMediaList.h b/projects/macosx/framework/Headers/Public/VLCMediaList.h
index 94aff02..196257d 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 7d04436..c2f68e7 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)
More information about the vlc-devel
mailing list