Multitrack overwrite works. Now to fix playback.
This commit is contained in:
parent
dbd932bb5a
commit
e9942dc101
|
@ -21,7 +21,6 @@ namespace BizHawk.MultiClient
|
|||
public static Controller TI83Controls;
|
||||
public static Controller NESControls;
|
||||
public static Controller ActiveController;
|
||||
public static Controller NullControls;
|
||||
public static MultitrackRecording MultiTrack;
|
||||
public static Controller NullControls;
|
||||
}
|
||||
}
|
|
@ -276,9 +276,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void SetControllersAsMnemonic(string mnemonic)
|
||||
{
|
||||
MovieMode = true;
|
||||
if (mnemonic == "")
|
||||
return;
|
||||
MovieMode = true;
|
||||
programmaticallyPressedButtons.Clear();
|
||||
|
||||
if (type.Name == "SMS Controller")
|
||||
|
@ -303,7 +301,7 @@ namespace BizHawk.MultiClient
|
|||
|
||||
if (type.Name == "PC Engine Controller")
|
||||
{
|
||||
if (!Global.MultiTrack.isActive || (Global.MainForm.UserMovie.GetMovieMode() == MOVIEMODE.PLAY))
|
||||
if (!Global.MainForm.UserMovie.MultiTrack.isActive || (Global.MainForm.UserMovie.GetMovieMode() == MOVIEMODE.PLAY))
|
||||
{
|
||||
for (int i = 1; i < 6; i++)
|
||||
{
|
||||
|
@ -319,10 +317,11 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
Console.WriteLine(mnemonic);
|
||||
for (int i = 1; i < 6; i++)
|
||||
{
|
||||
if ((Global.MultiTrack.CurrentPlayer == i) || Global.MultiTrack.RecordAll)
|
||||
if ((Global.MainForm.UserMovie.MultiTrack.CurrentPlayer == i) || Global.MainForm.UserMovie.MultiTrack.RecordAll)
|
||||
{
|
||||
if (IsPressedActually("P1 Up")) programmaticallyPressedButtons.Add("P" + i + " Up");
|
||||
if (IsPressedActually("P1 Down")) programmaticallyPressedButtons.Add("P" + i + " Down");
|
||||
|
@ -335,15 +334,17 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mnemonic.Length < (1 + i * 9)) return;
|
||||
if (mnemonic[(i - 1) * 9 + 3] != '.') programmaticallyPressedButtons.Add("P" + i + " Up");
|
||||
if (mnemonic[(i - 1) * 9 + 4] != '.') programmaticallyPressedButtons.Add("P" + i + " Down");
|
||||
if (mnemonic[(i - 1) * 9 + 5] != '.') programmaticallyPressedButtons.Add("P" + i + " Left");
|
||||
if (mnemonic[(i - 1) * 9 + 6] != '.') programmaticallyPressedButtons.Add("P" + i + " Right");
|
||||
if (mnemonic[(i - 1) * 9 + 7] != '.') programmaticallyPressedButtons.Add("P" + i + " B1");
|
||||
if (mnemonic[(i - 1) * 9 + 8] != '.') programmaticallyPressedButtons.Add("P" + i + " B2");
|
||||
if (mnemonic[(i - 1) * 9 + 9] != '.') programmaticallyPressedButtons.Add("P" + i + " Run");
|
||||
if (mnemonic[(i - 1) * 9 + 10] != '.') programmaticallyPressedButtons.Add("P" + i + " Select");
|
||||
if (mnemonic.Length >= (1 + i * 9))
|
||||
{
|
||||
if (mnemonic[(i - 1) * 9 + 3] != '.') programmaticallyPressedButtons.Add("P" + i + " Up");
|
||||
if (mnemonic[(i - 1) * 9 + 4] != '.') programmaticallyPressedButtons.Add("P" + i + " Down");
|
||||
if (mnemonic[(i - 1) * 9 + 5] != '.') programmaticallyPressedButtons.Add("P" + i + " Left");
|
||||
if (mnemonic[(i - 1) * 9 + 6] != '.') programmaticallyPressedButtons.Add("P" + i + " Right");
|
||||
if (mnemonic[(i - 1) * 9 + 7] != '.') programmaticallyPressedButtons.Add("P" + i + " B1");
|
||||
if (mnemonic[(i - 1) * 9 + 8] != '.') programmaticallyPressedButtons.Add("P" + i + " B2");
|
||||
if (mnemonic[(i - 1) * 9 + 9] != '.') programmaticallyPressedButtons.Add("P" + i + " Run");
|
||||
if (mnemonic[(i - 1) * 9 + 10] != '.') programmaticallyPressedButtons.Add("P" + i + " Select");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1129,42 +1129,53 @@ namespace BizHawk.MultiClient
|
|||
}
|
||||
if (Global.ClientControls["Toggle MultiTrack"])
|
||||
{
|
||||
Global.MultiTrack.isActive = !Global.MultiTrack.isActive;
|
||||
Global.MultiTrack.RecordAll = false;
|
||||
Global.MultiTrack.CurrentPlayer = 0;
|
||||
Global.MainForm.UserMovie.MultiTrack.isActive = !Global.MainForm.UserMovie.MultiTrack.isActive;
|
||||
if (Global.MainForm.UserMovie.MultiTrack.isActive)
|
||||
{
|
||||
Global.RenderPanel.AddMessage("MultiTrack Enabled");
|
||||
Global.RenderPanel.MT = "Recording None";
|
||||
}
|
||||
else
|
||||
Global.RenderPanel.AddMessage("MultiTrack Disabled");
|
||||
Global.MainForm.UserMovie.MultiTrack.RecordAll = false;
|
||||
Global.MainForm.UserMovie.MultiTrack.CurrentPlayer = 0;
|
||||
Global.ClientControls.UnpressButton("Toggle MultiTrack");
|
||||
}
|
||||
if (Global.ClientControls["Increment Player"])
|
||||
{
|
||||
Global.MultiTrack.CurrentPlayer++;
|
||||
Global.MultiTrack.RecordAll = false;
|
||||
if (Global.MultiTrack.CurrentPlayer > 5) //TODO: Replace with console's maximum or current maximum players??!
|
||||
Global.MainForm.UserMovie.MultiTrack.CurrentPlayer++;
|
||||
Global.MainForm.UserMovie.MultiTrack.RecordAll = false;
|
||||
if (Global.MainForm.UserMovie.MultiTrack.CurrentPlayer > 5) //TODO: Replace with console's maximum or current maximum players??!
|
||||
{
|
||||
Global.MultiTrack.CurrentPlayer = 1;
|
||||
Global.MainForm.UserMovie.MultiTrack.CurrentPlayer = 1;
|
||||
}
|
||||
Global.ClientControls.UnpressButton("Decrement Player");
|
||||
Global.ClientControls.UnpressButton("Increment Player");
|
||||
Global.RenderPanel.MT = "Recording Player " + Global.MainForm.UserMovie.MultiTrack.CurrentPlayer.ToString();
|
||||
}
|
||||
if (Global.ClientControls["Decrement Player"])
|
||||
{
|
||||
Global.MultiTrack.CurrentPlayer--;
|
||||
Global.MultiTrack.RecordAll = false;
|
||||
if (Global.MultiTrack.CurrentPlayer < 1)
|
||||
Global.MainForm.UserMovie.MultiTrack.CurrentPlayer--;
|
||||
Global.MainForm.UserMovie.MultiTrack.RecordAll = false;
|
||||
if (Global.MainForm.UserMovie.MultiTrack.CurrentPlayer < 1)
|
||||
{
|
||||
Global.MultiTrack.CurrentPlayer = 5;//TODO: Replace with console's maximum or current maximum players??!
|
||||
Global.MainForm.UserMovie.MultiTrack.CurrentPlayer = 5;//TODO: Replace with console's maximum or current maximum players??!
|
||||
}
|
||||
Global.ClientControls.UnpressButton("Decrement Player");
|
||||
Global.RenderPanel.MT = "Recording Player " + Global.MainForm.UserMovie.MultiTrack.CurrentPlayer.ToString();
|
||||
}
|
||||
if (Global.ClientControls["Record All"])
|
||||
{
|
||||
Global.MultiTrack.CurrentPlayer = 0;
|
||||
Global.MultiTrack.RecordAll = true;
|
||||
Global.MainForm.UserMovie.MultiTrack.CurrentPlayer = 0;
|
||||
Global.MainForm.UserMovie.MultiTrack.RecordAll = true;
|
||||
Global.ClientControls.UnpressButton("Record All");
|
||||
Global.RenderPanel.MT = "Recording All";
|
||||
}
|
||||
if (Global.ClientControls["Record None"])
|
||||
{
|
||||
Global.MultiTrack.CurrentPlayer = 0;
|
||||
Global.MultiTrack.RecordAll = false;
|
||||
Global.MainForm.UserMovie.MultiTrack.CurrentPlayer = 0;
|
||||
Global.MainForm.UserMovie.MultiTrack.RecordAll = false;
|
||||
Global.ClientControls.UnpressButton("Record None");
|
||||
Global.RenderPanel.MT = "Recording None";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1295,7 +1306,7 @@ namespace BizHawk.MultiClient
|
|||
Global.ActiveController.SetControllersAsMnemonic(UserMovie.GetInputFrame(Global.Emulator.Frame) + 1);
|
||||
}
|
||||
}
|
||||
if (UserMovie.GetMovieMode() == MOVIEMODE.RECORD && Global.MultiTrack.isActive)
|
||||
if (UserMovie.GetMovieMode() == MOVIEMODE.RECORD && Global.MainForm.UserMovie.MultiTrack.isActive)
|
||||
{
|
||||
Global.ActiveController.SetControllersAsMnemonic(UserMovie.GetInputFrame(Global.Emulator.Frame) + 1);
|
||||
}
|
||||
|
|
|
@ -110,6 +110,7 @@ namespace BizHawk.MultiClient
|
|||
bool Resized { get; set; }
|
||||
void AddMessage(string msg);
|
||||
string FPS { get; set; }
|
||||
string MT { get; set; }
|
||||
}
|
||||
|
||||
public class SysdrawingRenderPanel : IRenderer
|
||||
|
@ -117,6 +118,7 @@ namespace BizHawk.MultiClient
|
|||
public bool Resized { get; set; }
|
||||
public void Dispose() { }
|
||||
public string FPS { get; set; }
|
||||
public string MT { get; set; }
|
||||
public void Render(IVideoProvider video)
|
||||
{
|
||||
Color BackgroundColor = Color.FromArgb(video.BackgroundColor);
|
||||
|
@ -146,7 +148,7 @@ namespace BizHawk.MultiClient
|
|||
public Color BackgroundColor { get; set; }
|
||||
public bool Resized { get; set; }
|
||||
public string FPS { get; set; }
|
||||
|
||||
public string MT { get; set; }
|
||||
private Direct3D d3d;
|
||||
private Device Device;
|
||||
private Control backingControl;
|
||||
|
@ -281,7 +283,13 @@ namespace BizHawk.MultiClient
|
|||
input = MakeInputDisplay();
|
||||
MessageFont.DrawString(null, input, Global.Config.DispInpx, Global.Config.DispInpy, c);
|
||||
}
|
||||
|
||||
if (Global.MainForm.UserMovie.MultiTrack.isActive)
|
||||
{
|
||||
MessageFont.DrawString(null, MT, Global.Config.DispFPSx + 1,
|
||||
Global.Config.DispFPSy + 1, new Color4(Color.Black));
|
||||
MessageFont.DrawString(null, MT, Global.Config.DispFPSx,
|
||||
Global.Config.DispFPSy, Color.FromArgb(Global.Config.MessagesColor));
|
||||
}
|
||||
if (Global.Config.DisplayFPS)
|
||||
{
|
||||
MessageFont.DrawString(null, FPS, Global.Config.DispFPSx + 1,
|
||||
|
|
|
@ -11,12 +11,13 @@ namespace BizHawk.MultiClient
|
|||
{
|
||||
private MovieHeader Header = new MovieHeader();
|
||||
private MovieLog Log = new MovieLog();
|
||||
|
||||
|
||||
private bool IsText = true;
|
||||
private string Filename;
|
||||
|
||||
private MOVIEMODE MovieMode = new MOVIEMODE();
|
||||
|
||||
public MultitrackRecording MultiTrack = new MultitrackRecording();
|
||||
public int Frames = 0;
|
||||
public int lastLog;
|
||||
public int rerecordCount;
|
||||
|
@ -83,18 +84,30 @@ namespace BizHawk.MultiClient
|
|||
|
||||
public void GetMnemonic()
|
||||
{
|
||||
if (MovieMode == MOVIEMODE.RECORD)
|
||||
{
|
||||
//DON'T TRUNCATE! MESSES WITH MULTITRACK!
|
||||
if (Global.Emulator.Frame < Log.Length())
|
||||
{
|
||||
Log.Truncate(Global.Emulator.Frame);
|
||||
}
|
||||
// if (Global.MainForm.TAStudio1.Engaged)
|
||||
// Log.AddFrame(Global.MainForm.TAStudio1.GetMnemonic());
|
||||
// else
|
||||
Log.AddFrame(Global.ActiveController.GetControllersAsMnemonic());
|
||||
}
|
||||
if (Global.MainForm.UserMovie.MultiTrack.isActive)
|
||||
{
|
||||
if (MovieMode == MOVIEMODE.RECORD)
|
||||
{
|
||||
|
||||
if (Global.Emulator.Frame < Log.Length())
|
||||
Log.AddFrameAt(Global.ActiveController.GetControllersAsMnemonic(),Global.Emulator.Frame-1);
|
||||
else
|
||||
Log.AddFrame(Global.ActiveController.GetControllersAsMnemonic());
|
||||
}
|
||||
}
|
||||
else
|
||||
if (MovieMode == MOVIEMODE.RECORD)
|
||||
{
|
||||
|
||||
if (Global.Emulator.Frame < Log.Length())
|
||||
{
|
||||
Log.Truncate(Global.Emulator.Frame);
|
||||
}
|
||||
// if (Global.MainForm.TAStudio1.Engaged)
|
||||
// Log.AddFrame(Global.MainForm.TAStudio1.GetMnemonic());
|
||||
// else
|
||||
Log.AddFrame(Global.ActiveController.GetControllersAsMnemonic());
|
||||
}
|
||||
}
|
||||
|
||||
public string GetInputFrame(int frame)
|
||||
|
|
|
@ -10,5 +10,11 @@ namespace BizHawk.MultiClient
|
|||
public bool isActive;
|
||||
public int CurrentPlayer;
|
||||
public bool RecordAll;
|
||||
}
|
||||
public MultitrackRecording()
|
||||
{
|
||||
isActive = false;
|
||||
CurrentPlayer = 0;
|
||||
RecordAll = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue