tastudio:

- movie end doesn't switch to record mode anymore. fix #586
- recording mode checkbox
- fix rec mode dying during fast rewind
todo:
- readonly hotkey doesn't work until we click the checkbox
- movie status icon doesn't show up if tastudio is autoloaded
This commit is contained in:
feos 2016-08-06 22:28:25 +03:00
parent 1e6b3bfbee
commit a2b55291b3
7 changed files with 91 additions and 45 deletions

View File

@ -310,10 +310,15 @@ namespace BizHawk.Client.Common
public void HandleMovieAfterFrameLoop()
{
if (Movie is TasMovie) // Was being done in LatchInputFromLog
if (Movie is TasMovie)
{
(Movie as TasMovie).GreenzoneCurrentFrame();
if (Movie.IsPlaying && !Movie.IsFinished && Global.Emulator.Frame >= Movie.InputLogLength)
if (Movie.IsPlaying && Global.Emulator.Frame > Movie.InputLogLength)
{
HandleFrameLoopForRecordMode();
}
}
else if (Movie.IsPlaying && !Movie.IsFinished && Global.Emulator.Frame >= Movie.InputLogLength)
{
HandlePlaybackEnd();
}

View File

@ -29,6 +29,7 @@
private void InitializeComponent()
{
this.PlaybackGroupBox = new System.Windows.Forms.GroupBox();
this.RecordingModeCheckbox = new System.Windows.Forms.CheckBox();
this.AutoRestoreCheckbox = new System.Windows.Forms.CheckBox();
this.TurboSeekCheckbox = new System.Windows.Forms.CheckBox();
this.FollowCursorCheckbox = new System.Windows.Forms.CheckBox();
@ -45,6 +46,7 @@
this.PlaybackGroupBox.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.PlaybackGroupBox.Controls.Add(this.RecordingModeCheckbox);
this.PlaybackGroupBox.Controls.Add(this.AutoRestoreCheckbox);
this.PlaybackGroupBox.Controls.Add(this.TurboSeekCheckbox);
this.PlaybackGroupBox.Controls.Add(this.FollowCursorCheckbox);
@ -55,11 +57,22 @@
this.PlaybackGroupBox.Controls.Add(this.PreviousMarkerButton);
this.PlaybackGroupBox.Location = new System.Drawing.Point(3, 3);
this.PlaybackGroupBox.Name = "PlaybackGroupBox";
this.PlaybackGroupBox.Size = new System.Drawing.Size(198, 81);
this.PlaybackGroupBox.Size = new System.Drawing.Size(198, 104);
this.PlaybackGroupBox.TabIndex = 0;
this.PlaybackGroupBox.TabStop = false;
this.PlaybackGroupBox.Text = "Playback";
//
// RecordingModeCheckbox
//
this.RecordingModeCheckbox.AutoSize = true;
this.RecordingModeCheckbox.Location = new System.Drawing.Point(10, 85);
this.RecordingModeCheckbox.Name = "RecordingModeCheckbox";
this.RecordingModeCheckbox.Size = new System.Drawing.Size(104, 17);
this.RecordingModeCheckbox.TabIndex = 9;
this.RecordingModeCheckbox.Text = "Recording mode";
this.RecordingModeCheckbox.UseVisualStyleBackColor = true;
this.RecordingModeCheckbox.CheckedChanged += new System.EventHandler(this.RecordingModeCheckbox_CheckedChanged);
//
// AutoRestoreCheckbox
//
this.AutoRestoreCheckbox.AutoSize = true;
@ -152,7 +165,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.PlaybackGroupBox);
this.Name = "PlaybackBox";
this.Size = new System.Drawing.Size(204, 91);
this.Size = new System.Drawing.Size(204, 110);
this.PlaybackGroupBox.ResumeLayout(false);
this.PlaybackGroupBox.PerformLayout();
this.ResumeLayout(false);
@ -170,5 +183,6 @@
private System.Windows.Forms.CheckBox AutoRestoreCheckbox;
private System.Windows.Forms.CheckBox TurboSeekCheckbox;
private System.Windows.Forms.CheckBox FollowCursorCheckbox;
private System.Windows.Forms.CheckBox RecordingModeCheckbox;
}
}

View File

