tastudio: introduce fast scroll idea via timer
seek frame is reset only if paused OR 100ms since last scroll haven't elapsed
This commit is contained in:
parent
f9dad99484
commit
de699656d6
|
@ -42,7 +42,9 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _triggerAutoRestore; // If true, autorestore will be called on mouse up
|
private bool _triggerAutoRestore; // If true, autorestore will be called on mouse up
|
||||||
private int? _triggerAutoRestoreFromFrame; // If set and _triggerAutoRestore is true, will call GoToFrameIfNecessary() with this value
|
private int? _triggerAutoRestoreFromFrame; // If set and _triggerAutoRestore is true, will call GoToFrameIfNecessary() with this value
|
||||||
|
|
||||||
|
private System.Timers.Timer _mouseWheelTimer;
|
||||||
|
|
||||||
// public static Color CurrentFrame_FrameCol = Color.FromArgb(0xCFEDFC); Why?
|
// public static Color CurrentFrame_FrameCol = Color.FromArgb(0xCFEDFC); Why?
|
||||||
public static Color CurrentFrame_InputLog = Color.FromArgb(0xB5E7F7);
|
public static Color CurrentFrame_InputLog = Color.FromArgb(0xB5E7F7);
|
||||||
|
@ -494,6 +496,12 @@ namespace BizHawk.Client.EmuHawk
|
||||||
GoToPreviousFrame();
|
GoToPreviousFrame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_mouseWheelTimer.Enabled) // dunno if this is telling enough and nothing like bool _mouseWheelFast is needed, but we need to check on the first scroll event, and just decide by delta if it's fast enough to increase actual scrolling speed
|
||||||
|
{
|
||||||
|
_mouseWheelTimer.Stop();
|
||||||
|
}
|
||||||
|
_mouseWheelTimer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TasView_MouseDoubleClick(object sender, MouseEventArgs e)
|
private void TasView_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||||
|
|
|
@ -302,6 +302,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Global.Config.MovieEndAction = MovieEndAction.Record;
|
Global.Config.MovieEndAction = MovieEndAction.Record;
|
||||||
GlobalWin.MainForm.SetMainformMovieInfo();
|
GlobalWin.MainForm.SetMainformMovieInfo();
|
||||||
Global.MovieSession.ReadOnly = true;
|
Global.MovieSession.ReadOnly = true;
|
||||||
|
_mouseWheelTimer = new System.Timers.Timer(100); // consider sub 100 ms fast scrolling
|
||||||
|
_mouseWheelTimer.Elapsed += (s, e) =>
|
||||||
|
{
|
||||||
|
_mouseWheelTimer.Stop();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -448,6 +453,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
// Do not keep TAStudio's disk save states.
|
// Do not keep TAStudio's disk save states.
|
||||||
if (Directory.Exists(PathManager.MakeAbsolutePath(Global.Config.PathEntries["Global", "TAStudio states"].Path, null)))
|
if (Directory.Exists(PathManager.MakeAbsolutePath(Global.Config.PathEntries["Global", "TAStudio states"].Path, null)))
|
||||||
Directory.Delete(PathManager.MakeAbsolutePath(Global.Config.PathEntries["Global", "TAStudio states"].Path, null), true);
|
Directory.Delete(PathManager.MakeAbsolutePath(Global.Config.PathEntries["Global", "TAStudio states"].Path, null), true);
|
||||||
|
_mouseWheelTimer.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -536,8 +542,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
LoadState(closestState);
|
LoadState(closestState);
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalWin.MainForm.PauseOnFrame = frame;
|
if (GlobalWin.MainForm.EmulatorPaused || _mouseWheelTimer.Enabled) // make seek frame keep up with emulation on fast scrolls
|
||||||
GlobalWin.MainForm.UnpauseEmulator();
|
{
|
||||||
|
GlobalWin.MainForm.PauseOnFrame = frame;
|
||||||
|
GlobalWin.MainForm.UnpauseEmulator();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadState(KeyValuePair<int, byte[]> state)
|
private void LoadState(KeyValuePair<int, byte[]> state)
|
||||||
|
|
Loading…
Reference in New Issue