Пример #1
0
        private void FoundLyrics(string lyrics)
        {
            // write out lyrics
            SaveLyricsFile(_song, lyrics);

            _lastLyrics = lyrics;

            if (LyricsFound != null)
            {
                var e = new LyricsFoundEventArgs(lyrics);
                LyricsFound(this, e);
            }
        }
Пример #2
0
        public void LoadLyrics(ThreePM.MusicPlayer.SongInfo song, bool skipTextFile, bool onlyTextFile, bool skipOtherSongsInDatabase)
        {
            if (song.FileName.StartsWith("http://", StringComparison.OrdinalIgnoreCase) && string.IsNullOrEmpty(song.Title) && string.IsNullOrEmpty(song.Artist))
            {
                _lastLyrics = "";

                if (LyricsFound != null)
                {
                    var e = new LyricsFoundEventArgs("");
                    LyricsFound(this, e);
                }
                return;
            }

            _currentLyricsObject = 0;

            _song = song;

            if (onlyTextFile)
            {
                if (!CheckForLyricsTextFile())
                {
                    LyricsNotFound?.Invoke(this, EventArgs.Empty);
                }

                return;
            }

            // check for other songs in the DB
            if (!skipOtherSongsInDatabase && CheckForLyricsFromDatabase())
            {
                return;
            }

            if (skipTextFile || CheckForLyricsTextFile() == false)
            {
                SearchCurrentLyricsSite();
            }
        }
Пример #3
0
 private void Helper_LyricsFound(object sender, LyricsFoundEventArgs e)
 {
     _library.SetLyrics(_helper.Song.Title, _helper.Song.Artist, e.Lyrics);
     _lastLyrics = e.Lyrics;
 }