simplify naming of Rewinder api

This commit is contained in:
adelikat 2020-06-07 19:26:00 -05:00
parent ef9bb3208d
commit 10e5df99f1
3 changed files with 11 additions and 11 deletions

View File

@ -11,8 +11,8 @@ namespace BizHawk.Client.Common
long Size { get; } long Size { get; }
int RewindFrequency { get; } int RewindFrequency { get; }
bool RewindActive { get; } bool Active { get; }
bool SuspendRewind { get; set; } bool Suspend { get; set; }
void Capture(int frame); void Capture(int frame);
bool Rewind(int frames); bool Rewind(int frames);
@ -33,11 +33,11 @@ namespace BizHawk.Client.Common
private bool _lastRewindLoadedState; private bool _lastRewindLoadedState;
private byte[] _deltaBuffer = new byte[0]; private byte[] _deltaBuffer = new byte[0];
public bool RewindActive => RewindEnabled && !SuspendRewind; public bool Active => RewindEnabled && !Suspend;
private bool RewindEnabled { get; } private bool RewindEnabled { get; }
public bool SuspendRewind { get; set; } public bool Suspend { get; set; }
public float FullnessRatio => _rewindBuffer?.FullnessRatio ?? 0; public float FullnessRatio => _rewindBuffer?.FullnessRatio ?? 0;
@ -71,7 +71,7 @@ namespace BizHawk.Client.Common
_rewindDeltaEnable = settings.UseDelta; _rewindDeltaEnable = settings.UseDelta;
if (RewindActive) if (Active)
{ {
var capacity = settings.BufferSize * 1024L * 1024L; var capacity = settings.BufferSize * 1024L * 1024L;
_rewindBuffer = new StreamBlobDatabase(settings.OnDisk, capacity, BufferManage); _rewindBuffer = new StreamBlobDatabase(settings.OnDisk, capacity, BufferManage);
@ -122,7 +122,7 @@ namespace BizHawk.Client.Common
public void Capture(int frame) public void Capture(int frame)
{ {
if (!RewindActive) if (!Active)
{ {
return; return;
} }
@ -260,7 +260,7 @@ namespace BizHawk.Client.Common
public bool Rewind(int frames) public bool Rewind(int frames)
{ {
if (!RewindActive || _rewindThread == null) if (!Active || _rewindThread == null)
{ {
return false; return false;
} }

View File

@ -2099,7 +2099,7 @@ namespace BizHawk.Client.EmuHawk
// skips outputting the audio. There's also a third way which is when no throttle // skips outputting the audio. There's also a third way which is when no throttle
// method is selected, but the clock throttle determines that by itself and // method is selected, but the clock throttle determines that by itself and
// everything appears normal here. // everything appears normal here.
var rewind = Rewinder?.RewindActive == true && (InputManager.ClientControls["Rewind"] || PressRewind); var rewind = Rewinder?.Active == true && (InputManager.ClientControls["Rewind"] || PressRewind);
var fastForward = InputManager.ClientControls["Fast Forward"] || FastForward; var fastForward = InputManager.ClientControls["Fast Forward"] || FastForward;
var turbo = IsTurboing; var turbo = IsTurboing;
@ -4370,7 +4370,7 @@ namespace BizHawk.Client.EmuHawk
{ {
Master.CaptureRewind(); Master.CaptureRewind();
} }
else if (!suppressCaptureRewind && Rewinder?.RewindActive == true) else if (!suppressCaptureRewind && Rewinder?.Active == true)
{ {
Rewinder.Capture(Emulator.Frame); Rewinder.Capture(Emulator.Frame);
} }
@ -4432,7 +4432,7 @@ namespace BizHawk.Client.EmuHawk
return isRewinding; return isRewinding;
} }
if (Rewinder?.RewindActive == true && (InputManager.ClientControls["Rewind"] || PressRewind)) if (Rewinder?.Active == true && (InputManager.ClientControls["Rewind"] || PressRewind))
{ {
if (EmulatorPaused) if (EmulatorPaused)
{ {

View File

@ -28,7 +28,7 @@ namespace BizHawk.Client.EmuHawk
private void RewindConfig_Load(object sender, EventArgs e) private void RewindConfig_Load(object sender, EventArgs e)
{ {
if (_mainForm.Rewinder?.RewindActive == true) if (_mainForm.Rewinder?.Active == true)
{ {
FullnessLabel.Text = $"{_mainForm.Rewinder.FullnessRatio * 100:0.00}%"; FullnessLabel.Text = $"{_mainForm.Rewinder.FullnessRatio * 100:0.00}%";
RewindFramesUsedLabel.Text = _mainForm.Rewinder.Count.ToString(); RewindFramesUsedLabel.Text = _mainForm.Rewinder.Count.ToString();