Make InputLog log to the Movie folder, clean up some logic regarding InputLog

This commit is contained in:
andres.delikat 2011-05-22 12:40:11 +00:00
parent 848af8c664
commit 433ea55f18
1 changed files with 18 additions and 4 deletions

View File

@ -22,8 +22,8 @@ namespace BizHawk.MultiClient
private RetainedViewportPanel retainedPanel;
public string CurrentlyOpenRom;
//TODO: adelikat: can this be the official file extension?
public Movie InputLog = new Movie("log.tas", MOVIEMODE.RECORD); //This movie is always recording while user is playing
//Movie variables
public Movie InputLog = new Movie("", MOVIEMODE.INACTIVE);
public Movie UserMovie = new Movie("", MOVIEMODE.INACTIVE);
public bool ReadOnly = true; //Global Movie Read only setting
@ -138,7 +138,7 @@ namespace BizHawk.MultiClient
Movie m = new Movie(cmdMovie, MOVIEMODE.PLAY);
ReadOnly = true;
StartNewMovie(m, false);
InputLog.StopMovie();
CreateNewInputLog(false);
UserMovie.StartPlayback();
Global.Config.RecentMovies.Add(cmdMovie);
}
@ -147,8 +147,12 @@ namespace BizHawk.MultiClient
Movie m = new Movie(Global.Config.RecentMovies.GetRecentFileByPosition(0), MOVIEMODE.PLAY);
ReadOnly = true;
StartNewMovie(m, false);
InputLog.StopMovie();
UserMovie.StartPlayback();
CreateNewInputLog(false);
}
else
{
CreateNewInputLog(true);
}
if (cmdLoadState != null && Global.Game != null)
@ -178,6 +182,16 @@ namespace BizHawk.MultiClient
PauseEmulator();
}
void CreateNewInputLog(bool active)
{
MOVIEMODE m;
if (active)
m = MOVIEMODE.RECORD;
else
m = MOVIEMODE.INACTIVE;
InputLog = new Movie(Global.Config.MoviesPath + "\\log.tas", m);
}
void SyncPresentationMode()
{
bool gdi = Global.Config.ForceGDI;