diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs index 5e7034f48c..cc52cb8509 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovie.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovie.cs @@ -13,9 +13,11 @@ namespace BizHawk.Client.Common { private List LagLog = new List(); private readonly TasStateManager StateManager = new TasStateManager(); - private readonly TasMovieMarkerList Markers = new TasMovieMarkerList(); - public TasMovie(string path) : base(path) { } + public TasMovie(string path) : base(path) + { + Markers = new TasMovieMarkerList(); + } public TasMovie() : base() @@ -30,6 +32,8 @@ namespace BizHawk.Client.Common public new const string Extension = "tasproj"; + public TasMovieMarkerList Markers { get; set; } + public TasMovieRecord this[int index] { get @@ -56,16 +60,6 @@ namespace BizHawk.Client.Common base.StartNewRecording(); } - public void Marker(int frame, string message) - { - Markers.Add(frame, message); - } - - public void DeleteMarker(int frame) - { - Markers.Remove(frame); - } - /// /// Removes lag log and greenzone after this frame /// diff --git a/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs b/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs index 92b668238a..86d318715d 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasMovieMarker.cs @@ -121,5 +121,21 @@ namespace BizHawk.Client.Common this.Remove(existingItem); } } + + public TasMovieMarker Previous(int currentFrame) + { + return this + .Where(m => m.Frame < currentFrame) + .OrderBy(m => m.Frame) + .Last(); + } + + public TasMovieMarker Next(int currentFrame) + { + return this + .Where(m => m.Frame > currentFrame) + .OrderBy(m => m.Frame) + .First(); + } } } diff --git a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj index db40540529..4b1c6e43ca 100644 --- a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj +++ b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj @@ -885,12 +885,6 @@ RecorderBox.cs - - UserControl - - - SplicerBox.cs - Form @@ -1291,9 +1285,6 @@ RecorderBox.cs - - SplicerBox.cs - TAStudio.cs diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.Designer.cs index 0d62bba46d..e696e06e9e 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.Designer.cs @@ -28,47 +28,63 @@ /// private void InitializeComponent() { - this.MarkerLabel = new System.Windows.Forms.Label(); - this.MarkerBox = new System.Windows.Forms.TextBox(); + this.MarkerView = 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.SuspendLayout(); // - // MarkerLabel + // MarkerView // - this.MarkerLabel.AutoSize = true; - this.MarkerLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.MarkerLabel.ForeColor = System.Drawing.Color.DeepSkyBlue; - this.MarkerLabel.Location = new System.Drawing.Point(0, 4); - this.MarkerLabel.Name = "MarkerLabel"; - this.MarkerLabel.Size = new System.Drawing.Size(100, 16); - this.MarkerLabel.TabIndex = 5; - this.MarkerLabel.Text = "Marker 99999"; - // - // MarkerBox - // - this.MarkerBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.MarkerView.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.MarkerBox.Location = new System.Drawing.Point(103, 1); - this.MarkerBox.Name = "MarkerBox"; - this.MarkerBox.Size = new System.Drawing.Size(188, 20); - this.MarkerBox.TabIndex = 5; + this.MarkerView.BlazingFast = false; + this.MarkerView.CheckBoxes = true; + this.MarkerView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1, + this.columnHeader2}); + this.MarkerView.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.MarkerView.FullRowSelect = true; + this.MarkerView.GridLines = true; + this.MarkerView.HideSelection = false; + this.MarkerView.ItemCount = 0; + this.MarkerView.Location = new System.Drawing.Point(3, 0); + this.MarkerView.Name = "MarkerView"; + this.MarkerView.SelectAllInProgress = false; + this.MarkerView.selectedItem = -1; + this.MarkerView.Size = new System.Drawing.Size(198, 209); + this.MarkerView.TabIndex = 5; + this.MarkerView.TabStop = false; + this.MarkerView.UseCompatibleStateImageBehavior = false; + this.MarkerView.View = System.Windows.Forms.View.Details; + // + // columnHeader1 + // + this.columnHeader1.Text = "Frame"; + this.columnHeader1.Width = 64; + // + // columnHeader2 + // + this.columnHeader2.Text = "Label"; + this.columnHeader2.Width = 113; // // MarkerControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.MarkerBox); - this.Controls.Add(this.MarkerLabel); + this.Controls.Add(this.MarkerView); this.Name = "MarkerControl"; - this.Size = new System.Drawing.Size(292, 24); + this.Size = new System.Drawing.Size(204, 215); this.Load += new System.EventHandler(this.MarkerControl_Load); this.ResumeLayout(false); - this.PerformLayout(); } #endregion - private System.Windows.Forms.Label MarkerLabel; - private System.Windows.Forms.TextBox MarkerBox; + private VirtualListView MarkerView; + public System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader columnHeader2; + } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs index bf624e1a2b..a4f69adfdf 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/MarkerControl.cs @@ -13,14 +13,42 @@ namespace BizHawk.Client.EmuHawk { public partial class MarkerControl : UserControl { + public TasMovieMarkerList Markers {get; set; } + public MarkerControl() { InitializeComponent(); + MarkerView.QueryItemBkColor += MarkerView_QueryItemBkColor; + MarkerView.QueryItemText += MarkerView_QueryItemText; } private void MarkerControl_Load(object sender, EventArgs e) { } + + public void UpdateValues() + { + Refresh(); + } + + private void MarkerView_QueryItemBkColor(int index, int column, ref Color color) + { + + } + + private void MarkerView_QueryItemText(int index, int column, out string text) + { + text = ""; + + if (column == 0) + { + text = Markers[index].Frame.ToString(); + } + else if (column == 1) + { + text = Markers[index].Message; + } + } } } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/SplicerBox.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/SplicerBox.Designer.cs deleted file mode 100644 index c582a3ebba..0000000000 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/SplicerBox.Designer.cs +++ /dev/null @@ -1,114 +0,0 @@ -namespace BizHawk.Client.EmuHawk -{ - partial class SplicerBox - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.SplicerGroupBox = new System.Windows.Forms.GroupBox(); - this.ClipboardStatsLabel = new System.Windows.Forms.Label(); - this.SelectionStatsLabel = new System.Windows.Forms.Label(); - this.ClipboardNameLabel = new System.Windows.Forms.Label(); - this.SelectionNameLabel = new System.Windows.Forms.Label(); - this.SplicerGroupBox.SuspendLayout(); - this.SuspendLayout(); - // - // SplicerGroupBox - // - this.SplicerGroupBox.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.SplicerGroupBox.Controls.Add(this.ClipboardStatsLabel); - this.SplicerGroupBox.Controls.Add(this.SelectionStatsLabel); - this.SplicerGroupBox.Controls.Add(this.ClipboardNameLabel); - this.SplicerGroupBox.Controls.Add(this.SelectionNameLabel); - this.SplicerGroupBox.Location = new System.Drawing.Point(3, 3); - this.SplicerGroupBox.Name = "SplicerGroupBox"; - this.SplicerGroupBox.Size = new System.Drawing.Size(198, 59); - this.SplicerGroupBox.TabIndex = 0; - this.SplicerGroupBox.TabStop = false; - this.SplicerGroupBox.Text = "Splicer"; - // - // ClipboardStatsLabel - // - this.ClipboardStatsLabel.AutoSize = true; - this.ClipboardStatsLabel.Enabled = false; - this.ClipboardStatsLabel.Location = new System.Drawing.Point(66, 33); - this.ClipboardStatsLabel.Name = "ClipboardStatsLabel"; - this.ClipboardStatsLabel.Size = new System.Drawing.Size(35, 13); - this.ClipboardStatsLabel.TabIndex = 3; - this.ClipboardStatsLabel.Text = "empty"; - // - // SelectionStatsLabel - // - this.SelectionStatsLabel.AutoSize = true; - this.SelectionStatsLabel.Enabled = false; - this.SelectionStatsLabel.Location = new System.Drawing.Point(66, 16); - this.SelectionStatsLabel.Name = "SelectionStatsLabel"; - this.SelectionStatsLabel.Size = new System.Drawing.Size(87, 13); - this.SelectionStatsLabel.TabIndex = 2; - this.SelectionStatsLabel.Text = "1 row, 8 columns"; - // - // ClipboardNameLabel - // - this.ClipboardNameLabel.AutoSize = true; - this.ClipboardNameLabel.Location = new System.Drawing.Point(6, 33); - this.ClipboardNameLabel.Name = "ClipboardNameLabel"; - this.ClipboardNameLabel.Size = new System.Drawing.Size(54, 13); - this.ClipboardNameLabel.TabIndex = 1; - this.ClipboardNameLabel.Text = "Clipboard:"; - // - // SelectionNameLabel - // - this.SelectionNameLabel.AutoSize = true; - this.SelectionNameLabel.Location = new System.Drawing.Point(6, 16); - this.SelectionNameLabel.Name = "SelectionNameLabel"; - this.SelectionNameLabel.Size = new System.Drawing.Size(54, 13); - this.SelectionNameLabel.TabIndex = 0; - this.SelectionNameLabel.Text = "Selection:"; - // - // SplicerBox - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.SplicerGroupBox); - this.Name = "SplicerBox"; - this.Size = new System.Drawing.Size(204, 65); - this.SplicerGroupBox.ResumeLayout(false); - this.SplicerGroupBox.PerformLayout(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.GroupBox SplicerGroupBox; - private System.Windows.Forms.Label ClipboardStatsLabel; - private System.Windows.Forms.Label SelectionStatsLabel; - private System.Windows.Forms.Label ClipboardNameLabel; - private System.Windows.Forms.Label SelectionNameLabel; - } -} diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/SplicerBox.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/SplicerBox.cs deleted file mode 100644 index eccc5f77b7..0000000000 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/SplicerBox.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Drawing; -using System.Data; -using System.Linq; -using System.Text; -using System.Windows.Forms; - -namespace BizHawk.Client.EmuHawk -{ - public partial class SplicerBox : UserControl - { - public SplicerBox() - { - InitializeComponent(); - } - } -} diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/SplicerBox.resx b/BizHawk.Client.EmuHawk/tools/TAStudio/SplicerBox.resx deleted file mode 100644 index 29dcb1b3a3..0000000000 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/SplicerBox.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index 7151045ac4..f7d6ef7a1a 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -107,6 +107,7 @@ namespace BizHawk.Client.EmuHawk this.MessageStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.SplicerStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.TasPlaybackBox = new BizHawk.Client.EmuHawk.PlaybackBox(); + this.MarkerControl = new BizHawk.Client.EmuHawk.MarkerControl(); this.TASMenu.SuspendLayout(); this.TasStatusStrip.SuspendLayout(); this.SuspendLayout(); @@ -735,11 +736,20 @@ namespace BizHawk.Client.EmuHawk this.TasPlaybackBox.Size = new System.Drawing.Size(204, 120); this.TasPlaybackBox.TabIndex = 5; // + // MarkerControl + // + this.MarkerControl.Location = new System.Drawing.Point(302, 151); + this.MarkerControl.Markers = null; + this.MarkerControl.Name = "MarkerControl"; + this.MarkerControl.Size = new System.Drawing.Size(204, 215); + this.MarkerControl.TabIndex = 6; + // // TAStudio // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(506, 519); + this.Controls.Add(this.MarkerControl); this.Controls.Add(this.TasPlaybackBox); this.Controls.Add(this.TasStatusStrip); this.Controls.Add(this.TASMenu); @@ -839,5 +849,6 @@ namespace BizHawk.Client.EmuHawk private System.Windows.Forms.ToolStripMenuItem CommentsMenuItem; private System.Windows.Forms.ToolStripMenuItem SubtitlesMenuItem; private System.Windows.Forms.ToolStripMenuItem GreenzoneSettingsMenuItem; + private MarkerControl MarkerControl; } } \ No newline at end of file diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 85875687d1..6beb8f0e31 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -145,6 +145,7 @@ namespace BizHawk.Client.EmuHawk GlobalWin.MainForm.PauseEmulator(); GlobalWin.MainForm.RelinquishControl(this); _originalRewindStatus = Global.Rewinder.RewindActive; + MarkerControl.Markers = _tas.Markers; GlobalWin.MainForm.EnableRewind(false); }