diff --git a/BizHawk.Client.Common/movie/Movie.cs b/BizHawk.Client.Common/movie/Movie.cs index 0cc6bec4e0..41b9128ee9 100644 --- a/BizHawk.Client.Common/movie/Movie.cs +++ b/BizHawk.Client.Common/movie/Movie.cs @@ -930,6 +930,18 @@ namespace BizHawk.Client.Common return line.Substring(x + 1, line.Length - x - 1); } + public double Fps + { + get + { + string system = Header.GetHeaderLine(MovieHeader.PLATFORM); + bool pal = Header.HeaderParams.ContainsKey(MovieHeader.PAL) && + Header.HeaderParams[MovieHeader.PAL] == "1"; + + return _PlatformFrameRates[system, pal]; + } + } + #endregion private PlatformFrameRates _platformFrameRates = new PlatformFrameRates(); diff --git a/BizHawk.Client.EmuHawk/movie/PlayMovie.Designer.cs b/BizHawk.Client.EmuHawk/movie/PlayMovie.Designer.cs index f0633bf565..d307366127 100644 --- a/BizHawk.Client.EmuHawk/movie/PlayMovie.Designer.cs +++ b/BizHawk.Client.EmuHawk/movie/PlayMovie.Designer.cs @@ -28,284 +28,284 @@ /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PlayMovie)); - this.Cancel = new System.Windows.Forms.Button(); - this.OK = new System.Windows.Forms.Button(); - this.BrowseMovies = new System.Windows.Forms.Button(); - this.DetailsView = new System.Windows.Forms.ListView(); - this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.button2 = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); - this.MovieCount = new System.Windows.Forms.Label(); - this.ReadOnlyCheckBox = new System.Windows.Forms.CheckBox(); - this.IncludeSubDirectories = new System.Windows.Forms.CheckBox(); - this.ShowStateFiles = new System.Windows.Forms.CheckBox(); - this.Scan = new System.Windows.Forms.Button(); - this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); - this.MatchGameNameCheckBox = new System.Windows.Forms.CheckBox(); - this.MovieView = new BizHawk.Client.EmuHawk.VirtualListView(); - this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.groupBox1.SuspendLayout(); - this.SuspendLayout(); - // - // Cancel - // - this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.Cancel.Location = new System.Drawing.Point(678, 352); - this.Cancel.Name = "Cancel"; - this.Cancel.Size = new System.Drawing.Size(75, 23); - this.Cancel.TabIndex = 55; - this.Cancel.Text = "&Cancel"; - this.Cancel.UseVisualStyleBackColor = true; - this.Cancel.Click += new System.EventHandler(this.Cancel_Click); - // - // OK - // - this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.OK.Location = new System.Drawing.Point(597, 352); - this.OK.Name = "OK"; - this.OK.Size = new System.Drawing.Size(75, 23); - this.OK.TabIndex = 50; - this.OK.Text = "&Ok"; - this.toolTip1.SetToolTip(this.OK, "Load selected movie"); - this.OK.UseVisualStyleBackColor = true; - this.OK.Click += new System.EventHandler(this.OK_Click); - // - // BrowseMovies - // - this.BrowseMovies.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.BrowseMovies.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile; - this.BrowseMovies.Location = new System.Drawing.Point(12, 337); - this.BrowseMovies.Name = "BrowseMovies"; - this.BrowseMovies.Size = new System.Drawing.Size(31, 23); - this.BrowseMovies.TabIndex = 25; - this.toolTip1.SetToolTip(this.BrowseMovies, "Browse for additional movie files"); - this.BrowseMovies.UseVisualStyleBackColor = true; - this.BrowseMovies.Click += new System.EventHandler(this.BrowseMovies_Click); - // - // DetailsView - // - this.DetailsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PlayMovie)); + this.Cancel = new System.Windows.Forms.Button(); + this.OK = new System.Windows.Forms.Button(); + this.BrowseMovies = new System.Windows.Forms.Button(); + this.DetailsView = new System.Windows.Forms.ListView(); + this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader6 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.SubtitlesBtn = new System.Windows.Forms.Button(); + this.CommentsBtn = new System.Windows.Forms.Button(); + this.MovieCount = new System.Windows.Forms.Label(); + this.ReadOnlyCheckBox = new System.Windows.Forms.CheckBox(); + this.IncludeSubDirectories = new System.Windows.Forms.CheckBox(); + this.ShowStateFiles = new System.Windows.Forms.CheckBox(); + this.Scan = new System.Windows.Forms.Button(); + this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); + this.MatchGameNameCheckBox = new System.Windows.Forms.CheckBox(); + this.MovieView = new BizHawk.Client.EmuHawk.VirtualListView(); + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // Cancel + // + this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.Cancel.Location = new System.Drawing.Point(678, 352); + this.Cancel.Name = "Cancel"; + this.Cancel.Size = new System.Drawing.Size(75, 23); + this.Cancel.TabIndex = 55; + this.Cancel.Text = "&Cancel"; + this.Cancel.UseVisualStyleBackColor = true; + this.Cancel.Click += new System.EventHandler(this.Cancel_Click); + // + // OK + // + this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.OK.Location = new System.Drawing.Point(597, 352); + this.OK.Name = "OK"; + this.OK.Size = new System.Drawing.Size(75, 23); + this.OK.TabIndex = 50; + this.OK.Text = "&Ok"; + this.toolTip1.SetToolTip(this.OK, "Load selected movie"); + this.OK.UseVisualStyleBackColor = true; + this.OK.Click += new System.EventHandler(this.OK_Click); + // + // BrowseMovies + // + this.BrowseMovies.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.BrowseMovies.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.OpenFile; + this.BrowseMovies.Location = new System.Drawing.Point(12, 337); + this.BrowseMovies.Name = "BrowseMovies"; + this.BrowseMovies.Size = new System.Drawing.Size(31, 23); + this.BrowseMovies.TabIndex = 25; + this.toolTip1.SetToolTip(this.BrowseMovies, "Browse for additional movie files"); + this.BrowseMovies.UseVisualStyleBackColor = true; + this.BrowseMovies.Click += new System.EventHandler(this.BrowseMovies_Click); + // + // DetailsView + // + this.DetailsView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.DetailsView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.DetailsView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader5, this.columnHeader6}); - this.DetailsView.FullRowSelect = true; - this.DetailsView.GridLines = true; - this.DetailsView.HideSelection = false; - this.DetailsView.Location = new System.Drawing.Point(15, 19); - this.DetailsView.Name = "DetailsView"; - this.DetailsView.Size = new System.Drawing.Size(228, 242); - this.DetailsView.TabIndex = 10; - this.toolTip1.SetToolTip(this.DetailsView, "Contains the header information for the selected movie"); - this.DetailsView.UseCompatibleStateImageBehavior = false; - this.DetailsView.View = System.Windows.Forms.View.Details; - // - // columnHeader5 - // - this.columnHeader5.Text = "Header"; - this.columnHeader5.Width = 102; - // - // columnHeader6 - // - this.columnHeader6.Text = "Value"; - this.columnHeader6.Width = 121; - // - // groupBox1 - // - this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.DetailsView.FullRowSelect = true; + this.DetailsView.GridLines = true; + this.DetailsView.HideSelection = false; + this.DetailsView.Location = new System.Drawing.Point(15, 19); + this.DetailsView.Name = "DetailsView"; + this.DetailsView.Size = new System.Drawing.Size(228, 242); + this.DetailsView.TabIndex = 10; + this.toolTip1.SetToolTip(this.DetailsView, "Contains the header information for the selected movie"); + this.DetailsView.UseCompatibleStateImageBehavior = false; + this.DetailsView.View = System.Windows.Forms.View.Details; + // + // columnHeader5 + // + this.columnHeader5.Text = "Header"; + this.columnHeader5.Width = 102; + // + // columnHeader6 + // + this.columnHeader6.Text = "Value"; + this.columnHeader6.Width = 121; + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBox1.Controls.Add(this.button2); - this.groupBox1.Controls.Add(this.button1); - this.groupBox1.Controls.Add(this.DetailsView); - this.groupBox1.Location = new System.Drawing.Point(494, 28); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(259, 303); - this.groupBox1.TabIndex = 6; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Details"; - // - // button2 - // - this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button2.Enabled = false; - this.button2.Location = new System.Drawing.Point(125, 267); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(75, 23); - this.button2.TabIndex = 20; - this.button2.Text = "Subtitles"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.button2_Click); - // - // button1 - // - this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.button1.Enabled = false; - this.button1.Location = new System.Drawing.Point(15, 267); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(75, 23); - this.button1.TabIndex = 15; - this.button1.Text = "Comments"; - this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); - // - // MovieCount - // - this.MovieCount.AutoSize = true; - this.MovieCount.Location = new System.Drawing.Point(12, 9); - this.MovieCount.Name = "MovieCount"; - this.MovieCount.Size = new System.Drawing.Size(31, 13); - this.MovieCount.TabIndex = 7; - this.MovieCount.Text = " "; - // - // ReadOnlyCheckBox - // - this.ReadOnlyCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ReadOnlyCheckBox.AutoSize = true; - this.ReadOnlyCheckBox.Checked = true; - this.ReadOnlyCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.ReadOnlyCheckBox.Location = new System.Drawing.Point(494, 356); - this.ReadOnlyCheckBox.Name = "ReadOnlyCheckBox"; - this.ReadOnlyCheckBox.Size = new System.Drawing.Size(74, 17); - this.ReadOnlyCheckBox.TabIndex = 45; - this.ReadOnlyCheckBox.Text = "Read only"; - this.ReadOnlyCheckBox.UseVisualStyleBackColor = true; - // - // IncludeSubDirectories - // - this.IncludeSubDirectories.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.IncludeSubDirectories.AutoSize = true; - this.IncludeSubDirectories.Location = new System.Drawing.Point(123, 337); - this.IncludeSubDirectories.Name = "IncludeSubDirectories"; - this.IncludeSubDirectories.Size = new System.Drawing.Size(131, 17); - this.IncludeSubDirectories.TabIndex = 35; - this.IncludeSubDirectories.Text = "Include Subdirectories"; - this.IncludeSubDirectories.UseVisualStyleBackColor = true; - this.IncludeSubDirectories.CheckedChanged += new System.EventHandler(this.IncludeSubDirectories_CheckedChanged); - // - // ShowStateFiles - // - this.ShowStateFiles.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ShowStateFiles.AutoSize = true; - this.ShowStateFiles.Location = new System.Drawing.Point(123, 358); - this.ShowStateFiles.Name = "ShowStateFiles"; - this.ShowStateFiles.Size = new System.Drawing.Size(128, 17); - this.ShowStateFiles.TabIndex = 40; - this.ShowStateFiles.Text = "Show valid .state files"; - this.ShowStateFiles.UseVisualStyleBackColor = true; - this.ShowStateFiles.CheckedChanged += new System.EventHandler(this.ShowStateFiles_CheckedChanged); - // - // Scan - // - this.Scan.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.Scan.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Scan; - this.Scan.Location = new System.Drawing.Point(49, 337); - this.Scan.Name = "Scan"; - this.Scan.Size = new System.Drawing.Size(27, 23); - this.Scan.TabIndex = 30; - this.toolTip1.SetToolTip(this.Scan, "Rescan Movie folder for movie files"); - this.Scan.UseVisualStyleBackColor = true; - this.Scan.Click += new System.EventHandler(this.Scan_Click); - // - // MatchGameNameCheckBox - // - this.MatchGameNameCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.MatchGameNameCheckBox.AutoSize = true; - this.MatchGameNameCheckBox.Location = new System.Drawing.Point(260, 337); - this.MatchGameNameCheckBox.Name = "MatchGameNameCheckBox"; - this.MatchGameNameCheckBox.Size = new System.Drawing.Size(150, 17); - this.MatchGameNameCheckBox.TabIndex = 56; - this.MatchGameNameCheckBox.Text = "Match current game name"; - this.MatchGameNameCheckBox.UseVisualStyleBackColor = true; - this.MatchGameNameCheckBox.CheckedChanged += new System.EventHandler(this.MatchGameNameCheckBox_CheckedChanged); - // - // MovieView - // - this.MovieView.AllowDrop = true; - this.MovieView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.groupBox1.Controls.Add(this.SubtitlesBtn); + this.groupBox1.Controls.Add(this.CommentsBtn); + this.groupBox1.Controls.Add(this.DetailsView); + this.groupBox1.Location = new System.Drawing.Point(494, 28); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(259, 303); + this.groupBox1.TabIndex = 6; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Details"; + // + // SubtitlesBtn + // + this.SubtitlesBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.SubtitlesBtn.Enabled = false; + this.SubtitlesBtn.Location = new System.Drawing.Point(125, 267); + this.SubtitlesBtn.Name = "SubtitlesBtn"; + this.SubtitlesBtn.Size = new System.Drawing.Size(75, 23); + this.SubtitlesBtn.TabIndex = 20; + this.SubtitlesBtn.Text = "Subtitles"; + this.SubtitlesBtn.UseVisualStyleBackColor = true; + this.SubtitlesBtn.Click += new System.EventHandler(this.button2_Click); + // + // CommentsBtn + // + this.CommentsBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.CommentsBtn.Enabled = false; + this.CommentsBtn.Location = new System.Drawing.Point(15, 267); + this.CommentsBtn.Name = "CommentsBtn"; + this.CommentsBtn.Size = new System.Drawing.Size(75, 23); + this.CommentsBtn.TabIndex = 15; + this.CommentsBtn.Text = "Comments"; + this.CommentsBtn.UseVisualStyleBackColor = true; + this.CommentsBtn.Click += new System.EventHandler(this.button1_Click); + // + // MovieCount + // + this.MovieCount.AutoSize = true; + this.MovieCount.Location = new System.Drawing.Point(12, 9); + this.MovieCount.Name = "MovieCount"; + this.MovieCount.Size = new System.Drawing.Size(31, 13); + this.MovieCount.TabIndex = 7; + this.MovieCount.Text = " "; + // + // ReadOnlyCheckBox + // + this.ReadOnlyCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.ReadOnlyCheckBox.AutoSize = true; + this.ReadOnlyCheckBox.Checked = true; + this.ReadOnlyCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.ReadOnlyCheckBox.Location = new System.Drawing.Point(494, 356); + this.ReadOnlyCheckBox.Name = "ReadOnlyCheckBox"; + this.ReadOnlyCheckBox.Size = new System.Drawing.Size(74, 17); + this.ReadOnlyCheckBox.TabIndex = 45; + this.ReadOnlyCheckBox.Text = "Read only"; + this.ReadOnlyCheckBox.UseVisualStyleBackColor = true; + // + // IncludeSubDirectories + // + this.IncludeSubDirectories.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.IncludeSubDirectories.AutoSize = true; + this.IncludeSubDirectories.Location = new System.Drawing.Point(123, 337); + this.IncludeSubDirectories.Name = "IncludeSubDirectories"; + this.IncludeSubDirectories.Size = new System.Drawing.Size(131, 17); + this.IncludeSubDirectories.TabIndex = 35; + this.IncludeSubDirectories.Text = "Include Subdirectories"; + this.IncludeSubDirectories.UseVisualStyleBackColor = true; + this.IncludeSubDirectories.CheckedChanged += new System.EventHandler(this.IncludeSubDirectories_CheckedChanged); + // + // ShowStateFiles + // + this.ShowStateFiles.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.ShowStateFiles.AutoSize = true; + this.ShowStateFiles.Location = new System.Drawing.Point(123, 358); + this.ShowStateFiles.Name = "ShowStateFiles"; + this.ShowStateFiles.Size = new System.Drawing.Size(128, 17); + this.ShowStateFiles.TabIndex = 40; + this.ShowStateFiles.Text = "Show valid .state files"; + this.ShowStateFiles.UseVisualStyleBackColor = true; + this.ShowStateFiles.CheckedChanged += new System.EventHandler(this.ShowStateFiles_CheckedChanged); + // + // Scan + // + this.Scan.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.Scan.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Scan; + this.Scan.Location = new System.Drawing.Point(49, 337); + this.Scan.Name = "Scan"; + this.Scan.Size = new System.Drawing.Size(27, 23); + this.Scan.TabIndex = 30; + this.toolTip1.SetToolTip(this.Scan, "Rescan Movie folder for movie files"); + this.Scan.UseVisualStyleBackColor = true; + this.Scan.Click += new System.EventHandler(this.Scan_Click); + // + // MatchGameNameCheckBox + // + this.MatchGameNameCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.MatchGameNameCheckBox.AutoSize = true; + this.MatchGameNameCheckBox.Location = new System.Drawing.Point(260, 337); + this.MatchGameNameCheckBox.Name = "MatchGameNameCheckBox"; + this.MatchGameNameCheckBox.Size = new System.Drawing.Size(150, 17); + this.MatchGameNameCheckBox.TabIndex = 56; + this.MatchGameNameCheckBox.Text = "Match current game name"; + this.MatchGameNameCheckBox.UseVisualStyleBackColor = true; + this.MatchGameNameCheckBox.CheckedChanged += new System.EventHandler(this.MatchGameNameCheckBox_CheckedChanged); + // + // MovieView + // + this.MovieView.AllowDrop = true; + this.MovieView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.MovieView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.MovieView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.columnHeader1, this.columnHeader2, this.columnHeader3, this.columnHeader4}); - this.MovieView.FullRowSelect = true; - this.MovieView.GridLines = true; - this.MovieView.HideSelection = false; - this.MovieView.ItemCount = 0; - this.MovieView.Location = new System.Drawing.Point(12, 28); - this.MovieView.MultiSelect = false; - this.MovieView.Name = "MovieView"; - this.MovieView.selectedItem = -1; - this.MovieView.Size = new System.Drawing.Size(463, 303); - this.MovieView.TabIndex = 5; - this.MovieView.UseCompatibleStateImageBehavior = false; - this.MovieView.View = System.Windows.Forms.View.Details; - this.MovieView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.MovieView_ColumnClick); - this.MovieView.SelectedIndexChanged += new System.EventHandler(this.MovieView_SelectedIndexChanged); - this.MovieView.DragDrop += new System.Windows.Forms.DragEventHandler(this.MovieView_DragDrop); - this.MovieView.DragEnter += new System.Windows.Forms.DragEventHandler(this.MovieView_DragEnter); - this.MovieView.DoubleClick += new System.EventHandler(this.MovieView_DoubleClick); - this.MovieView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MovieView_KeyDown); - // - // columnHeader1 - // - this.columnHeader1.Text = "File"; - this.columnHeader1.Width = 221; - // - // columnHeader2 - // - this.columnHeader2.Text = "SysID"; - this.columnHeader2.Width = 43; - // - // columnHeader3 - // - this.columnHeader3.Text = "Game"; - this.columnHeader3.Width = 129; - // - // columnHeader4 - // - this.columnHeader4.Text = "Length (est.)"; - this.columnHeader4.Width = 64; - // - // PlayMovie - // - this.AcceptButton = this.OK; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.Cancel; - this.ClientSize = new System.Drawing.Size(765, 387); - this.Controls.Add(this.MatchGameNameCheckBox); - this.Controls.Add(this.Scan); - this.Controls.Add(this.ShowStateFiles); - this.Controls.Add(this.IncludeSubDirectories); - this.Controls.Add(this.ReadOnlyCheckBox); - this.Controls.Add(this.MovieCount); - this.Controls.Add(this.groupBox1); - this.Controls.Add(this.MovieView); - this.Controls.Add(this.BrowseMovies); - this.Controls.Add(this.OK); - this.Controls.Add(this.Cancel); - this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(547, 228); - this.Name = "PlayMovie"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Play Movie"; - this.Load += new System.EventHandler(this.PlayMovie_Load); - this.groupBox1.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); + this.MovieView.FullRowSelect = true; + this.MovieView.GridLines = true; + this.MovieView.HideSelection = false; + this.MovieView.ItemCount = 0; + this.MovieView.Location = new System.Drawing.Point(12, 28); + this.MovieView.MultiSelect = false; + this.MovieView.Name = "MovieView"; + this.MovieView.selectedItem = -1; + this.MovieView.Size = new System.Drawing.Size(463, 303); + this.MovieView.TabIndex = 5; + this.MovieView.UseCompatibleStateImageBehavior = false; + this.MovieView.View = System.Windows.Forms.View.Details; + this.MovieView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.MovieView_ColumnClick); + this.MovieView.SelectedIndexChanged += new System.EventHandler(this.MovieView_SelectedIndexChanged); + this.MovieView.DragDrop += new System.Windows.Forms.DragEventHandler(this.MovieView_DragDrop); + this.MovieView.DragEnter += new System.Windows.Forms.DragEventHandler(this.MovieView_DragEnter); + this.MovieView.DoubleClick += new System.EventHandler(this.MovieView_DoubleClick); + this.MovieView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.MovieView_KeyDown); + // + // columnHeader1 + // + this.columnHeader1.Text = "File"; + this.columnHeader1.Width = 221; + // + // columnHeader2 + // + this.columnHeader2.Text = "SysID"; + this.columnHeader2.Width = 43; + // + // columnHeader3 + // + this.columnHeader3.Text = "Game"; + this.columnHeader3.Width = 129; + // + // columnHeader4 + // + this.columnHeader4.Text = "Length (est.)"; + this.columnHeader4.Width = 64; + // + // PlayMovie + // + this.AcceptButton = this.OK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.Cancel; + this.ClientSize = new System.Drawing.Size(765, 387); + this.Controls.Add(this.MatchGameNameCheckBox); + this.Controls.Add(this.Scan); + this.Controls.Add(this.ShowStateFiles); + this.Controls.Add(this.IncludeSubDirectories); + this.Controls.Add(this.ReadOnlyCheckBox); + this.Controls.Add(this.MovieCount); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.MovieView); + this.Controls.Add(this.BrowseMovies); + this.Controls.Add(this.OK); + this.Controls.Add(this.Cancel); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.MinimumSize = new System.Drawing.Size(547, 228); + this.Name = "PlayMovie"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Play Movie"; + this.Load += new System.EventHandler(this.PlayMovie_Load); + this.groupBox1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); } @@ -323,8 +323,8 @@ private System.Windows.Forms.ColumnHeader columnHeader5; private System.Windows.Forms.ColumnHeader columnHeader6; private System.Windows.Forms.GroupBox groupBox1; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.Button button1; + private System.Windows.Forms.Button SubtitlesBtn; + private System.Windows.Forms.Button CommentsBtn; private System.Windows.Forms.Label MovieCount; private System.Windows.Forms.CheckBox ReadOnlyCheckBox; private System.Windows.Forms.CheckBox IncludeSubDirectories; diff --git a/BizHawk.Client.EmuHawk/movie/PlayMovie.cs b/BizHawk.Client.EmuHawk/movie/PlayMovie.cs index 7dd9ed0478..65e3acb161 100644 --- a/BizHawk.Client.EmuHawk/movie/PlayMovie.cs +++ b/BizHawk.Client.EmuHawk/movie/PlayMovie.cs @@ -13,9 +13,9 @@ namespace BizHawk.Client.EmuHawk { public partial class PlayMovie : Form { - private List MovieList = new List(); - private bool sortReverse; - private string sortedCol; + private List _movieList = new List(); + private bool _sortReverse; + private string _sortedCol; public PlayMovie() { @@ -23,28 +23,28 @@ namespace BizHawk.Client.EmuHawk MovieView.QueryItemText += MovieView_QueryItemText; MovieView.QueryItemBkColor += MovieView_QueryItemBkColor; MovieView.VirtualMode = true; - sortReverse = false; - sortedCol = ""; + _sortReverse = false; + _sortedCol = String.Empty; } void MovieView_QueryItemText(int index, int column, out string text) { - text = ""; + text = String.Empty; if (column == 0) //File { - text = Path.GetFileName(MovieList[index].Filename); + text = Path.GetFileName(_movieList[index].Filename); } if (column == 1) //System { - text = MovieList[index].SysID; + text = _movieList[index].SysID; } if (column == 2) //Game { - text = MovieList[index].GameName; + text = _movieList[index].GameName; } if (column == 3) //Time { - text = MovieList[index].GetTime(true); + text = _movieList[index].GetTime(true); } } @@ -61,14 +61,10 @@ namespace BizHawk.Client.EmuHawk private void Run() { ListView.SelectedIndexCollection indexes = MovieView.SelectedIndices; - if (indexes.Count == 0) + if (indexes.Count > 0) //Import file if necessary { - return; + GlobalWin.MainForm.StartNewMovie(_movieList[MovieView.SelectedIndices[0]], false); } - - //Import file if necessary - - GlobalWin.MainForm.StartNewMovie(MovieList[MovieView.SelectedIndices[0]], false); } private void OK_Click(object sender, EventArgs e) @@ -129,9 +125,9 @@ namespace BizHawk.Client.EmuHawk movie.LoadMovie(); //State files will have to load everything unfortunately if (movie.Frames > 0) { - MovieList.Add(movie); - sortReverse = false; - sortedCol = String.Empty; + _movieList.Add(movie); + _sortReverse = false; + _sortedCol = String.Empty; } } } @@ -150,12 +146,12 @@ namespace BizHawk.Client.EmuHawk if (x == 0) { PreLoadMovieFile(file, force); - MovieView.ItemCount = MovieList.Count; + MovieView.ItemCount = _movieList.Count; UpdateList(); - sortReverse = false; - sortedCol = ""; - x = MovieList.Count - 1; + _sortReverse = false; + _sortedCol = String.Empty; + x = _movieList.Count - 1; } return x; } @@ -164,9 +160,9 @@ namespace BizHawk.Client.EmuHawk private int IsDuplicate(string filename) { - for (int x = 0; x < MovieList.Count; x++) + for (int x = 0; x < _movieList.Count; x++) { - if (MovieList[x].Filename == filename) + if (_movieList[x].Filename == filename) { return x; } @@ -191,7 +187,7 @@ namespace BizHawk.Client.EmuHawk if (movie.Header.GetHeaderLine(MovieHeader.GAMENAME) == Global.Game.Name || Global.Config.PlayMovie_MatchGameName == false || force) { - MovieList.Add(movie); + _movieList.Add(movie); } } @@ -203,7 +199,7 @@ namespace BizHawk.Client.EmuHawk private void UpdateMovieCount() { - int x = MovieList.Count; + int x = _movieList.Count; if (x == 1) { MovieCount.Text = x.ToString() + " movie"; @@ -220,9 +216,9 @@ namespace BizHawk.Client.EmuHawk List Indexes = new List(); //Pull out matching names - for (int x = 0; x < MovieList.Count; x++) + for (int x = 0; x < _movieList.Count; x++) { - if (PathManager.FilesystemSafeName(Global.Game) == MovieList[x].GameName) + if (PathManager.FilesystemSafeName(Global.Game) == _movieList[x].GameName) Indexes.Add(x); } if (Indexes.Count == 0) return; @@ -236,7 +232,7 @@ namespace BizHawk.Client.EmuHawk List TAS = new List(); for (int x = 0; x < Indexes.Count; x++) { - if (Path.GetExtension(MovieList[Indexes[x]].Filename).ToUpper() == "." + Global.Config.MovieExtension) + if (Path.GetExtension(_movieList[Indexes[x]].Filename).ToUpper() == "." + Global.Config.MovieExtension) { TAS.Add(x); } @@ -253,12 +249,12 @@ namespace BizHawk.Client.EmuHawk } //Final tie breaker - Last used file - FileInfo f = new FileInfo(MovieList[Indexes[0]].Filename); + FileInfo f = new FileInfo(_movieList[Indexes[0]].Filename); DateTime t = f.LastAccessTime; int mostRecent = Indexes[0]; for (int x = 1; x < Indexes.Count; x++) { - f = new FileInfo(MovieList[Indexes[0]].Filename); + f = new FileInfo(_movieList[Indexes[0]].Filename); if (f.LastAccessTime > t) { t = f.LastAccessTime; @@ -280,7 +276,7 @@ namespace BizHawk.Client.EmuHawk private void ClearList() { - MovieList.Clear(); + _movieList.Clear(); MovieView.ItemCount = 0; MovieView.Update(); } @@ -363,11 +359,13 @@ namespace BizHawk.Client.EmuHawk return; } else + { OK.Enabled = true; + } int x = MovieView.SelectedIndices[0]; MovieView.ensureVisible(x); - Dictionary h = MovieList[x].Header.HeaderParams; + Dictionary h = _movieList[x].Header.HeaderParams; foreach (var kvp in h) { @@ -402,46 +400,42 @@ namespace BizHawk.Client.EmuHawk } break; } - DetailsView.Items.Add(item); } - if (MovieList[x].Header.Comments.Count > 0) - { - button1.Enabled = true; - } - else - { - button1.Enabled = false; - } + var FpsItem = new ListViewItem("Fps"); + FpsItem.SubItems.Add(String.Format("{0:0.#######}", _movieList[x].Fps)); + DetailsView.Items.Add(FpsItem); - if (MovieList[x].Subtitles.Count > 0) - { - button2.Enabled = true; - } - else - { - button2.Enabled = false; - } + var FramesItem = new ListViewItem("Frames"); + FramesItem.SubItems.Add(_movieList[x].RawFrames.ToString()); + DetailsView.Items.Add(FramesItem); + + CommentsBtn.Enabled = _movieList[x].Header.Comments.Count > 0; + SubtitlesBtn.Enabled = _movieList[x].Subtitles.Count > 0; } private void button1_Click(object sender, EventArgs e) { ListView.SelectedIndexCollection indexes = MovieView.SelectedIndices; - if (indexes.Count == 0) return; - EditCommentsForm form = new EditCommentsForm(); - form.GetMovie(MovieList[MovieView.SelectedIndices[0]]); - form.Show(); + if (indexes.Count > 0) + { + EditCommentsForm form = new EditCommentsForm(); + form.GetMovie(_movieList[MovieView.SelectedIndices[0]]); + form.Show(); + } } private void button2_Click(object sender, EventArgs e) { ListView.SelectedIndexCollection indexes = MovieView.SelectedIndices; - if (indexes.Count == 0) return; - EditSubtitlesForm s = new EditSubtitlesForm {ReadOnly = true}; - s.GetMovie(MovieList[MovieView.SelectedIndices[0]]); - s.Show(); + if (indexes.Count > 0) + { + EditSubtitlesForm s = new EditSubtitlesForm { ReadOnly = true }; + s.GetMovie(_movieList[MovieView.SelectedIndices[0]]); + s.Show(); + } } private void MovieView_DoubleClick(object sender, EventArgs e) @@ -475,17 +469,17 @@ namespace BizHawk.Client.EmuHawk private void OrderColumn(int columnToOrder) { string columnName = MovieView.Columns[columnToOrder].Text; - if (sortedCol != columnName) + if (_sortedCol != columnName) { - sortReverse = false; + _sortReverse = false; } switch (columnName) { case "File": - if (sortReverse) + if (_sortReverse) { - MovieList = MovieList + _movieList = _movieList .OrderByDescending(x => Path.GetFileName(x.Filename)) .ThenBy(x => x.SysID) .ThenBy(x => x.GameName) @@ -494,7 +488,7 @@ namespace BizHawk.Client.EmuHawk } else { - MovieList = MovieList + _movieList = _movieList .OrderBy(x => Path.GetFileName(x.Filename)) .ThenBy(x => x.SysID) .ThenBy(x => x.GameName) @@ -503,9 +497,9 @@ namespace BizHawk.Client.EmuHawk } break; case "SysID": - if (sortReverse) + if (_sortReverse) { - MovieList = MovieList + _movieList = _movieList .OrderByDescending(x => x.SysID) .ThenBy(x => Path.GetFileName(x.Filename)) .ThenBy(x => x.GameName) @@ -514,7 +508,7 @@ namespace BizHawk.Client.EmuHawk } else { - MovieList = MovieList + _movieList = _movieList .OrderBy(x => x.SysID) .ThenBy(x => Path.GetFileName(x.Filename)) .ThenBy(x => x.GameName) @@ -523,9 +517,9 @@ namespace BizHawk.Client.EmuHawk } break; case "Game": - if (sortReverse) + if (_sortReverse) { - MovieList = MovieList + _movieList = _movieList .OrderByDescending(x => x.GameName) .ThenBy(x => Path.GetFileName(x.Filename)) .ThenBy(x => x.SysID) @@ -534,7 +528,7 @@ namespace BizHawk.Client.EmuHawk } else { - MovieList = MovieList + _movieList = _movieList .OrderBy(x => x.GameName) .ThenBy(x => Path.GetFileName(x.Filename)) .ThenBy(x => x.SysID) @@ -543,9 +537,9 @@ namespace BizHawk.Client.EmuHawk } break; case "Length (est.)": - if (sortReverse) + if (_sortReverse) { - MovieList = MovieList + _movieList = _movieList .OrderByDescending(x => x.RawFrames) .ThenBy(x => Path.GetFileName(x.Filename)) .ThenBy(x => x.SysID) @@ -554,7 +548,7 @@ namespace BizHawk.Client.EmuHawk } else { - MovieList = MovieList + _movieList = _movieList .OrderBy(x => x.RawFrames) .ThenBy(x => Path.GetFileName(x.Filename)) .ThenBy(x => x.SysID) @@ -564,8 +558,8 @@ namespace BizHawk.Client.EmuHawk break; } - sortedCol = columnName; - sortReverse = !sortReverse; + _sortedCol = columnName; + _sortReverse = !_sortReverse; MovieView.Refresh(); } @@ -606,14 +600,11 @@ namespace BizHawk.Client.EmuHawk StringBuilder copyStr = new StringBuilder(); foreach (int index in indexes) { - copyStr.Append(MovieList[index].Filename); - copyStr.Append('\t'); - copyStr.Append(MovieList[index].SysID); - copyStr.Append('\t'); - copyStr.Append(MovieList[index].GameName); - copyStr.Append('\t'); - copyStr.Append(MovieList[index].GetTime(true)); - copyStr.Append('\n'); + copyStr + .Append(_movieList[index].Filename).Append('\t') + .Append(_movieList[index].SysID).Append('\t') + .Append(_movieList[index].GameName).Append('\t') + .Append(_movieList[index].GetTime(true)).AppendLine(); Clipboard.SetDataObject(copyStr.ToString()); }