private void FreshChapterView() { if (InvokeRequired) { Invoke(new MethodInvoker(FreshChapterView)); return; } this.Cursor = Cursors.WaitCursor; try { listChapters.Items.Clear(); //fill list foreach (ChapterEntry c in pgc.Chapters) { //don't show short last chapter depending on settings if (pgc.Duration != TimeSpan.Zero && miIgnoreShortLastChapter.Checked && c.Equals(pgc.Chapters.Last()) && (pgc.Duration.Add(-c.Time).TotalSeconds < Settings.Default.ShortChapterSeconds)) { continue; } listChapters.Items.Add(new ListViewItem(new string[] { c.Time.ToShortString(), c.Name })); } if (intIndex < listChapters.Items.Count && listChapters.Items[intIndex] != null) { //select it listChapters.Items[intIndex].Selected = true; //scroll to it listChapters.Items[intIndex].EnsureVisible(); } //update status tsslDuration.Text = "Duration: " + pgc.Duration.ToShortString(); tsslFps.Text = pgc.FramesPerSecond.ToString("0.000") + "fps"; tsslLang.Text = pgc.LangCode + " (" + LanguageCodes.GetName(pgc.LangCode) + ")"; tsslStatus.Text = "Chapters loaded."; //check the current fps foreach (MenuItem mi in menuCurrentFps.MenuItems) { double fps = Convert.ToDouble(mi.Text, new NumberFormatInfo()); mi.Checked = (Math.Round(fps, 3) == Math.Round(pgc.FramesPerSecond, 3)); } } catch (Exception ex) { Trace.WriteLine(ex); } finally { this.Cursor = Cursors.Default; } }
void ChangeLang(string langCode) { pgc.LangCode = langCode; tsslLang.Text = langCode + " (" + LanguageCodes.GetName(langCode) + ")"; LoadLangMenu(); //refresh list & selection }