More use of IMovie and less use of Movie

This commit is contained in:
adelikat 2013-12-04 15:17:02 +00:00
parent d9c1a5bfe8
commit 165f8563a7
5 changed files with 26 additions and 6 deletions

View File

@ -23,8 +23,20 @@ namespace BizHawk.Client.Common
#region Properties
/// <summary>
/// The total number of frames that count towards the completion time of the movie
/// Possibly (but unlikely different from InputLogLength (could be infinity, or maybe an implementation automatically discounts empty frames at the end of a movie, etc)
/// </summary>
double FrameCount { get; }
/// <summary>
/// The Fps used to calculate the time of the movie
/// </summary>
double Fps { get; }
/// <summary>
/// The time calculation based on FrameCount and Fps
/// </summary>
TimeSpan Time { get; }
/// <summary>

View File

@ -184,6 +184,14 @@ namespace BizHawk.Client.Common
// TODO:
public double Fps
{
get
{
throw new NotImplementedException();
}
}
public void StartNewRecording()
{
SwitchToRecord();

View File

@ -2136,8 +2136,8 @@ namespace BizHawk.Client.EmuHawk
string errorMsg;
string warningMsg;
Movie movie = MovieImport.ImportFile(filePaths[0], out errorMsg, out warningMsg);
if (errorMsg.Length > 0)
var movie = MovieImport.ImportFile(filePaths[0], out errorMsg, out warningMsg);
if (!String.IsNullOrEmpty(errorMsg))
{
MessageBox.Show(errorMsg, "Conversion error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}

View File

@ -12,7 +12,7 @@ namespace BizHawk.Client.EmuHawk
{
partial class MainForm
{
public void StartNewMovie(Movie m, bool record)
public void StartNewMovie(IMovie movie, bool record)
{
//If a movie is already loaded, save it before starting a new movie
if (Global.MovieSession.Movie.IsActive)
@ -22,7 +22,7 @@ namespace BizHawk.Client.EmuHawk
Global.MovieSession = new MovieSession
{
Movie = m,
Movie = movie,
MessageCallback = GlobalWin.OSD.AddMessage,
AskYesNoCallback = StateErrorAskUser
};
@ -37,7 +37,7 @@ namespace BizHawk.Client.EmuHawk
LoadRom(GlobalWin.MainForm.CurrentlyOpenRom, true, !record);
Global.Config.RecentMovies.Add(m.Filename);
Global.Config.RecentMovies.Add(movie.Filename);
if (Global.MovieSession.Movie.Header.StartsFromSavestate)
{
LoadStateFile(Global.MovieSession.Movie.Filename, Path.GetFileName(Global.MovieSession.Movie.Filename));

View File

@ -13,7 +13,7 @@ namespace BizHawk.Client.EmuHawk
{
public partial class PlayMovie : Form
{
private List<Movie> _movieList = new List<Movie>();
private List<IMovie> _movieList = new List<IMovie>();
private bool _sortReverse;
private string _sortedCol;