Commits

shuerhaaken committed 9f7405b

adapt new image api for vapi

Comments (0)

Files changed (3)

+commit dac5aee1b0eb26282125d6d82f00a63fd1c822da
+Author: Jörn Magens <shuerhaaken@googlemail.com>
+Date:   Fri Jun 28 16:45:14 2013 +0200
+
+    start writing new api for image reading/writing
+
 commit 4561d945791aa1a41188a5b9f307f99b35eccb5d
 Author: Jörn Magens <shuerhaaken@googlemail.com>
 Date:   Thu May 23 11:39:42 2013 +0200

bindings/c/taginfo_c.h

     char *                  data;
     int                     data_length;
     TagInfo_ImageType       image_type;
-    TagInfo_MediaFileType   image_file_type;
+    TagInfo_ImageFileType   image_file_type;
 } TagInfo_Image;
 
 

bindings/vala/libtaginfo_c.vapi

 [CCode (cprefix = "TagInfo_", lower_case_cprefix = "taginfo_", cheader_filename = "taginfo_c.h")]
 namespace TagInfo
 {
-	[CCode (cname = "TagInfo_ImageFileType", cprefix = "TagInfo_IMAGE_TYPE_")]
+	[CCode (cname = "TagInfo_ImageFileType", cprefix = "TagInfo_IMAGE_FILE_TYPE_")]
 	public enum ImageFileType
 	{
 		UNKNOWN,
 		WMV
 	}
 	
+	[CCode (cname = "TagInfo_ImageType", cprefix = "IMAGE_TYPE_")]
+	public enum ImageType
+	{
+		OTHER,
+		ICON,
+		COVER_FRONT,
+		COVER_BACK,
+		MEDIA,
+		ILLUSTRATION,
+		ARTIST_LOGO
+	}
+	
+	[CCode (free_function = "taginfo_image_free")]
+	[Compact]
+	public class Image
+	{
+		[CCode (array_length_cname = "data_length")]
+		public char[] data;
+		public ImageType image_type;
+		public ImageFileType image_file_type;
+	}
+
 	[CCode (free_function = "taginfo_info_free")]
 	[Compact]
 	public class Info
 			[CCode (cname = "taginfo_info_get_channels")]
 			get;
 		}
-		// A quick lookup without extracting the image
+		// A quick lookup without extracting anything
 		public bool has_image {
 			[CCode (cname = "taginfo_info_get_has_image")]
 			get;
 		
 		// IMAGE ACCESS
 		bool can_handle_image();
-		public bool get_image (out uint8[] data, out ImageFileType image_file_type);
-		public bool set_image (uint8[] data, ImageFileType image_file_type);
+		public Image[] get_images ();
+		public void set_images (Image[] images);
 		
 		// LYRICS ACCESS
 		bool can_handle_lyrics();