Write subtitles to movie files

This commit is contained in:
andres.delikat 2011-07-04 00:49:37 +00:00
parent 945cb9c693
commit f886b65015
2 changed files with 24 additions and 0 deletions

View File

@ -191,6 +191,11 @@ namespace BizHawk.MultiClient
sw.WriteLine(kvp.Key + " " + kvp.Value);
}
for (int x = 0; x < Subtitles.Count(); x++)
{
sw.WriteLine(Subtitles.GetSubtitleText(x));
}
for (int x = 0; x < length; x++)
{
sw.WriteLine(Log.GetFrame(x));

View File

@ -33,6 +33,25 @@ namespace BizHawk.MultiClient
return subs[index];
}
public string GetSubtitleText(int index)
{
if (index >= subs.Count || index < 0) return "";
StringBuilder sb = new StringBuilder("subtitle ");
sb.Append(subs[index].Frame.ToString());
sb.Append(" ");
sb.Append(subs[index].X.ToString());
sb.Append(" ");
sb.Append(subs[index].Y.ToString());
sb.Append(" ");
sb.Append(subs[index].Duration.ToString());
sb.Append(" ");
sb.Append(subs[index].Color.ToString());
sb.Append(" ");
sb.Append(subs[index].Message);
return sb.ToString();
}
/// <summary>
/// Manages the logic of what subtitle should be displayed on any given frame based on frame & duration
/// </summary>