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"; }
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); }
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); }
public void RemoveTrack(Track track) { track.Parent = null; tracks.Remove(track); }
public void AddTrack(Track track) { track.Parent = this; tracks.Add(track); }