/// <summary> /// Searches for a matching lyrics file and loads it. /// </summary> /// <param name="SongInfo">The ISongInfo instance that holds informations about the song.</param> private async void OpenLyricsAsync(ISongInfo SongInfo) { this.viewModel.LyricsReader = null; this.viewModel.Lyrics = "Dalszöveget keresünk..."; this.viewModel.LyricsReader = await LyricsProvider.FindLyricsAsync(SongInfo); this.LyricsServerModule.LyricsReader = this.viewModel.LyricsReader; }
private async void MainWindow_Load(object sender, EventArgs e) { //spotify.GetSpotifyAPIRef().OnTrackChange += Spotify_OnTrackChange; lyricsProvider = new LyricsProvider(); configWindow = new ConfigurationWindow(); Play_PauseButton.Text = !spotify.Playing ? "Pause" : "Play"; if (await spotify.Connect()) { await InvokeLyricSearch(); } }
private void MainWindow_Loaded(object sender, RoutedEventArgs e) { var openDialog = new OpenFileDialog { Filter = "MP3 (*.mp3)|*.mp3|모든 파일 (*.*)|*.*" }; if (openDialog.ShowDialog().Value) { var player = new MediaPlayer(); var provider = new LyricsProvider(player); var document = new LyricsDocument($@"{Path.GetDirectoryName(openDialog.FileName)}\{Path.GetFileNameWithoutExtension(openDialog.FileName)}.slr"); player.Open(new Uri(openDialog.FileName)); lyricsView.Provider = provider; lyricsView.Document = document; player.Play(); } else { Application.Current.Shutdown(); } }