예제 #1
0
        protected override void StartInternal(Song song)
        {
            this.GetFetchRequestData(song).Status = LyricsFetchStatus.Fetching;

            LyricsFetcher fetcher = new LyricsFetcher();

            fetcher.Sources      = this.Sources;
            fetcher.StatusEvent += new EventHandler <LyricsFetchStatusEventArgs>(fetcher_StatusEvent);

            Thread thread = new Thread(new ParameterizedThreadStart(fetcher.FetchSongLyrics));

            thread.IsBackground = true;
            thread.Start(song);
        }
예제 #2
0
        public void TestLyricsFetch()
        {
            LyricsFetcher lf = new LyricsFetcher();
            lf.Sources.Add(new LyricsSourceLyrdb());
            lf.Sources.Add(new LyricsSourceLyricsFly());

            lf.StatusEvent += new EventHandler<LyricsFetchStatusEventArgs>(lf_StatusEvent);

            List<Song> songs = this.GetSongs();

            foreach (Song s in songs)
                Assert.IsNull(s.Lyrics);

            foreach (Song s in songs)
                lf.FetchSongLyrics(s);

            foreach (Song s in songs)
                Assert.AreNotEqual("", s.Lyrics);
        }
예제 #3
0
        protected override void StartInternal(Song song)
        {
            this.GetFetchRequestData(song).Status = LyricsFetchStatus.Fetching;

            LyricsFetcher fetcher = new LyricsFetcher();
            fetcher.Sources = this.Sources;
            fetcher.StatusEvent += new EventHandler<LyricsFetchStatusEventArgs>(fetcher_StatusEvent);

            Thread thread = new Thread(new ParameterizedThreadStart(fetcher.FetchSongLyrics));
            thread.IsBackground = true;
            thread.Start(song);
        }