View | Details | Raw Unified
Collapse All | Expand All

(-) src/Libraries/Mtp/Mtp/Folder.cs (+3 lines)
 Lines 210-215    Link Here 
	{
	{
		public uint folder_id;
		public uint folder_id;
		public uint parent_id;
		public uint parent_id;
#if LIBMTP8
		public uint storage_id;
#endif
		[MarshalAs(UnmanagedType.LPStr)] public string name;
		[MarshalAs(UnmanagedType.LPStr)] public string name;
		public IntPtr sibling; // LIBMTP_folder_t*
		public IntPtr sibling; // LIBMTP_folder_t*
		public IntPtr child;   // LIBMTP_folder_t*
		public IntPtr child;   // LIBMTP_folder_t*
(-) src/Libraries/Mtp/Mtp/Album.cs (-1 / +14 lines)
 Lines 131-137    Link Here 
            if (saved) {
            if (saved) {
                saved = LIBMTP_Update_Album (device.Handle, ref album) == 0;
                saved = LIBMTP_Update_Album (device.Handle, ref album) == 0;
            } else {
            } 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) {
            if (album.tracks != IntPtr.Zero) {
 Lines 210-217    Link Here 
		[DllImport("libmtp.dll")]
		[DllImport("libmtp.dll")]
		internal static extern IntPtr LIBMTP_Get_Album (MtpDeviceHandle handle, uint albumId); // LIBMTP_album_t*
		internal static extern IntPtr LIBMTP_Get_Album (MtpDeviceHandle handle, uint albumId); // LIBMTP_album_t*
#if LIBMTP8
		[DllImport("libmtp.dll")]
		[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);
		internal static extern int LIBMTP_Create_New_Album (MtpDeviceHandle handle, ref AlbumStruct album, uint parentId);
#endif
		[DllImport("libmtp.dll")]
		[DllImport("libmtp.dll")]
		internal static extern int LIBMTP_Update_Album (MtpDeviceHandle handle, ref AlbumStruct album);
		internal static extern int LIBMTP_Update_Album (MtpDeviceHandle handle, ref AlbumStruct album);
 Lines 221-226    Link Here 
    internal struct AlbumStruct
    internal struct AlbumStruct
    {
    {
        public uint album_id;
        public uint album_id;
#if LIBMTP8
        public uint parent_id;
        public uint storage_id;
#endif
        [MarshalAs(UnmanagedType.LPStr)]
        [MarshalAs(UnmanagedType.LPStr)]
        public string name;
        public string name;
(-) src/Libraries/Mtp/Mtp/Track.cs (-1 / +23 lines)
 Lines 129-134    Link Here 
			set { trackStruct.usecount = value; }
			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)
		public Track (string filename, ulong filesize) : this (new TrackStruct (), null)
		{
		{
			this.trackStruct.filename = filename;
			this.trackStruct.filename = filename;
 Lines 195-201    Link Here 
		internal static void SendTrack (MtpDeviceHandle handle, string path, ref TrackStruct metadata, ProgressFunction callback, IntPtr data, uint parent)
		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)
			if (LIBMTP_Send_Track_From_File (handle, path, ref metadata, callback, data, parent) != 0)
#endif
			{
			{
				LibMtpException.CheckErrorStack (handle);
				LibMtpException.CheckErrorStack (handle);
				throw new LibMtpException (ErrorCode.General, "Could not upload the track");
				throw new LibMtpException (ErrorCode.General, "Could not upload the track");
 Lines 226-233    Link Here 
		[DllImport("libmtp.dll")]
		[DllImport("libmtp.dll")]
		private static extern int LIBMTP_Get_Track_To_File (MtpDeviceHandle handle, uint trackId, string path, ProgressFunction callback, IntPtr data);
		private static extern int LIBMTP_Get_Track_To_File (MtpDeviceHandle handle, uint trackId, string path, ProgressFunction callback, IntPtr data);
#if LIBMTP8
		[DllImport("libmtp.dll")]
		[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);
		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")]
		[DllImport("libmtp.dll")]
	    private static extern int LIBMTP_Update_Track_Metadata (MtpDeviceHandle handle, ref TrackStruct metadata);
	    private static extern int LIBMTP_Update_Track_Metadata (MtpDeviceHandle handle, ref TrackStruct metadata);
 Lines 244-252    Link Here 
	{
	{
		public uint item_id;
		public uint item_id;
		public uint parent_id;
		public uint parent_id;
		
#if LIBMTP8
		public uint storage_id;
#endif
		[MarshalAs(UnmanagedType.LPStr)] public string title;
		[MarshalAs(UnmanagedType.LPStr)] public string title;
		[MarshalAs(UnmanagedType.LPStr)] public string artist;
		[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 genre;
		[MarshalAs(UnmanagedType.LPStr)] public string album;
		[MarshalAs(UnmanagedType.LPStr)] public string album;
		[MarshalAs(UnmanagedType.LPStr)] public string date;
		[MarshalAs(UnmanagedType.LPStr)] public string date;
(-) src/Libraries/Mtp/Makefile.am (+4 lines)
 Lines 2-7    Link Here 
TARGET = library
TARGET = library
LINK = $(REF_MTP)
LINK = $(REF_MTP)
if LIBMTP_EIGHT
BUILD_DEFINES = "-define:LIBMTP8"
endif
SOURCES =  \
SOURCES =  \
	Mtp/Album.cs \
	Mtp/Album.cs \
	Mtp/Error.cs \
	Mtp/Error.cs \
(-) build/m4/banshee/dap-mtp.m4 (+1 lines)
 Lines 20-24    Link Here 
	fi
	fi
	AM_CONDITIONAL(ENABLE_MTP, test "x$enable_libmtp" = "xyes")
	AM_CONDITIONAL(ENABLE_MTP, test "x$enable_libmtp" = "xyes")
	AM_CONDITIONAL(LIBMTP_EIGHT, test "x$LIBMTP_SO_MAP" = "xlibmtp.so.8")
])
])