Ejemplo n.º 1
0
 public void LoadFullBank(ref List<Artist> artists, ref Dictionary<int, Album> albums, ref Dictionary<int, Song> songs, ref List<int> library)
 {
     foreach (int j in library)
     {
         songs[j].SongLocation = SongLocations.Library;
     }
     
     for (int i = 0; i < artists.Count; i++)
     {
         _AllArtists.Add(artists[i].ID, artists[i]);
     }
     artists.Clear();
     
     foreach (int k in _AllArtists.Keys)
     {
         foreach (int k2 in _AllArtists[k].Albums.Keys)
         {
             _AllArtists[k].Albums[k2].Name = albums[k2].Name;
             _AllArtists[k].Albums[k2].ReleaseDate = albums[k2].ReleaseDate;
             _AllArtists[k].Albums[k2].Parent = _AllArtists[k];
             foreach (int k3 in albums[k2].Songs.Keys)
             {
                 Song s = new Song();
                 s.ID = k3;
                 s.Duration = songs[k3].Duration;
                 s.ParentAlbum = _AllArtists[k].Albums[k2];
                 s.ParentArtist = _AllArtists[k];
                 s.SongLocation = songs[k3].SongLocation;
                 s.Title = songs[k3].Title;
                 s.TrackNumber = songs[k3].TrackNumber;
                 s.UploadDate = songs[k3].UploadDate;
                 _AllArtists[k].Albums[k2].Songs.Add(k3, s);
             }
         }
     }
     albums.Clear();
     songs.Clear();
     _RecentUpdateTime = DateTime.Now;
 }
Ejemplo n.º 2
0
        private void HandleSongChunks(ChunkDataOfSongDataTepVWBla curChunk)
        {
            foreach (int k in curChunk.Chunk.Keys)
            {
                SongData sd = curChunk.Chunk[k];
                Song s = new Song();
                s.Duration = TimeSpan.FromTicks(sd.Duration);
                s.ID = k;
                s.SongLocation = (SongLocations)sd.Location;
                s.Title = sd.Title;
                s.TrackNumber = sd.TrackNumber;
                s.UploadDate = new DateTime(sd.UploadDate);
                _TempSongs.Add(k, s);
            }

            int nextChunkNumber = curChunk.ChunkNumber + 1;
            if (nextChunkNumber < curChunk.TotalChunks)
            {
                ssc.RequestNextSongChunkAsync(nextChunkNumber);
            }
            else
            {
                done += 1;
                if (done == 15)
                    FinishMediaLoad();
            }
        }
Ejemplo n.º 3
0
        private void HandleAlbumChunks(ChunkDataOfAlbumDataTepVWBla curChunk)
        {
            foreach (int k in curChunk.Chunk.Keys)
            {
                AlbumData ad = curChunk.Chunk[k];
                Album a = new Album();
                a.ID = k;
                a.Name = ad.Name;
                a.ReleaseDate = new DateTime(ad.ReleaseDate);
                foreach (int sid in ad.SongIDs)
                {
                    Song s = new Song();
                    s.ID = sid;
                    a.Songs.Add(sid, s);
                }
                _TempAlbums.Add(k, a);
            }

            int nextChunkNumber = curChunk.ChunkNumber + 1;
            if (nextChunkNumber < curChunk.TotalChunks)
            {
                ssc.RequestNextAlbumChunkAsync(nextChunkNumber);
            }
            else
            {
                done += 4;
                if (done == 15)
                    FinishMediaLoad();
            }
        }