Ejemplo n.º 1
0
        public AmzMp3Downloader(Xspf.Track track)
        {
            UserAgent    = String.Format("Amazon MP3 Downloader (Linux {0} en_US)", AmazonMp3DownloaderCompatVersion);
            TempPathRoot = Path.Combine(Path.GetTempPath(), "banshee-amz-downloader");
            Uri          = track.Locations[0];
            Track        = track;
            Name         = String.Format("{0} ({1})", Track.Title, Track.Creator);

            var meta = track.FindMetaEntry(new Uri("http://www.amazon.com/dmusic/trackType"));

            FileExtension = !meta.Equals(Xspf.MetaEntry.Zero) ? meta.Value : "mp3";
        }
Ejemplo n.º 2
0
 public override void Save (Stream stream, ITrackModelSource source)
 {
     Xspf.Playlist playlist = new Xspf.Playlist ();
     playlist.Title = source.Name;
     playlist.Date = DateTime.Now;
     for (int ii = 0; ii < source.TrackModel.Count; ii++) {
         TrackInfo track = source.TrackModel[ii];
         Xspf.Track xtrack = new Xspf.Track ();
         xtrack.AddLocation (new Uri (ExportUri (track.Uri), UriKind.RelativeOrAbsolute));
         xtrack.Title = track.TrackTitle;
         xtrack.Creator = track.ArtistName;
         xtrack.Album = track.AlbumTitle;
         if (track.TrackNumber >= 0) {
             xtrack.TrackNumber = (uint)track.TrackNumber;
         }
         xtrack.Duration = track.Duration;
         playlist.AddTrack (xtrack);
     }
     playlist.Save (stream);
 }
Ejemplo n.º 3
0
 public override void Save(Stream stream, ITrackModelSource source)
 {
     Xspf.Playlist playlist = new Xspf.Playlist();
     playlist.Title = source.Name;
     playlist.Date  = DateTime.Now;
     for (int ii = 0; ii < source.TrackModel.Count; ii++)
     {
         TrackInfo  track  = source.TrackModel[ii];
         Xspf.Track xtrack = new Xspf.Track();
         xtrack.AddLocation(new Uri(ExportUri(track.Uri), UriKind.RelativeOrAbsolute));
         xtrack.Title   = track.TrackTitle;
         xtrack.Creator = track.ArtistName;
         xtrack.Album   = track.AlbumTitle;
         if (track.TrackNumber >= 0)
         {
             xtrack.TrackNumber = (uint)track.TrackNumber;
         }
         xtrack.Duration = track.Duration;
         playlist.AddTrack(xtrack);
     }
     playlist.Save(stream);
 }
Ejemplo n.º 4
0
 public void RemoveTrack(Track track)
 {
     track.Parent = null;
     tracks.Remove(track);
 }
Ejemplo n.º 5
0
 public void AddTrack(Track track)
 {
     track.Parent = this;
     tracks.Add(track);
 }