~ubuntu-branches/ubuntu/quantal/banshee/quantal

« back to all changes in this revision

Viewing changes to src/Libraries/Mtp/Mtp/Track.cs

  • Committer: Package Import Robot
  • Author(s): Chow Loong Jin
  • Date: 2012-01-23 23:16:49 UTC
  • mfrom: (6.3.22 experimental)
  • Revision ID: package-import@ubuntu.com-20120123231649-safm1f8eycltcgsf
Tags: 2.3.4.ds-1ubuntu1
* Merge from Debian Experimental, remaining changes:
  + Enable and recommend SoundMenu and Disable NotificationArea by default
  + Disable boo and karma extensions
  + Enable and suggest u1ms
  + Move desktop file for Meego UI to /usr/share/une/applications
  + Change the url for the Amazon store redirector
  + [08dea2c] Revert "Fix invalid cast causing ftbfs with libgpod"
* [b617fe0] Convert Ubuntu-specific patches to gbp-pq patches
* Also fixes Launchpad bugs:
  - Fixes race condition while starting (LP: #766303)

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
            set { trackStruct.usecount = value; }
135
135
        }
136
136
 
137
 
#if LIBMTP8
138
137
        public string Composer {
139
138
            get { return trackStruct.composer; }
140
139
            set { trackStruct.composer = value; }
141
140
        }
142
 
#endif
143
141
 
144
142
        public Track (string filename, ulong filesize) : this (new TrackStruct (), null)
145
143
        {
216
214
 
217
215
        internal static void SendTrack (MtpDeviceHandle handle, string path, ref TrackStruct metadata, ProgressFunction callback, IntPtr data)
218
216
        {
219
 
#if LIBMTP8
220
217
            if (LIBMTP_Send_Track_From_File (handle, path, ref metadata, callback, data) != 0)
221
 
#else
222
 
            if (LIBMTP_Send_Track_From_File (handle, path, ref metadata, callback, data, metadata.parent_id) != 0)
223
 
#endif
224
218
            {
225
219
                LibMtpException.CheckErrorStack (handle);
226
220
                throw new LibMtpException (ErrorCode.General, "Could not upload the track");
251
245
        [DllImport("libmtp.dll")]
252
246
        private static extern int LIBMTP_Get_Track_To_File (MtpDeviceHandle handle, uint trackId, string path, ProgressFunction callback, IntPtr data);
253
247
 
254
 
#if LIBMTP8
255
248
        [DllImport("libmtp.dll")]
256
249
        private static extern int LIBMTP_Send_Track_From_File (MtpDeviceHandle handle, string path, ref TrackStruct track, ProgressFunction callback, IntPtr data);
257
 
#else
258
 
        [DllImport("libmtp.dll")]
259
 
        private static extern int LIBMTP_Send_Track_From_File (MtpDeviceHandle handle, string path, ref TrackStruct track, ProgressFunction callback, IntPtr data, uint parentHandle);
260
 
#endif
261
250
 
262
251
        [DllImport("libmtp.dll")]
263
252
        private static extern int LIBMTP_Update_Track_Metadata (MtpDeviceHandle handle, ref TrackStruct metadata);
274
263
    {
275
264
        public uint item_id;
276
265
        public uint parent_id;
277
 
#if LIBMTP8
278
266
        public uint storage_id;
279
 
#endif
280
267
 
281
268
        [MarshalAs(UnmanagedType.LPStr)] public string title;
282
269
        [MarshalAs(UnmanagedType.LPStr)] public string artist;
283
 
#if LIBMTP8
284
270
        [MarshalAs(UnmanagedType.LPStr)] public string composer;
285
 
#endif
286
271
        [MarshalAs(UnmanagedType.LPStr)] public string genre;
287
272
        [MarshalAs(UnmanagedType.LPStr)] public string album;
288
273
        [MarshalAs(UnmanagedType.LPStr)] public string date;