private void SoundPlayerTick(object sender, SoundPlayerTickEventsArgs e) { Debug.WriteLine($"Elapsed Time: {e.ElapsedTime}"); TimelineTrackBase track = timeline.GetCurrentPhonemeFromElapsedTime(e.ElapsedTime / 10); pbPhonemeImage.Image = track != null?PhonemeTemplate.GetPhonemeImage(track.Name) : LipSyncTimeLineControl.Properties.Resources.Phoneme_None; }
private void SoundPlayerTick(object sender, SoundPlayerTickEventsArgs e) { Debug.WriteLine($"Elapsed Time: {e.ElapsedTime}"); TimelineTrackBase track = timeline.GetCurrentPhonemeFromElapsedTime(e.ElapsedTime / 10); void Action() => btnPhonemeImage.BackgroundImage = track != null?PhonemeTemplate.GetPhonemeImage(track.Name) : LipSyncTimeLineControl.Properties.Resources.Phoneme_None; if (InvokeRequired) { Invoke((Action)Action); } else { Action(); } }