Browse Source

macosx/framework : added method setValue:forMeta: to VLCMedia

Signed-off-by: Pierre d'Herbemont <pdherbemont@free.fr>
Emmanuel de Roux 15 years ago
parent
commit
a2af666a73
2 changed files with 13 additions and 0 deletions
  1. 6 0
      Headers/Public/VLCMedia.h
  2. 7 0
      Sources/VLCMedia.m

+ 6 - 0
Headers/Public/VLCMedia.h

@@ -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

+ 7 - 0
Sources/VLCMedia.m

@@ -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)