private void MovieView_SelectedIndexChanged(object sender, EventArgs e) { toolTip1.SetToolTip(DetailsView, ""); DetailsView.Items.Clear(); if (MovieView.SelectedIndices.Count < 1) { OK.Enabled = false; return; } OK.Enabled = true; var firstIndex = MovieView.SelectedIndices[0]; MovieView.ensureVisible(firstIndex); foreach (var kvp in _movieList[firstIndex].HeaderEntries) { var item = new ListViewItem(kvp.Key); item.SubItems.Add(kvp.Value); bool add = true; switch (kvp.Key) { case HeaderKeys.SHA1: if (kvp.Value != Global.Game.Hash) { item.BackColor = Color.Pink; toolTip1.SetToolTip(DetailsView, "Current SHA1: " + Global.Game.Hash); } break; // TODO //case HeaderKeys.EMULATIONVERSION: // if (kvp.Value != VersionInfo.GetEmuVersion()) // { // item.BackColor = Color.Yellow; // } // break; case HeaderKeys.PLATFORM: if (kvp.Value != Global.Game.System) { item.BackColor = Color.Pink; } break; } if (add) { DetailsView.Items.Add(item); } } var FpsItem = new ListViewItem("Fps"); FpsItem.SubItems.Add(string.Format("{0:0.#######}", Fps(_movieList[firstIndex]))); DetailsView.Items.Add(FpsItem); var FramesItem = new ListViewItem("Frames"); FramesItem.SubItems.Add(_movieList[firstIndex].FrameCount.ToString()); DetailsView.Items.Add(FramesItem); CommentsBtn.Enabled = _movieList[firstIndex].Comments.Any(); SubtitlesBtn.Enabled = _movieList[firstIndex].Subtitles.Any(); }
private void MovieView_SelectedIndexChanged(object sender, EventArgs e) { toolTip1.SetToolTip(DetailsView, ""); DetailsView.Items.Clear(); if (MovieView.SelectedIndices.Count < 1) { OK.Enabled = false; return; } OK.Enabled = true; var firstIndex = MovieView.SelectedIndices[0]; MovieView.ensureVisible(firstIndex); foreach (var kvp in _movieList[firstIndex].HeaderEntries) { var item = new ListViewItem(kvp.Key); item.SubItems.Add(kvp.Value); bool add = true; switch (kvp.Key) { case HeaderKeys.SHA1: if (kvp.Value != Global.Game.Hash) { item.BackColor = Color.Pink; toolTip1.SetToolTip(DetailsView, $"Current SHA1: {Global.Game.Hash}"); } break; case HeaderKeys.EMULATIONVERSION: if (kvp.Value != VersionInfo.GetEmuVersion()) { item.BackColor = Color.Yellow; } break; case HeaderKeys.PLATFORM: // feos: previously it was compared against Global.Game.System, but when the movie is created // its platform is copied from Global.Emulator.SystemId, see PopulateWithDefaultHeaderValues() // the problem is that for GameGear and SG100, those mismatch, resulting in false positive here // I have a patch to make GG and SG appear as platforms in movie header (issue #1246) // but even with it, for all the old movies, this false positive would have to be worked around anyway // TODO: actually check header flags like "IsGGMode" and "IsSegaCDMode" (those are never parsed by bizhawk) if (kvp.Value != Global.Emulator.SystemId) { item.BackColor = Color.Pink; } break; } if (add) { DetailsView.Items.Add(item); } } var FpsItem = new ListViewItem("Fps"); FpsItem.SubItems.Add($"{Fps(_movieList[firstIndex]):0.#######}"); DetailsView.Items.Add(FpsItem); var FramesItem = new ListViewItem("Frames"); FramesItem.SubItems.Add(_movieList[firstIndex].FrameCount.ToString()); DetailsView.Items.Add(FramesItem); CommentsBtn.Enabled = _movieList[firstIndex].Comments.Any(); SubtitlesBtn.Enabled = _movieList[firstIndex].Subtitles.Any(); }