private void mPlayer_onInfoLoaded(object sender, SongCallbackEventArgs e) { if (InvokeRequired) { BeginInvoke(new Action(() => { loadInfo(e); })); return; } loadInfo(e); }
void loadInfo(SongCallbackEventArgs e) { SongEntry current = Program.songsInFolder[Program.folders[FolderPos]][SongPos]; Console.WriteLine("Load"); if (e.Entry != current) { return; } lblAlbum.Text = mPlayer.Album; lblArtist.Text = mPlayer.Artist; lblSongName.Text = mPlayer.Title; imgAlbum.Image = mPlayer.Cover == null ? Properties.Resources.default_cover : mPlayer.Cover; lblTimeTotal.Text = mPlayer.TotalPosition.toTimeStr(); }