Exemplo n.º 1
0
        /// <summary>
        /// Sets the lyrics taking into account varios factors
        /// </summary>
        /// <param name="currentTrack"></param>
        /// <param name="result"></param>
        /// <param name="index"></param>
        private void SetLyrics(IITFileOrCDTrack currentTrack, LyricsResult result, int index)
        {
            string lyrics;
            var    isFound = ResultCodes.Found;

            if (result.lyrics.Equals("instrumental", StringComparison.OrdinalIgnoreCase))
            {
                lyrics = result.lyrics;
            }
            else
            {
                lyrics = LyricsDecoder.DecodeLyrics(result.url);
                if (string.IsNullOrEmpty(lyrics))
                {
                    isFound = ResultCodes.NotFound;
                }
            }
            if (isFound == ResultCodes.Found)
            {
                currentTrack.Lyrics = lyrics;
            }
            this.mForm.Invoke(this.mForm.m_DelegateUpdateRow, new Object[] { index, isFound });
        }
Exemplo n.º 2
0
        private void AboutBox1_Load(object sender, EventArgs e)
        {
            try
            {
                String tempPath = "";
                String artist   = currentTrack.Artist;
                String song     = currentTrack.Name;

                lblArtist.Text = artist;
                lblSong.Text   = song;
                if (currentTrack.Artwork[1] != null)
                {
                    tempPath = System.IO.Path.GetTempPath() + "\\itunesart";
                    currentTrack.Artwork[1].SaveArtworkToFile(tempPath);
                }
                artPictureBox.ImageLocation = tempPath;
                if (lyricsWiki.checkSongExists(artist, song) == true)
                {
                    var result = lyricsWiki.getSong(artist, song);
                    lyricsBox.Text = result.lyrics.Equals("instrumental", StringComparison.OrdinalIgnoreCase) ? result.lyrics : LyricsDecoder.DecodeLyrics(result.url);
                }
                else
                {
                    lyricsBox.Text    = Resources.ManualUpdate_AboutBox1_Load_No_Result;
                    btnUpdate.Enabled = false;
                }
            }
            catch (Exception)
            {
            }
        }