Example #1
0
        public ArtistInspector(string artist, string album, string track)
        {
            _artist = artist;
            _album = album;
            _track = track;
            InitializeComponent();

            EchoNest.Response r = EchoNest.SearchArtist(artist);
            _EnArtist = r.GetArtist();

            if (_EnArtist != null)
            {
                AlbumArtWorker w = new AlbumArtWorker();
                List<string> urls = _EnArtist.images.ConvertAll<string>(delegate(EchoNest.Document d) { return d.url; });
                w.Start(this, urls, OnAlbumArtRetrieved);
                List<EchoNest.Artist> similars = EchoNest.GetSimilar(_EnArtist.id).artists;
                foreach (EchoNest.Artist a in similars)
                    _SimilarArtists.Add(a.name);
            }
            else
                _Artist.Text = "Echonest API Error";
        }
Example #2
0
        void PopulateNowPlaying()
        {
            SonosClient.Metadata np = _Sonos.GetTrackMetadata(_ZoneGroup);

            _Artist.Text = np.Artist;
            _Album.Text = np.Album;
            _Track.Text = np.Track;
            _TotalSeconds = np.PlayTime;

            // Update Scrubber:
            int seconds = _Sonos.GetTrackTime(_ZoneGroup);
            if (_TotalSeconds != 0)
                _TrackProgress.Value = (int)(100 * (float)seconds / (float)_TotalSeconds);

            // Start up album art threads
            if (!string.IsNullOrEmpty(np.AlbumArtUri))
            {
                AlbumArtWorker w = new AlbumArtWorker();
                w.Start(this, new List<string>(new string[] { np.AlbumArtUri }), OnAlbumArtRetrieved);
            }

            GetAmazonAlbumArt(np);
        }
Example #3
0
 void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     List<string> urls = e.Result as List<string>;
     if (urls != null && urls.Count > 0)
     {
         AlbumArtWorker w = new AlbumArtWorker();
         w.Start(this, urls, OnAlbumArtRetrieved);
     }
 }