diff --git a/BizHawk.MultiClient/movie/Movie.cs b/BizHawk.MultiClient/movie/Movie.cs index c6a8d4542c..637d81d8aa 100644 --- a/BizHawk.MultiClient/movie/Movie.cs +++ b/BizHawk.MultiClient/movie/Movie.cs @@ -36,6 +36,7 @@ namespace BizHawk.MultiClient { MovieMode = MOVIEMODE.RECORD; Log.Clear(); + Header = new MovieHeader("v1.0.0", MovieHeader.MovieVersion, Global.Emulator.SystemId, Global.Game.Name); } public void StartPlayback() @@ -67,8 +68,6 @@ namespace BizHawk.MultiClient //Movie editing tools may like to have something like this public void AddMovieRecord(string record) { - //TODO: validate input - //Format into string acceptable by MovieLog Log.AddFrame(record); } @@ -156,11 +155,11 @@ namespace BizHawk.MultiClient } else if (str[0] == '|') { - Log.AddFrame(str); //TODO: validate proper formatting + Log.AddFrame(str); } else { - //TODO: Something has gone wrong here! + Header.Comments.Add(str); } } diff --git a/BizHawk.MultiClient/movie/MovieHeader.cs b/BizHawk.MultiClient/movie/MovieHeader.cs index bd7d80cb9f..663b1b2e2d 100644 --- a/BizHawk.MultiClient/movie/MovieHeader.cs +++ b/BizHawk.MultiClient/movie/MovieHeader.cs @@ -15,12 +15,15 @@ namespace BizHawk.MultiClient //TODO: GUID, checksum of game, other stuff Dictionary HeaderParams = new Dictionary(); //Platform specific options go here - + public List Comments = new List(); + public const string EMULATIONVERSION = "EmulationVersion"; public const string MOVIEVERSION = "MovieVersion"; public const string PLATFORM = "Platform"; public const string GAMENAME = "GameName"; + public static string MovieVersion = "v0.0.1"; + public MovieHeader() //All required fields will be set to default values { HeaderParams.Add(EMULATIONVERSION, "v1.0.0"); diff --git a/BizHawk.MultiClient/movie/MovieLog.cs b/BizHawk.MultiClient/movie/MovieLog.cs index d4cfe75c0e..e3cff4fc8f 100644 --- a/BizHawk.MultiClient/movie/MovieLog.cs +++ b/BizHawk.MultiClient/movie/MovieLog.cs @@ -10,6 +10,8 @@ namespace BizHawk.MultiClient /// class MovieLog { + //TODO: Insert(int frame) not useful for convenctional tasing but TAStudio will want it + List MovieRecords = new List(); public MovieLog() @@ -29,13 +31,23 @@ namespace BizHawk.MultiClient public void AddFrame(string frame) { - MovieRecords.Add(frame); //Validate the format? Or shoudl the Movie class be resonible for formatting? + MovieRecords.Add(frame); + } + + public void Truncate(int frame) + { + //TODO } public string GetFrame(int frameCount) //Frame count is 0 based here, should it be? { if (frameCount >= 0) - return MovieRecords[frameCount]; + { + if (frameCount < MovieRecords.Count) + return MovieRecords[frameCount]; + else + return ""; + } else return ""; //TODO: throw an exception? }