@ -62,6 +62,21 @@ namespace BizHawk.Client.EmuHawk
}
}
[Browsable(true)]
[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)]
public bool RecordingMode
{
get
{
return Global.MovieSession.ReadOnly;
}
set
{
RecordingModeCheckbox.Checked = value;
}
}
public PlaybackBox()
{
InitializeComponent();
@ -80,6 +95,7 @@ namespace BizHawk.Client.EmuHawk
{
AutoRestoreCheckbox.Checked = Tastudio.Settings.AutoRestoreLastPosition;
FollowCursorCheckbox.Checked = Tastudio.Settings.FollowCursor;
RecordingModeCheckbox.Checked = false;
}
_loading = false;
@ -141,5 +157,18 @@ namespace BizHawk.Client.EmuHawk
}
}
}
private void RecordingModeCheckbox_CheckedChanged(object sender, EventArgs e)
{
if (RecordingModeCheckbox.Checked)
{
Global.MovieSession.Movie.SwitchToRecord();
}
else
{
Global.MovieSession.Movie.SwitchToPlay();
}
GlobalWin.MainForm.SetMainformMovieInfo();
}
}
}

View File

@ -1300,7 +1300,7 @@ namespace BizHawk.Client.EmuHawk
| System.Windows.Forms.AnchorStyles.Right)));
this.TasPlaybackBox.Location = new System.Drawing.Point(3, 4);
this.TasPlaybackBox.Name = "TasPlaybackBox";
this.TasPlaybackBox.Size = new System.Drawing.Size(204, 92);
this.TasPlaybackBox.Size = new System.Drawing.Size(204, 111);
this.TasPlaybackBox.TabIndex = 5;
this.TasPlaybackBox.Tastudio = null;
//
@ -1312,7 +1312,7 @@ namespace BizHawk.Client.EmuHawk
this.MarkerControl.Emulator = null;
this.MarkerControl.Location = new System.Drawing.Point(2, 16);
this.MarkerControl.Name = "MarkerControl";
this.MarkerControl.Size = new System.Drawing.Size(194, 235);
this.MarkerControl.Size = new System.Drawing.Size(194, 193);
this.MarkerControl.TabIndex = 6;
this.MarkerControl.Tastudio = null;
//
@ -1346,39 +1346,39 @@ namespace BizHawk.Client.EmuHawk
this.StartNewProjectFromNowMenuItem,
this.StartANewProjectFromSaveRamMenuItem});
this.RightClickMenu.Name = "RightClickMenu";
this.RightClickMenu.Size = new System.Drawing.Size(254, 480);
this.RightClickMenu.Size = new System.Drawing.Size(249, 480);
this.RightClickMenu.Opened += new System.EventHandler(this.RightClickMenu_Opened);
//
// SetMarkersContextMenuItem
//
this.SetMarkersContextMenuItem.Name = "SetMarkersContextMenuItem";
this.SetMarkersContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.SetMarkersContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.SetMarkersContextMenuItem.Text = "Set Markers";
this.SetMarkersContextMenuItem.Click += new System.EventHandler(this.SetMarkersMenuItem_Click);
//
// SetMarkerWithTextContextMenuItem
//
this.SetMarkerWithTextContextMenuItem.Name = "SetMarkerWithTextContextMenuItem";
this.SetMarkerWithTextContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.SetMarkerWithTextContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.SetMarkerWithTextContextMenuItem.Text = "Set Marker with Text";
this.SetMarkerWithTextContextMenuItem.Click += new System.EventHandler(this.SetMarkerWithTextMenuItem_Click);
//
// RemoveMarkersContextMenuItem
//
this.RemoveMarkersContextMenuItem.Name = "RemoveMarkersContextMenuItem";
this.RemoveMarkersContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.RemoveMarkersContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.RemoveMarkersContextMenuItem.Text = "Remove Markers";
this.RemoveMarkersContextMenuItem.Click += new System.EventHandler(this.RemoveMarkersMenuItem_Click);
//
// toolStripSeparator15
//
this.toolStripSeparator15.Name = "toolStripSeparator15";
this.toolStripSeparator15.Size = new System.Drawing.Size(250, 6);
this.toolStripSeparator15.Size = new System.Drawing.Size(245, 6);
//
// DeselectContextMenuItem
//
this.DeselectContextMenuItem.Name = "DeselectContextMenuItem";
this.DeselectContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.DeselectContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.DeselectContextMenuItem.Text = "Deselect";
this.DeselectContextMenuItem.Click += new System.EventHandler(this.DeselectMenuItem_Click);
//
@ -1386,39 +1386,39 @@ namespace BizHawk.Client.EmuHawk
//
this.SelectBetweenMarkersContextMenuItem.Name = "SelectBetweenMarkersContextMenuItem";
this.SelectBetweenMarkersContextMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A)));
this.SelectBetweenMarkersContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.SelectBetweenMarkersContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.SelectBetweenMarkersContextMenuItem.Text = "Select between Markers";
this.SelectBetweenMarkersContextMenuItem.Click += new System.EventHandler(this.SelectBetweenMarkersMenuItem_Click);
//
// toolStripSeparator16
//
this.toolStripSeparator16.Name = "toolStripSeparator16";
this.toolStripSeparator16.Size = new System.Drawing.Size(250, 6);
this.toolStripSeparator16.Size = new System.Drawing.Size(245, 6);
//
// UngreenzoneContextMenuItem
//
this.UngreenzoneContextMenuItem.Name = "UngreenzoneContextMenuItem";
this.UngreenzoneContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.UngreenzoneContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.UngreenzoneContextMenuItem.Text = "Clear Greenzone";
this.UngreenzoneContextMenuItem.Click += new System.EventHandler(this.ClearGreenzoneMenuItem_Click);
//
// CancelSeekContextMenuItem
//
this.CancelSeekContextMenuItem.Name = "CancelSeekContextMenuItem";
this.CancelSeekContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.CancelSeekContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.CancelSeekContextMenuItem.Text = "Cancel Seek";
this.CancelSeekContextMenuItem.Click += new System.EventHandler(this.CancelSeekContextMenuItem_Click);
//
// toolStripSeparator17
//
this.toolStripSeparator17.Name = "toolStripSeparator17";
this.toolStripSeparator17.Size = new System.Drawing.Size(250, 6);
this.toolStripSeparator17.Size = new System.Drawing.Size(245, 6);
//
// copyToolStripMenuItem
//
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
this.copyToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+C";
this.copyToolStripMenuItem.Size = new System.Drawing.Size(253, 22);
this.copyToolStripMenuItem.Size = new System.Drawing.Size(248, 22);
this.copyToolStripMenuItem.Text = "Copy";
this.copyToolStripMenuItem.Click += new System.EventHandler(this.CopyMenuItem_Click);
//
@ -1426,7 +1426,7 @@ namespace BizHawk.Client.EmuHawk
//
this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
this.pasteToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+V";
this.pasteToolStripMenuItem.Size = new System.Drawing.Size(253, 22);
this.pasteToolStripMenuItem.Size = new System.Drawing.Size(248, 22);
this.pasteToolStripMenuItem.Text = "Paste";
this.pasteToolStripMenuItem.Click += new System.EventHandler(this.PasteMenuItem_Click);
//
@ -1434,7 +1434,7 @@ namespace BizHawk.Client.EmuHawk
//
this.pasteInsertToolStripMenuItem.Name = "pasteInsertToolStripMenuItem";
this.pasteInsertToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Shift+V";
this.pasteInsertToolStripMenuItem.Size = new System.Drawing.Size(253, 22);
this.pasteInsertToolStripMenuItem.Size = new System.Drawing.Size(248, 22);
this.pasteInsertToolStripMenuItem.Text = "Paste Insert";
this.pasteInsertToolStripMenuItem.Click += new System.EventHandler(this.PasteInsertMenuItem_Click);
//
@ -1442,20 +1442,20 @@ namespace BizHawk.Client.EmuHawk
//
this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
this.cutToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+X";
this.cutToolStripMenuItem.Size = new System.Drawing.Size(253, 22);
this.cutToolStripMenuItem.Size = new System.Drawing.Size(248, 22);
this.cutToolStripMenuItem.Text = "Cut";
this.cutToolStripMenuItem.Click += new System.EventHandler(this.CutMenuItem_Click);
//
// separateToolStripMenuItem
//
this.separateToolStripMenuItem.Name = "separateToolStripMenuItem";
this.separateToolStripMenuItem.Size = new System.Drawing.Size(250, 6);
this.separateToolStripMenuItem.Size = new System.Drawing.Size(245, 6);
//
// ClearContextMenuItem
//
this.ClearContextMenuItem.Name = "ClearContextMenuItem";
this.ClearContextMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete;
this.ClearContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.ClearContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.ClearContextMenuItem.Text = "Clear";
this.ClearContextMenuItem.Click += new System.EventHandler(this.ClearFramesMenuItem_Click);
//
@ -1463,7 +1463,7 @@ namespace BizHawk.Client.EmuHawk
//
this.InsertFrameContextMenuItem.Name = "InsertFrameContextMenuItem";
this.InsertFrameContextMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Insert;
this.InsertFrameContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.InsertFrameContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.InsertFrameContextMenuItem.Text = "Insert";
this.InsertFrameContextMenuItem.Click += new System.EventHandler(this.InsertFrameMenuItem_Click);
//
@ -1471,7 +1471,7 @@ namespace BizHawk.Client.EmuHawk
//
this.DeleteFramesContextMenuItem.Name = "DeleteFramesContextMenuItem";
this.DeleteFramesContextMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Delete)));
this.DeleteFramesContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.DeleteFramesContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.DeleteFramesContextMenuItem.Text = "Delete";
this.DeleteFramesContextMenuItem.Click += new System.EventHandler(this.DeleteFramesMenuItem_Click);
//
@ -1479,7 +1479,7 @@ namespace BizHawk.Client.EmuHawk
//
this.CloneContextMenuItem.Name = "CloneContextMenuItem";
this.CloneContextMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Insert)));
this.CloneContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.CloneContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.CloneContextMenuItem.Text = "Clone";
this.CloneContextMenuItem.Click += new System.EventHandler(this.CloneFramesMenuItem_Click);
//
@ -1488,45 +1488,45 @@ namespace BizHawk.Client.EmuHawk
this.InsertNumFramesContextMenuItem.Name = "InsertNumFramesContextMenuItem";
this.InsertNumFramesContextMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.Insert)));
this.InsertNumFramesContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.InsertNumFramesContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.InsertNumFramesContextMenuItem.Text = "Insert # of Frames";
this.InsertNumFramesContextMenuItem.Click += new System.EventHandler(this.InsertNumFramesMenuItem_Click);
//
// toolStripSeparator18
//
this.toolStripSeparator18.Name = "toolStripSeparator18";
this.toolStripSeparator18.Size = new System.Drawing.Size(250, 6);
this.toolStripSeparator18.Size = new System.Drawing.Size(245, 6);
//
// TruncateContextMenuItem
//
this.TruncateContextMenuItem.Name = "TruncateContextMenuItem";
this.TruncateContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.TruncateContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.TruncateContextMenuItem.Text = "Truncate Movie";
this.TruncateContextMenuItem.Click += new System.EventHandler(this.TruncateMenuItem_Click);
//
// BranchContextMenuItem
//
this.BranchContextMenuItem.Name = "BranchContextMenuItem";
this.BranchContextMenuItem.Size = new System.Drawing.Size(253, 22);
this.BranchContextMenuItem.Size = new System.Drawing.Size(248, 22);
this.BranchContextMenuItem.Text = "&Branch";
this.BranchContextMenuItem.Click += new System.EventHandler(this.BranchContextMenuItem_Click);
//
// StartFromNowSeparator
//
this.StartFromNowSeparator.Name = "StartFromNowSeparator";
this.StartFromNowSeparator.Size = new System.Drawing.Size(250, 6);
this.StartFromNowSeparator.Size = new System.Drawing.Size(245, 6);
//
// StartNewProjectFromNowMenuItem
//
this.StartNewProjectFromNowMenuItem.Name = "StartNewProjectFromNowMenuItem";
this.StartNewProjectFromNowMenuItem.Size = new System.Drawing.Size(253, 22);
this.StartNewProjectFromNowMenuItem.Size = new System.Drawing.Size(248, 22);
this.StartNewProjectFromNowMenuItem.Text = "Start a new project from Now";
this.StartNewProjectFromNowMenuItem.Click += new System.EventHandler(this.StartNewProjectFromNowMenuItem_Click);
//
// StartANewProjectFromSaveRamMenuItem
//
this.StartANewProjectFromSaveRamMenuItem.Name = "StartANewProjectFromSaveRamMenuItem";
this.StartANewProjectFromSaveRamMenuItem.Size = new System.Drawing.Size(253, 22);
this.StartANewProjectFromSaveRamMenuItem.Size = new System.Drawing.Size(248, 22);
this.StartANewProjectFromSaveRamMenuItem.Text = "Start a new project from SaveRam";
this.StartANewProjectFromSaveRamMenuItem.Click += new System.EventHandler(this.StartANewProjectFromSaveRamMenuItem_Click);
//
@ -1538,7 +1538,7 @@ namespace BizHawk.Client.EmuHawk
this.groupBox1.Controls.Add(this.MarkerControl);
this.groupBox1.Location = new System.Drawing.Point(-2, 3);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(204, 257);
this.groupBox1.Size = new System.Drawing.Size(204, 215);
this.groupBox1.TabIndex = 7;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Markers";
@ -1551,7 +1551,7 @@ namespace BizHawk.Client.EmuHawk
this.BookMarkControl.HoverInterval = 1;
this.BookMarkControl.Location = new System.Drawing.Point(-2, 5);
this.BookMarkControl.Name = "BookMarkControl";
this.BookMarkControl.Size = new System.Drawing.Size(204, 163);
this.BookMarkControl.Size = new System.Drawing.Size(204, 173);
this.BookMarkControl.TabIndex = 8;
this.BookMarkControl.Tastudio = null;
//
@ -1560,7 +1560,7 @@ namespace BizHawk.Client.EmuHawk
this.BranchesMarkersSplit.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.BranchesMarkersSplit.Location = new System.Drawing.Point(3, 89);
this.BranchesMarkersSplit.Location = new System.Drawing.Point(3, 121);
this.BranchesMarkersSplit.Name = "BranchesMarkersSplit";
this.BranchesMarkersSplit.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
@ -1571,8 +1571,8 @@ namespace BizHawk.Client.EmuHawk
// BranchesMarkersSplit.Panel2
//
this.BranchesMarkersSplit.Panel2.Controls.Add(this.groupBox1);
this.BranchesMarkersSplit.Size = new System.Drawing.Size(204, 436);
this.BranchesMarkersSplit.SplitterDistance = 169;
this.BranchesMarkersSplit.Size = new System.Drawing.Size(204, 404);
this.BranchesMarkersSplit.SplitterDistance = 179;
this.BranchesMarkersSplit.TabIndex = 9;
this.BranchesMarkersSplit.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.BranchesMarkersSplit_SplitterMoved);
//

