Start ToBk2() conversion method for BkmMovie
This commit is contained in:
parent
6c2ba47522
commit
5cda104ea5
|
@ -151,6 +151,7 @@
|
|||
<Compile Include="movie\bkm\BkmMovie.InputLog.cs" />
|
||||
<Compile Include="movie\bkm\BkmMovie.IO.cs" />
|
||||
<Compile Include="movie\bkm\BkmMovie.ModeApi.cs" />
|
||||
<Compile Include="movie\conversions\MovieConversionExtensions.cs" />
|
||||
<Compile Include="movie\HeaderKeys.cs" />
|
||||
<Compile Include="movie\InputAdapters.cs" />
|
||||
<Compile Include="movie\interfaces\ILogEntryGenerator.cs" />
|
||||
|
|
|
@ -6,6 +6,7 @@ using System.Reflection;
|
|||
using System.Text;
|
||||
|
||||
using BizHawk.Common;
|
||||
using BizHawk.Client.Common.MovieConversionExtensions;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
|
@ -26,7 +27,17 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
else
|
||||
{
|
||||
return new BkmMovie(path);
|
||||
var movie = new BkmMovie(path);
|
||||
|
||||
if (VersionInfo.DeveloperBuild)
|
||||
{
|
||||
movie.Load();
|
||||
return movie.ToBk2();
|
||||
}
|
||||
else
|
||||
{
|
||||
return movie;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,8 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public string Filename { get; set; }
|
||||
|
||||
public virtual string PreferredExtension { get { return "bk2"; } }
|
||||
public virtual string PreferredExtension { get { return Extension; } }
|
||||
public const string Extension = "bk2";
|
||||
|
||||
public bool Changes { get; private set; }
|
||||
public bool IsCountingRerecords { get; set; }
|
||||
|
|
|
@ -37,7 +37,9 @@ namespace BizHawk.Client.Common
|
|||
return new BkmLogEntryGenerator();
|
||||
}
|
||||
|
||||
public string PreferredExtension { get { return "bkm"; } }
|
||||
public string PreferredExtension { get { return Extension; } }
|
||||
public const string Extension = "bkm";
|
||||
|
||||
public BkmHeader Header { get; private set; }
|
||||
public string Filename { get; set; }
|
||||
public bool IsCountingRerecords { get; set; }
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BizHawk.Client.Common.MovieConversionExtensions
|
||||
{
|
||||
public static class MovieConversionExtensions
|
||||
{
|
||||
public static Bk2Movie ToBk2(this BkmMovie bkm)
|
||||
{
|
||||
var newFilename = bkm.Filename + "." + Bk2Movie.Extension;
|
||||
var bk2 = new Bk2Movie(bkm.Filename);
|
||||
bk2.HeaderEntries.Clear();
|
||||
foreach(var kvp in bkm.HeaderEntries)
|
||||
{
|
||||
bk2.HeaderEntries[kvp.Key] = kvp.Value;
|
||||
}
|
||||
|
||||
bk2.SyncSettingsJson = bkm.SyncSettingsJson;
|
||||
|
||||
bk2.Comments.Clear();
|
||||
foreach(var comment in bkm.Comments)
|
||||
{
|
||||
bk2.Comments.Add(comment);
|
||||
}
|
||||
|
||||
bk2.Subtitles.Clear();
|
||||
foreach(var sub in bkm.Subtitles)
|
||||
{
|
||||
bk2.Subtitles.Add(sub);
|
||||
}
|
||||
|
||||
// TODO: savestate
|
||||
// TODO: input log
|
||||
|
||||
return bk2;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,7 +31,7 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
public const string Extension = "tasproj";
|
||||
public new const string Extension = "tasproj";
|
||||
|
||||
public MovieRecord this[int index]
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue