Index: src/Libraries/Mtp/Mtp/Folder.cs =================================================================== --- src/Libraries/Mtp/Mtp/Folder.cs (revision 4600) +++ src/Libraries/Mtp/Mtp/Folder.cs (working copy) @@ -210,6 +210,9 @@ { public uint folder_id; public uint parent_id; +#if LIBMTP8 + public uint storage_id; +#endif [MarshalAs(UnmanagedType.LPStr)] public string name; public IntPtr sibling; // LIBMTP_folder_t* public IntPtr child; // LIBMTP_folder_t* Index: src/Libraries/Mtp/Mtp/Album.cs =================================================================== --- src/Libraries/Mtp/Mtp/Album.cs (revision 4600) +++ src/Libraries/Mtp/Mtp/Album.cs (working copy) @@ -131,7 +131,11 @@ if (saved) { saved = LIBMTP_Update_Album (device.Handle, ref album) == 0; } else { - saved = LIBMTP_Create_New_Album (device.Handle, ref album, 0) == 0; +#if LIBMTP8 + saved = LIBMTP_Create_New_Album (device.Handle, ref album) == 0; +#else + saved = LIBMTP_Create_New_Album (device.Handle, ref album, 0) == 0; +#endif } if (album.tracks != IntPtr.Zero) { @@ -210,8 +214,13 @@ [DllImport("libmtp.dll")] internal static extern IntPtr LIBMTP_Get_Album (MtpDeviceHandle handle, uint albumId); // LIBMTP_album_t* +#if LIBMTP8 [DllImport("libmtp.dll")] + internal static extern int LIBMTP_Create_New_Album (MtpDeviceHandle handle, ref AlbumStruct album); +#else + [DllImport("libmtp.dll")] internal static extern int LIBMTP_Create_New_Album (MtpDeviceHandle handle, ref AlbumStruct album, uint parentId); +#endif [DllImport("libmtp.dll")] internal static extern int LIBMTP_Update_Album (MtpDeviceHandle handle, ref AlbumStruct album); @@ -221,6 +230,10 @@ internal struct AlbumStruct { public uint album_id; +#if LIBMTP8 + public uint parent_id; + public uint storage_id; +#endif [MarshalAs(UnmanagedType.LPStr)] public string name; Index: src/Libraries/Mtp/Mtp/Track.cs =================================================================== --- src/Libraries/Mtp/Mtp/Track.cs (revision 4600) +++ src/Libraries/Mtp/Mtp/Track.cs (working copy) @@ -129,6 +129,13 @@ set { trackStruct.usecount = value; } } +#if LIBMTP8 + public string Composer { + get { return trackStruct.composer; } + set { trackStruct.composer = value; } + } +#endif + public Track (string filename, ulong filesize) : this (new TrackStruct (), null) { this.trackStruct.filename = filename; @@ -195,7 +202,11 @@ internal static void SendTrack (MtpDeviceHandle handle, string path, ref TrackStruct metadata, ProgressFunction callback, IntPtr data, uint parent) { +#if LIBMTP8 + if (LIBMTP_Send_Track_From_File (handle, path, ref metadata, callback, data) != 0) +#else if (LIBMTP_Send_Track_From_File (handle, path, ref metadata, callback, data, parent) != 0) +#endif { LibMtpException.CheckErrorStack (handle); throw new LibMtpException (ErrorCode.General, "Could not upload the track"); @@ -226,8 +237,13 @@ [DllImport("libmtp.dll")] private static extern int LIBMTP_Get_Track_To_File (MtpDeviceHandle handle, uint trackId, string path, ProgressFunction callback, IntPtr data); +#if LIBMTP8 [DllImport("libmtp.dll")] + private static extern int LIBMTP_Send_Track_From_File (MtpDeviceHandle handle, string path, ref TrackStruct track, ProgressFunction callback, IntPtr data); +#else + [DllImport("libmtp.dll")] private static extern int LIBMTP_Send_Track_From_File (MtpDeviceHandle handle, string path, ref TrackStruct track, ProgressFunction callback, IntPtr data, uint parentHandle); +#endif [DllImport("libmtp.dll")] private static extern int LIBMTP_Update_Track_Metadata (MtpDeviceHandle handle, ref TrackStruct metadata); @@ -244,9 +260,15 @@ { public uint item_id; public uint parent_id; - +#if LIBMTP8 + public uint storage_id; +#endif + [MarshalAs(UnmanagedType.LPStr)] public string title; [MarshalAs(UnmanagedType.LPStr)] public string artist; +#if LIBMTP8 + [MarshalAs(UnmanagedType.LPStr)] public string composer; +#endif [MarshalAs(UnmanagedType.LPStr)] public string genre; [MarshalAs(UnmanagedType.LPStr)] public string album; [MarshalAs(UnmanagedType.LPStr)] public string date; Index: src/Libraries/Mtp/Makefile.am =================================================================== --- src/Libraries/Mtp/Makefile.am (revision 4600) +++ src/Libraries/Mtp/Makefile.am (working copy) @@ -2,6 +2,10 @@ TARGET = library LINK = $(REF_MTP) +if LIBMTP_EIGHT +BUILD_DEFINES = "-define:LIBMTP8" +endif + SOURCES = \ Mtp/Album.cs \ Mtp/Error.cs \ Index: build/m4/banshee/dap-mtp.m4 =================================================================== --- build/m4/banshee/dap-mtp.m4 (revision 4600) +++ build/m4/banshee/dap-mtp.m4 (working copy) @@ -20,5 +20,6 @@ fi AM_CONDITIONAL(ENABLE_MTP, test "x$enable_libmtp" = "xyes") + AM_CONDITIONAL(LIBMTP_EIGHT, test "x$LIBMTP_SO_MAP" = "xlibmtp.so.8") ])