]> git.sesse.net Git - vlc/commitdiff
macosx/framework : added method setValue:forMeta: to VLCMedia
authorEmmanuel de Roux <lostbread@free.fr>
Mon, 15 Feb 2010 14:18:41 +0000 (15:18 +0100)
committerPierre d'Herbemont <pdherbemont@free.fr>
Fri, 19 Feb 2010 17:48:56 +0000 (18:48 +0100)
Signed-off-by: Pierre d'Herbemont <pdherbemont@free.fr>
projects/macosx/framework/Headers/Public/VLCMedia.h
projects/macosx/framework/Sources/VLCMedia.m

index 69e3d083aec27cc36188464b6227b8a71fcb6f87..5c00b187271639b245172fe5f881b043d45c8bbd 100644 (file)
@@ -224,4 +224,10 @@ typedef enum VLCMediaState
  * The receiver's state, such as Playing, Error, NothingSpecial, Buffering.
  */
 @property (readonly) VLCMediaState state;
+
+/**
+ * Sets a value of the metaDictionary
+ */
+- (void)setValue:(id)value forMeta:(NSString *)VLCMetaInformation;
+
 @end
index e4cbef933876fe34e2cc0f19448bc2400343be27..5762a7bf5532b2610415cc72001aba2673438d7c 100644 (file)
@@ -211,6 +211,13 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
     return self;
 }
 
+- (void)setValue:(NSString *)value forMeta:(NSString *)meta
+{
+    libvlc_meta_t metaName = [VLCMedia stringToMetaType:meta];
+    NSAssert(metaName >= 0, @"Invalid meta");
+    libvlc_media_set_meta(p_md, metaName, [value UTF8String]);
+}
+
 - (void)release
 {
     @synchronized(self)