Example #1
0
        private void btnAddLyrics_Click(object sender, System.EventArgs e)
        {
            string sUrl = (string) lsvSearchResults.SelectedItems[0].Tag;

            LyricsFairySearcher pSearcher = new LyricsFairySearcher();
            string sLyrics = pSearcher.GetLyrics(sUrl);

            IiTunes piTunesApp = new iTunesAppClass();
            IITFileOrCDTrack pTrack = (IITFileOrCDTrack) piTunesApp.SelectedTracks[1];
            pTrack.Lyrics = sLyrics;
        }
Example #2
0
        private void btnSearch_Click(object sender, System.EventArgs e)
        {
            IiTunes piTunesApp = new iTunesAppClass();
            string sTrackName = piTunesApp.SelectedTracks[1].Name;

            LyricsFairySearcher pSearcher = new LyricsFairySearcher();
            LyricSearchResultCollection pResults = pSearcher.Search(sTrackName);

            lsvSearchResults.BeginUpdate();
            lsvSearchResults.Items.Clear();
            foreach (LyricSearchResult pResult in pResults)
            {
                string[] lItems = new string[] {pResult.Artist, pResult.Album, pResult.Song};
                ListViewItem lListViewItem = new ListViewItem(lItems);
                lListViewItem.Tag = pResult.Url;
                lsvSearchResults.Items.Add(lListViewItem);
            }
            lsvSearchResults.EndUpdate();
        }