make TAStudio not rely on the global MovieEndAction setting
- closes #3989
This commit is contained in:
parent
3c5f699af9
commit
af4089380a
|
@ -82,12 +82,6 @@ namespace BizHawk.Client.Common
|
|||
else if (Movie.IsPlaying())
|
||||
{
|
||||
LatchInputToLog();
|
||||
// if we're at the movie's end and the MovieEndAction is record, just continue recording in play mode
|
||||
// TODO change to TAStudio check
|
||||
if (Movie is ITasMovie && Movie.Emulator.Frame == Movie.FrameCount && Settings.MovieEndAction == MovieEndAction.Record)
|
||||
{
|
||||
Movie.RecordFrame(Movie.Emulator.Frame, MovieOut.Source);
|
||||
}
|
||||
}
|
||||
else if (Movie.IsRecording())
|
||||
{
|
||||
|
@ -96,16 +90,14 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
public void HandleFrameAfter()
|
||||
public void HandleFrameAfter(bool ignoreMovieEndAction)
|
||||
{
|
||||
if (Movie is ITasMovie tasMovie)
|
||||
{
|
||||
tasMovie.GreenzoneCurrentFrame();
|
||||
// TODO change to TAStudio check
|
||||
if (Settings.MovieEndAction == MovieEndAction.Record) return;
|
||||
}
|
||||
|
||||
if (Movie.IsPlaying() && Movie.Emulator.Frame >= Movie.FrameCount)
|
||||
if (!ignoreMovieEndAction && Movie.IsPlaying() && Movie.Emulator.Frame == Movie.FrameCount)
|
||||
{
|
||||
HandlePlaybackEnd();
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace BizHawk.Client.Common
|
|||
IMovieController GenerateMovieController(ControllerDefinition definition = null, string logKey = null);
|
||||
|
||||
void HandleFrameBefore();
|
||||
void HandleFrameAfter();
|
||||
void HandleFrameAfter(bool ignoreMovieEndAction);
|
||||
void HandleSaveState(TextWriter writer);
|
||||
|
||||
bool CheckSavestateTimeline(TextReader reader);
|
||||
|
|
|
@ -61,5 +61,7 @@
|
|||
bool WantsToControlRestartMovie { get; }
|
||||
|
||||
bool RestartMovie();
|
||||
|
||||
bool WantsToBypassMovieEndAction { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -183,13 +183,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
MovieEndRecordMenuItem.Checked = Config.Movies.MovieEndAction == MovieEndAction.Record;
|
||||
MovieEndStopMenuItem.Checked = Config.Movies.MovieEndAction == MovieEndAction.Stop;
|
||||
MovieEndPauseMenuItem.Checked = Config.Movies.MovieEndAction == MovieEndAction.Pause;
|
||||
|
||||
// Arguably an IControlMainForm property should be set here, but in reality only Tastudio is ever going to interfere with this logic
|
||||
MovieEndFinishMenuItem.Enabled =
|
||||
MovieEndRecordMenuItem.Enabled =
|
||||
MovieEndStopMenuItem.Enabled =
|
||||
MovieEndPauseMenuItem.Enabled =
|
||||
!Tools.Has<TAStudio>();
|
||||
}
|
||||
|
||||
private void AVSubMenu_DropDownOpened(object sender, EventArgs e)
|
||||
|
|
|
@ -1118,6 +1118,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
private IControlMainform ToolControllingStopMovie => Tools.FirstOrNull<IControlMainform>(tool => tool.WantsToControlStopMovie);
|
||||
private IControlMainform ToolControllingRestartMovie => Tools.FirstOrNull<IControlMainform>(tool => tool.WantsToControlRestartMovie);
|
||||
private IControlMainform ToolControllingReadOnly => Tools.FirstOrNull<IControlMainform>(tool => tool.WantsToControlReadOnly);
|
||||
private IControlMainform ToolBypassingMovieEndAction => Tools.FirstOrNull<IControlMainform>(tool => tool.WantsToBypassMovieEndAction);
|
||||
|
||||
private DisplayManager DisplayManager;
|
||||
|
||||
|
@ -3081,7 +3082,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
bool render = !InvisibleEmulation && (!_throttle.skipNextFrame || _currAviWriter?.UsesVideo is true || atTurboSeekEnd);
|
||||
bool newFrame = Emulator.FrameAdvance(InputManager.ControllerOutput, render, renderSound);
|
||||
|
||||
MovieSession.HandleFrameAfter();
|
||||
MovieSession.HandleFrameAfter(ToolBypassingMovieEndAction is not null);
|
||||
|
||||
if (returnToRecording)
|
||||
{
|
||||
|
|
|
@ -45,6 +45,8 @@
|
|||
public bool RestartMovie()
|
||||
=> false;
|
||||
|
||||
public bool WantsToBypassMovieEndAction => false;
|
||||
|
||||
// TODO: We want to prevent movies and probably other things
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,5 +113,7 @@
|
|||
|
||||
public bool WantsToControlReboot => false;
|
||||
public void RebootCore() => throw new NotSupportedException("This should never be called");
|
||||
|
||||
public bool WantsToBypassMovieEndAction => true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,16 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
protected override void UpdateBefore()
|
||||
{
|
||||
if (CurrentTasMovie.IsAtEnd())
|
||||
{
|
||||
CurrentTasMovie.RecordFrame(CurrentTasMovie.Emulator.Frame, MovieSession.StickySource);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void FastUpdateBefore() => UpdateBefore();
|
||||
|
||||
protected override void GeneralUpdate()
|
||||
{
|
||||
RefreshDialog();
|
||||
|
|
|
@ -34,7 +34,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
private readonly List<TasClipboardEntry> _tasClipboard = new List<TasClipboardEntry>();
|
||||
private const string CursorColumnName = "CursorColumn";
|
||||
private const string FrameColumnName = "FrameColumn";
|
||||
private MovieEndAction _originalEndAction; // The movie end behavior selected by the user (that is overridden by TAStudio)
|
||||
private UndoHistoryForm _undoForm;
|
||||
private Timer _autosaveTimer;
|
||||
|
||||
|
@ -292,9 +291,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
|
||||
MainForm.AddOnScreenMessage("TAStudio engaged");
|
||||
_originalEndAction = Config.Movies.MovieEndAction;
|
||||
MainForm.DisableRewind();
|
||||
Config.Movies.MovieEndAction = MovieEndAction.Record;
|
||||
MainForm.SetMainformMovieInfo();
|
||||
MovieSession.ReadOnly = true;
|
||||
SetSplicer();
|
||||
|
@ -673,7 +670,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
_engaged = false;
|
||||
MainForm.PauseOnFrame = null;
|
||||
MainForm.AddOnScreenMessage("TAStudio disengaged");
|
||||
Config.Movies.MovieEndAction = _originalEndAction;
|
||||
WantsToControlRewind = false;
|
||||
MainForm.EnableRewind(true);
|
||||
MainForm.SetMainformMovieInfo();
|
||||
|
|
Loading…
Reference in New Issue