tastudio: do normal seeking while recording too. needs testing

if you go to a frame while recording and unpaused, it will seek to that frame (not touching input since rec mode is suspended), and after it reaches it, it will unpause and restore rec mode
This commit is contained in:
feos 2017-10-07 15:19:50 +03:00
parent 0d8b9c42cc
commit 84412eafd9
2 changed files with 6 additions and 5 deletions

View File

@ -55,7 +55,7 @@ namespace BizHawk.Client.EmuHawk
private bool _triggerAutoRestore; // If true, autorestore will be called on mouse up
private bool? _autoRestorePaused = null;
private int? _seekStartFrame = null;
private bool _shouldUnpauseFromRewind = false;
private bool _unpauseAfterSeeking = false;
private ControllerDefinition ControllerType => Global.MovieSession.MovieControllerAdapter.Definition;
@ -111,10 +111,10 @@ namespace BizHawk.Client.EmuHawk
}
Mainform.PauseOnFrame = null;
if (_shouldUnpauseFromRewind)
if (_unpauseAfterSeeking)
{
Mainform.UnpauseEmulator();
_shouldUnpauseFromRewind = false;
_unpauseAfterSeeking = false;
}
if (CurrentTasMovie != null)

View File

@ -829,7 +829,7 @@ namespace BizHawk.Client.EmuHawk
if (frame == Emulator.Frame)
return;
_shouldUnpauseFromRewind = fromRewinding && !Mainform.EmulatorPaused;
_unpauseAfterSeeking = (fromRewinding || WasRecording) && !Mainform.EmulatorPaused;
TastudioPlayMode();
KeyValuePair<int, byte[]> closestState = CurrentTasMovie.TasStateManager.GetStateClosestToFrame(frame);
if (closestState.Value != null && (frame < Emulator.Frame || closestState.Key > Emulator.Frame))
@ -871,7 +871,8 @@ namespace BizHawk.Client.EmuHawk
// frame == Emulator.Frame when frame == 0
if (frame > Emulator.Frame)
{
if (Mainform.EmulatorPaused || Mainform.IsSeeking || fromRewinding) // make seek frame keep up with emulation on fast scrolls
// make seek frame keep up with emulation on fast scrolls
if (Mainform.EmulatorPaused || Mainform.IsSeeking || fromRewinding || WasRecording)
{
StartSeeking(frame);
}