SubNESHawk: Play Movie dialog now calculates time correctly

This commit is contained in:
alyosha-tas 2019-06-21 17:58:13 -04:00
parent 0444b35899
commit 982dc479e7
4 changed files with 27 additions and 4 deletions

View File

@ -110,7 +110,7 @@ namespace BizHawk.Client.Common
private double GetSeconds(IMovie movie)
{
double frames = movie.InputLogLength;
double frames = movie.TimeLength;
if (frames < 1)
{

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using BizHawk.Emulation.Common;
@ -69,12 +70,27 @@ namespace BizHawk.Client.Common
{
return double.PositiveInfinity;
}
return Log.Count;
}
}
public int InputLogLength => Log.Count;
public int InputLogLength
{
get
{
return Log.Count;
}
}
public int TimeLength
{
get
{
if (Header.ContainsKey("VBlankCount")) { return Convert.ToInt32(Header["VBlankCount"]); }
return Log.Count;
}
}
#region Log Editing

View File

@ -45,6 +45,8 @@ namespace BizHawk.Client.Common
public int InputLogLength => _log.Count;
public int TimeLength => _log.Count;
public double FrameCount
{
get

View File

@ -34,6 +34,11 @@ namespace BizHawk.Client.Common
/// </summary>
int InputLogLength { get; }
/// <summary>
/// Gets the actual length of time a movie lasts for. For subframe cores, this will be different then the above two options
/// </summary>
int TimeLength { get; }
/// <summary>
/// Gets the file extension for the current <see cref="IMovie"/> implementation
/// </summary>