2013-12-05 20:06:06 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2014-07-17 19:00:28 +00:00
|
|
|
|
using BizHawk.Client.Common;
|
|
|
|
|
|
2013-12-05 20:06:06 +00:00
|
|
|
|
namespace BizHawk.Client.EmuHawk
|
|
|
|
|
{
|
|
|
|
|
public partial class PlaybackBox : UserControl
|
|
|
|
|
{
|
2015-03-16 20:42:14 +00:00
|
|
|
|
private bool _loading = true;
|
2014-07-27 19:07:13 +00:00
|
|
|
|
|
2014-07-17 19:00:28 +00:00
|
|
|
|
public TAStudio Tastudio { get; set; }
|
|
|
|
|
|
2016-06-13 12:43:28 +00:00
|
|
|
|
[Browsable(true)]
|
2017-05-24 15:49:35 +00:00
|
|
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
2014-07-27 17:49:25 +00:00
|
|
|
|
public bool TurboSeek
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return Global.Config.TurboSeek;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2016-06-13 12:43:28 +00:00
|
|
|
|
TurboSeekCheckbox.Checked = value;
|
2014-07-27 17:49:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-13 12:43:28 +00:00
|
|
|
|
[Browsable(true)]
|
2017-05-24 15:49:35 +00:00
|
|
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
2014-07-28 17:40:17 +00:00
|
|
|
|
public bool AutoRestore
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2015-01-01 18:24:35 +00:00
|
|
|
|
return Tastudio.Settings.AutoRestoreLastPosition;
|
2014-07-28 17:40:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2016-06-13 12:43:28 +00:00
|
|
|
|
AutoRestoreCheckbox.Checked = value;
|
2014-07-28 17:40:17 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-13 12:43:28 +00:00
|
|
|
|
[Browsable(true)]
|
2017-05-24 15:49:35 +00:00
|
|
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
2014-10-11 19:43:05 +00:00
|
|
|
|
public bool FollowCursor
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2015-01-03 02:54:38 +00:00
|
|
|
|
return Tastudio.Settings.FollowCursor;
|
2014-10-11 19:43:05 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
2015-03-14 16:38:07 +00:00
|
|
|
|
FollowCursorCheckbox.Checked = value;
|
2014-10-11 19:43:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-08-06 19:28:25 +00:00
|
|
|
|
[Browsable(true)]
|
2017-05-24 15:49:35 +00:00
|
|
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
2016-08-06 19:28:25 +00:00
|
|
|
|
public bool RecordingMode
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2016-08-07 08:02:52 +00:00
|
|
|
|
return Global.MovieSession.Movie.IsRecording;
|
2016-08-06 19:28:25 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
RecordingModeCheckbox.Checked = value;
|
2017-02-07 16:02:32 +00:00
|
|
|
|
Global.MovieSession.ReadOnly = !value;
|
2016-08-07 08:02:52 +00:00
|
|
|
|
if (RecordingModeCheckbox.Checked)
|
|
|
|
|
{
|
|
|
|
|
Global.MovieSession.Movie.SwitchToRecord();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Global.MovieSession.Movie.SwitchToPlay();
|
|
|
|
|
}
|
2017-05-24 15:49:35 +00:00
|
|
|
|
|
2016-08-07 08:02:52 +00:00
|
|
|
|
GlobalWin.MainForm.SetMainformMovieInfo();
|
2016-08-06 19:28:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-02 21:25:10 +00:00
|
|
|
|
public PlaybackBox()
|
2013-12-05 20:06:06 +00:00
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
2015-01-02 17:28:51 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnLoad(EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
base.OnLoad(e);
|
|
|
|
|
|
2015-01-02 21:25:10 +00:00
|
|
|
|
if (Global.Config != null) // For the designer
|
|
|
|
|
{
|
|
|
|
|
TurboSeekCheckbox.Checked = Global.Config.TurboSeek;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Tastudio != null) // For the designer
|
|
|
|
|
{
|
2015-01-03 02:54:38 +00:00
|
|
|
|
AutoRestoreCheckbox.Checked = Tastudio.Settings.AutoRestoreLastPosition;
|
|
|
|
|
FollowCursorCheckbox.Checked = Tastudio.Settings.FollowCursor;
|
2016-08-07 08:02:52 +00:00
|
|
|
|
RecordingModeCheckbox.Checked = RecordingMode;
|
2015-01-02 21:25:10 +00:00
|
|
|
|
}
|
2015-01-02 17:28:51 +00:00
|
|
|
|
|
2015-03-16 20:42:14 +00:00
|
|
|
|
_loading = false;
|
2013-12-05 20:06:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
2014-07-17 19:00:28 +00:00
|
|
|
|
private void PreviousMarkerButton_Click(object sender, EventArgs e)
|
2013-12-05 20:06:06 +00:00
|
|
|
|
{
|
2014-07-17 19:00:28 +00:00
|
|
|
|
Tastudio.GoToPreviousMarker();
|
|
|
|
|
}
|
2013-12-05 20:06:06 +00:00
|
|
|
|
|
2014-07-17 19:00:28 +00:00
|
|
|
|
private void PauseButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Tastudio.TogglePause();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void NextMarkerButton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Tastudio.GoToNextMarker();
|
2013-12-05 20:06:06 +00:00
|
|
|
|
}
|
2014-07-27 17:49:25 +00:00
|
|
|
|
|
|
|
|
|
private void TurboSeekCheckbox_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-03-16 20:42:14 +00:00
|
|
|
|
if (!_loading)
|
2014-07-27 19:07:13 +00:00
|
|
|
|
{
|
|
|
|
|
Global.Config.TurboSeek ^= true;
|
|
|
|
|
}
|
2014-07-27 17:49:25 +00:00
|
|
|
|
}
|
2014-07-28 17:40:17 +00:00
|
|
|
|
|
|
|
|
|
private void AutoRestoreCheckbox_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-03-16 20:42:14 +00:00
|
|
|
|
if (!_loading)
|
2014-07-28 17:40:17 +00:00
|
|
|
|
{
|
2015-01-01 18:24:35 +00:00
|
|
|
|
Tastudio.Settings.AutoRestoreLastPosition ^= true;
|
2014-07-28 17:40:17 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-10-11 19:43:05 +00:00
|
|
|
|
|
|
|
|
|
private void FollowCursorCheckbox_CheckedChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
2015-03-16 20:42:14 +00:00
|
|
|
|
if (!_loading)
|
2014-10-11 19:43:05 +00:00
|
|
|
|
{
|
2015-03-16 20:42:14 +00:00
|
|
|
|
Tastudio.Settings.FollowCursor ^= true;
|
|
|
|
|
|
2015-01-01 18:24:35 +00:00
|
|
|
|
if (Tastudio.Settings.FollowCursor)
|
2014-10-11 19:43:05 +00:00
|
|
|
|
{
|
|
|
|
|
Tastudio.SetVisibleIndex();
|
|
|
|
|
Tastudio.RefreshDialog();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-08-06 19:28:25 +00:00
|
|
|
|
|
2016-08-07 08:02:52 +00:00
|
|
|
|
private void RecordingModeCheckbox_MouseClick(object sender, MouseEventArgs e)
|
2016-08-06 19:28:25 +00:00
|
|
|
|
{
|
2016-08-07 08:02:52 +00:00
|
|
|
|
RecordingMode ^= true;
|
2017-02-19 07:30:10 +00:00
|
|
|
|
Tastudio.WasRecording = RecordingMode; // hard reset at manual click
|
2016-08-06 19:28:25 +00:00
|
|
|
|
}
|
2016-08-28 14:13:14 +00:00
|
|
|
|
|
|
|
|
|
private void RewindButton_MouseDown(object sender, MouseEventArgs e)
|
|
|
|
|
{
|
2016-08-28 15:42:59 +00:00
|
|
|
|
GlobalWin.MainForm.PressRewind = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void RewindButton_MouseUp(object sender, MouseEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
GlobalWin.MainForm.PressRewind = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void RewindButton_MouseLeave(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
GlobalWin.MainForm.PressRewind = false;
|
2016-08-28 14:13:14 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void FrameAdvanceButton_MouseDown(object sender, MouseEventArgs e)
|
|
|
|
|
{
|
2016-08-28 15:42:59 +00:00
|
|
|
|
GlobalWin.MainForm.HoldFrameAdvance = true;
|
2016-08-28 14:13:14 +00:00
|
|
|
|
}
|
2016-08-28 15:42:59 +00:00
|
|
|
|
|
|
|
|
|
private void FrameAdvanceButton_MouseLeave(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
GlobalWin.MainForm.HoldFrameAdvance = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void FrameAdvanceButton_MouseUp(object sender, MouseEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
GlobalWin.MainForm.HoldFrameAdvance = false;
|
|
|
|
|
}
|
2013-12-05 20:06:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|