View File

@ -52,12 +52,10 @@ namespace BizHawk.Client.EmuHawk
if (CurrentTasMovie.IsPlaying)
{
TastudioRecordMode();
GlobalWin.OSD.AddMessage("Tastudio: Recording mode");
}
else if (CurrentTasMovie.IsRecording)
{
TastudioPlayMode();
GlobalWin.OSD.AddMessage("Tastudio: Playback mode");
}
}

View File

@ -665,6 +665,7 @@ namespace BizHawk.Client.EmuHawk
{
GlobalWin.MainForm.PauseEmulator();
GlobalWin.MainForm.PauseOnFrame = null;
StopSeeking();
}
}
RefreshDialog();

View File

@ -647,6 +647,7 @@ namespace BizHawk.Client.EmuHawk
movie = CurrentTasMovie;
SetTasMovieCallbacks(movie as TasMovie);
bool result = GlobalWin.MainForm.StartNewMovie(movie, record);
TastudioPlayMode();
_initializing = false;
return result;
@ -686,14 +687,12 @@ namespace BizHawk.Client.EmuHawk
private void TastudioPlayMode()
{
CurrentTasMovie.SwitchToPlay();
GlobalWin.MainForm.SetMainformMovieInfo();
TasPlaybackBox.RecordingMode = false;
}
private void TastudioRecordMode()
{
CurrentTasMovie.SwitchToRecord();
GlobalWin.MainForm.SetMainformMovieInfo();
TasPlaybackBox.RecordingMode = true;
}
private void TastudioStopMovie()