improve estimated time display in RewindConfig
now takes the estimated rewind interval into account to display the actual estimated rewind range, which is what people care about
This commit is contained in:
parent
84c79b9053
commit
24641433e4
|
@ -277,6 +277,7 @@
|
|||
0,
|
||||
0,
|
||||
0});
|
||||
this.TargetFrameLengthNumeric.ValueChanged += new System.EventHandler(this.FrameLength_ValueChanged);
|
||||
//
|
||||
// TargetRewindIntervalNumeric
|
||||
//
|
||||
|
@ -299,6 +300,7 @@
|
|||
0,
|
||||
0,
|
||||
0});
|
||||
this.TargetRewindIntervalNumeric.ValueChanged += new System.EventHandler(this.RewindInterval_ValueChanged);
|
||||
//
|
||||
// EstTimeLabel
|
||||
//
|
||||
|
@ -550,6 +552,7 @@
|
|||
this.TargetRewindIntervalRadioButton.TabStop = true;
|
||||
this.TargetRewindIntervalRadioButton.Text = "Rewinds every fixed number of frames: ";
|
||||
this.TargetRewindIntervalRadioButton.UseVisualStyleBackColor = true;
|
||||
this.TargetRewindIntervalRadioButton.CheckedChanged += new System.EventHandler(this.RewindInterval_CheckedChanged);
|
||||
//
|
||||
// RewindConfig
|
||||
//
|
||||
|
@ -636,4 +639,4 @@
|
|||
private System.Windows.Forms.RadioButton TargetFrameLengthRadioButton;
|
||||
private System.Windows.Forms.RadioButton TargetRewindIntervalRadioButton;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,15 +157,24 @@ namespace BizHawk.Client.EmuHawk
|
|||
double estFrames = 0.0;
|
||||
var bufferSize = 1L << (int) BufferSizeUpDown.Value;
|
||||
labelEx1.Text = bufferSize.ToString();
|
||||
int calculatedRewindInterval = TargetRewindIntervalRadioButton.Checked ? (int) TargetRewindIntervalNumeric.Value : 1;
|
||||
if (_avgStateSize is not 0UL)
|
||||
{
|
||||
bufferSize *= 1024 * 1024;
|
||||
estFrames = bufferSize / (double) _avgStateSize;
|
||||
if (TargetFrameLengthRadioButton.Checked)
|
||||
calculatedRewindInterval = (int) Math.Ceiling((int) TargetFrameLengthNumeric.Value / estFrames);
|
||||
}
|
||||
ApproxFramesLabel.Text = $"{estFrames:n0} frames";
|
||||
EstTimeLabel.Text = $"{estFrames / _framerate / 60.0:n} minutes";
|
||||
EstTimeLabel.Text = $"{estFrames / _framerate / 60.0 * calculatedRewindInterval:n} minutes";
|
||||
}
|
||||
|
||||
private void FrameLength_ValueChanged(object sender, EventArgs e) => CalculateEstimates();
|
||||
|
||||
private void RewindInterval_ValueChanged(object sender, EventArgs e) => CalculateEstimates();
|
||||
|
||||
private void RewindInterval_CheckedChanged(object sender, EventArgs e) => CalculateEstimates();
|
||||
|
||||
private void BufferSizeUpDown_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
CalculateEstimates();
|
||||
|
|
Loading…
Reference in New Issue