private void MovieView_SelectedIndexChanged(object sender, EventArgs e) { 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); item.ToolTipText = kvp.Value; switch (kvp.Key) { case HeaderKeys.Sha1: if (kvp.Value != _game.Hash) { item.BackColor = Color.Pink; item.ToolTipText = $"Expected: {_game.Hash}\n Actual: {kvp.Value}"; } break; case HeaderKeys.EmulatorVersion: if (kvp.Value != VersionInfo.GetEmuVersion()) { item.BackColor = Color.Yellow; item.ToolTipText = $"Expected: {VersionInfo.GetEmuVersion()}\n Actual: {kvp.Value}"; } break; case HeaderKeys.Platform: if (kvp.Value != _emulator.SystemId) { item.BackColor = Color.Pink; item.ToolTipText = $"Expected: {_emulator.SystemId}\n Actual: {kvp.Value}"; } break; } DetailsView.Items.Add(item); } var fpsItem = new ListViewItem("Fps"); fpsItem.SubItems.Add($"{_movieList[firstIndex].FrameRate: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(); }
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); switch (kvp.Key) { case HeaderKeys.SHA1: if (kvp.Value != _game.Hash) { item.BackColor = Color.Pink; toolTip1.SetToolTip(DetailsView, $"Current SHA1: {_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 _game.System, but when the movie is created // its platform is copied from _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 != _emulator.SystemId) { item.BackColor = Color.Pink; } break; } 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(); }
private void MovieView_SelectedIndexChanged(object sender, EventArgs e) { 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(k, v) in _movieList[firstIndex].HeaderEntries) { var item = new ListViewItem(k); item.SubItems.Add(v); item.ToolTipText = v; switch (k) { case HeaderKeys.Sha1: if (_game.Hash != v) { item.BackColor = Color.Pink; item.ToolTipText = $"Expected: {v}\nActual: {_game.Hash}"; } break; case HeaderKeys.EmulatorVersion: if (VersionInfo.GetEmuVersion() != v) { item.BackColor = Color.Yellow; item.ToolTipText = $"Expected: {v}\nActual: {VersionInfo.GetEmuVersion()}"; } break; case HeaderKeys.Platform: if (_emulator.SystemId != v) { item.BackColor = Color.Pink; item.ToolTipText = $"Expected: {v}\n Actual: {_emulator.SystemId}"; } break; default: if (k.Contains("_Firmware_")) { var split = k.Split(new[] { "_Firmware_" }, StringSplitOptions.None); var actualHash = _canProvideFirmware(new(split[0], split[1]), v); if (actualHash != v) { item.BackColor = Color.Yellow; item.ToolTipText = $"Expected: {v}\nActual: {actualHash}"; } } break; } DetailsView.Items.Add(item); } var fpsItem = new ListViewItem("Fps"); fpsItem.SubItems.Add($"{_movieList[firstIndex].FrameRate: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(); }