some more movie cleanup - moving properties from Movie to MovieHeader since they are more appropriate there
This commit is contained in:
parent
e686e595b9
commit
2d51026883
|
@ -10,7 +10,9 @@ namespace BizHawk.Client.Common
|
|||
|
||||
ulong Rerecords { get; set; }
|
||||
bool StartsFromSavestate { get; set; }
|
||||
|
||||
string GameName { get; set; }
|
||||
string SystemID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Receives a line and attempts to add as a header
|
||||
/// </summary>
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace BizHawk.Client.Common
|
|||
#endregion
|
||||
|
||||
#region Properties
|
||||
|
||||
public IMovieHeader Header { get; private set; }
|
||||
|
||||
public bool MakeBackup { get; set; }
|
||||
|
@ -51,16 +52,6 @@ namespace BizHawk.Client.Common
|
|||
set { Header.Rerecords = value; }
|
||||
}
|
||||
|
||||
public string SysID
|
||||
{
|
||||
get { return Header[HeaderKeys.PLATFORM]; }
|
||||
}
|
||||
|
||||
public string GameName
|
||||
{
|
||||
get { return Header[HeaderKeys.GAMENAME]; }
|
||||
}
|
||||
|
||||
public int InputLogLength
|
||||
{
|
||||
get { return Loaded ? _log.Length : _preloadFramecount; }
|
||||
|
@ -86,23 +77,6 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
public bool StateCapturing
|
||||
{
|
||||
get
|
||||
{
|
||||
return _statecapturing;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
_statecapturing = value;
|
||||
if (value == false)
|
||||
{
|
||||
_log.ClearStates();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mode API
|
||||
|
@ -760,7 +734,6 @@ namespace BizHawk.Client.Common
|
|||
private readonly MovieLog _log = new MovieLog();
|
||||
private enum Moviemode { Inactive, Play, Record, Finished };
|
||||
private Moviemode _mode = Moviemode.Inactive;
|
||||
private bool _statecapturing;
|
||||
private int _preloadFramecount; // Not a a reliable number, used for preloading (when no log has yet been loaded), this is only for quick stat compilation for dialogs such as play movie
|
||||
private bool _changes;
|
||||
private int? _loopOffset;
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace BizHawk.Client.Common
|
|||
|
||||
this[HeaderKeys.EMULATIONVERSION] = VersionInfo.GetEmuVersion();
|
||||
this[HeaderKeys.MOVIEVERSION] = HeaderKeys.MovieVersion;
|
||||
this[HeaderKeys.PLATFORM] = String.Empty;
|
||||
this[HeaderKeys.PLATFORM] = Global.Emulator.SystemId;
|
||||
this[HeaderKeys.GAMENAME] = String.Empty;
|
||||
this[HeaderKeys.AUTHOR] = String.Empty;
|
||||
this[HeaderKeys.RERECORDS] = "0";
|
||||
|
@ -130,6 +130,46 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
public string GameName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ContainsKey(HeaderKeys.GAMENAME))
|
||||
{
|
||||
return this[HeaderKeys.GAMENAME];
|
||||
}
|
||||
else
|
||||
{
|
||||
return String.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this[HeaderKeys.GAMENAME] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string SystemID
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ContainsKey(HeaderKeys.PLATFORM))
|
||||
{
|
||||
return this[HeaderKeys.PLATFORM];
|
||||
}
|
||||
else
|
||||
{
|
||||
return String.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
this[HeaderKeys.PLATFORM] = value;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ParseLineFromFile(string line)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(line))
|
||||
|
|
|
@ -35,11 +35,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
if (column == 1) //System
|
||||
{
|
||||
text = _movieList[index].SysID;
|
||||
text = _movieList[index].Header.SystemID;
|
||||
}
|
||||
if (column == 2) //Game
|
||||
{
|
||||
text = _movieList[index].GameName;
|
||||
text = _movieList[index].Header.GameName;
|
||||
}
|
||||
if (column == 3) //Time
|
||||
{
|
||||
|
@ -206,7 +206,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
//Pull out matching names
|
||||
for (int i = 0; i < _movieList.Count; i++)
|
||||
{
|
||||
if (PathManager.FilesystemSafeName(Global.Game) == _movieList[i].GameName)
|
||||
if (PathManager.FilesystemSafeName(Global.Game) == _movieList[i].Header.GameName)
|
||||
{
|
||||
Indices.Add(i);
|
||||
}
|
||||
|
@ -446,8 +446,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
_movieList = _movieList
|
||||
.OrderByDescending(x => Path.GetFileName(x.Filename))
|
||||
.ThenBy(x => x.SysID)
|
||||
.ThenBy(x => x.GameName)
|
||||
.ThenBy(x => x.Header.SystemID)
|
||||
.ThenBy(x => x.Header.GameName)
|
||||
.ThenBy(x => x.FrameCount)
|
||||
.ToList();
|
||||
}
|
||||
|
@ -455,8 +455,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
_movieList = _movieList
|
||||
.OrderBy(x => Path.GetFileName(x.Filename))
|
||||
.ThenBy(x => x.SysID)
|
||||
.ThenBy(x => x.GameName)
|
||||
.ThenBy(x => x.Header.SystemID)
|
||||
.ThenBy(x => x.Header.GameName)
|
||||
.ThenBy(x => x.FrameCount)
|
||||
.ToList();
|
||||
}
|
||||
|
@ -465,18 +465,18 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (_sortReverse)
|
||||
{
|
||||
_movieList = _movieList
|
||||
.OrderByDescending(x => x.SysID)
|
||||
.OrderByDescending(x => x.Header.SystemID)
|
||||
.ThenBy(x => Path.GetFileName(x.Filename))
|
||||
.ThenBy(x => x.GameName)
|
||||
.ThenBy(x => x.Header.GameName)
|
||||
.ThenBy(x => x.FrameCount)
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
_movieList = _movieList
|
||||
.OrderBy(x => x.SysID)
|
||||
.OrderBy(x => x.Header.SystemID)
|
||||
.ThenBy(x => Path.GetFileName(x.Filename))
|
||||
.ThenBy(x => x.GameName)
|
||||
.ThenBy(x => x.Header.GameName)
|
||||
.ThenBy(x => x.FrameCount)
|
||||
.ToList();
|
||||
}
|
||||
|
@ -485,18 +485,18 @@ namespace BizHawk.Client.EmuHawk
|
|||
if (_sortReverse)
|
||||
{
|
||||
_movieList = _movieList
|
||||
.OrderByDescending(x => x.GameName)
|
||||
.OrderByDescending(x => x.Header.GameName)
|
||||
.ThenBy(x => Path.GetFileName(x.Filename))
|
||||
.ThenBy(x => x.SysID)
|
||||
.ThenBy(x => x.Header.SystemID)
|
||||
.ThenBy(x => x.FrameCount)
|
||||
.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
_movieList = _movieList
|
||||
.OrderBy(x => x.GameName)
|
||||
.OrderBy(x => x.Header.GameName)
|
||||
.ThenBy(x => Path.GetFileName(x.Filename))
|
||||
.ThenBy(x => x.SysID)
|
||||
.ThenBy(x => x.Header.SystemID)
|
||||
.ThenBy(x => x.FrameCount)
|
||||
.ToList();
|
||||
}
|
||||
|
@ -507,7 +507,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
_movieList = _movieList
|
||||
.OrderByDescending(x => x.FrameCount)
|
||||
.ThenBy(x => Path.GetFileName(x.Filename))
|
||||
.ThenBy(x => x.SysID)
|
||||
.ThenBy(x => x.Header.SystemID)
|
||||
.ThenBy(x => x.FrameCount)
|
||||
.ToList();
|
||||
}
|
||||
|
@ -516,8 +516,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
_movieList = _movieList
|
||||
.OrderBy(x => x.FrameCount)
|
||||
.ThenBy(x => Path.GetFileName(x.Filename))
|
||||
.ThenBy(x => x.SysID)
|
||||
.ThenBy(x => x.GameName)
|
||||
.ThenBy(x => x.Header.SystemID)
|
||||
.ThenBy(x => x.Header.GameName)
|
||||
.ToList();
|
||||
}
|
||||
break;
|
||||
|
@ -567,8 +567,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
copyStr
|
||||
.Append(_movieList[index].Filename).Append('\t')
|
||||
.Append(_movieList[index].SysID).Append('\t')
|
||||
.Append(_movieList[index].GameName).Append('\t')
|
||||
.Append(_movieList[index].Header.SystemID).Append('\t')
|
||||
.Append(_movieList[index].Header.GameName).Append('\t')
|
||||
.Append(_movieList[index].GetTime(true)).AppendLine();
|
||||
|
||||
Clipboard.SetDataObject(copyStr.ToString());
|
||||
|
|
Loading…
Reference in New Issue