Movie MovieSession to Client.Common

This commit is contained in:
adelikat 2013-10-24 22:26:28 +00:00
parent 11d2997db7
commit 80f0c75a41
17 changed files with 957 additions and 956 deletions

View File

@ -57,6 +57,7 @@
<Compile Include="movie\MovieHeader.cs" /> <Compile Include="movie\MovieHeader.cs" />
<Compile Include="movie\MovieLog.cs" /> <Compile Include="movie\MovieLog.cs" />
<Compile Include="movie\MovieMnemonics.cs" /> <Compile Include="movie\MovieMnemonics.cs" />
<Compile Include="movie\MovieSession.cs" />
<Compile Include="movie\MultitrackRecording.cs" /> <Compile Include="movie\MultitrackRecording.cs" />
<Compile Include="movie\Subtitle.cs" /> <Compile Include="movie\Subtitle.cs" />
<Compile Include="movie\SubtitleList.cs" /> <Compile Include="movie\SubtitleList.cs" />

View File

@ -6,5 +6,13 @@
public static Config Config; public static Config Config;
public static GameInfo Game; public static GameInfo Game;
public static CheatList CheatList; public static CheatList CheatList;
//Movie
/// <summary>
/// the global MovieSession can use this to deal with multitrack player remapping (should this be here? maybe it should be in MovieSession)
/// </summary>
public static MultitrackRewiringControllerAdapter MultitrackRewiringControllerAdapter = new MultitrackRewiringControllerAdapter();
public static MovieSession MovieSession = new MovieSession();
} }
} }

View File

@ -1,6 +1,4 @@
using BizHawk.Client.Common; namespace BizHawk.Client.Common
namespace BizHawk.MultiClient
{ {
public class MovieSession public class MovieSession
{ {

View File

@ -363,7 +363,6 @@
<DependentUpon>EditSubtitlesForm.cs</DependentUpon> <DependentUpon>EditSubtitlesForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="movie\MovieImport.cs" /> <Compile Include="movie\MovieImport.cs" />
<Compile Include="movie\MovieSession.cs" />
<Compile Include="movie\PlayMovie.cs"> <Compile Include="movie\PlayMovie.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>

View File

@ -342,14 +342,14 @@ namespace BizHawk.MultiClient
private string MakeFrameCounter() private string MakeFrameCounter()
{ {
if (GlobalWinF.MovieSession.Movie.IsFinished) if (Global.MovieSession.Movie.IsFinished)
{ {
StringBuilder s = new StringBuilder(); StringBuilder s = new StringBuilder();
s.Append(Global.Emulator.Frame); s.Append(Global.Emulator.Frame);
s.Append('/'); s.Append('/');
if (GlobalWinF.MovieSession.Movie.Frames.HasValue) if (Global.MovieSession.Movie.Frames.HasValue)
{ {
s.Append(GlobalWinF.MovieSession.Movie.Frames); s.Append(Global.MovieSession.Movie.Frames);
} }
else else
{ {
@ -358,14 +358,14 @@ namespace BizHawk.MultiClient
s.Append(" (Finished)"); s.Append(" (Finished)");
return s.ToString(); return s.ToString();
} }
else if (GlobalWinF.MovieSession.Movie.IsPlaying) else if (Global.MovieSession.Movie.IsPlaying)
{ {
StringBuilder s = new StringBuilder(); StringBuilder s = new StringBuilder();
s.Append(Global.Emulator.Frame); s.Append(Global.Emulator.Frame);
s.Append('/'); s.Append('/');
if (GlobalWinF.MovieSession.Movie.Frames.HasValue) if (Global.MovieSession.Movie.Frames.HasValue)
{ {
s.Append(GlobalWinF.MovieSession.Movie.Frames); s.Append(Global.MovieSession.Movie.Frames);
} }
else else
{ {
@ -373,7 +373,7 @@ namespace BizHawk.MultiClient
} }
return s.ToString(); return s.ToString();
} }
else if (GlobalWinF.MovieSession.Movie.IsRecording) else if (Global.MovieSession.Movie.IsRecording)
{ {
return Global.Emulator.Frame.ToString(); return Global.Emulator.Frame.ToString();
} }
@ -483,13 +483,13 @@ namespace BizHawk.MultiClient
public string MakeInputDisplay() public string MakeInputDisplay()
{ {
StringBuilder s; StringBuilder s;
if (!GlobalWinF.MovieSession.Movie.IsActive || GlobalWinF.MovieSession.Movie.IsFinished) if (!Global.MovieSession.Movie.IsActive || Global.MovieSession.Movie.IsFinished)
{ {
s = new StringBuilder(GlobalWinF.GetOutputControllersAsMnemonic()); s = new StringBuilder(GlobalWinF.GetOutputControllersAsMnemonic());
} }
else else
{ {
s = new StringBuilder(GlobalWinF.MovieSession.Movie.GetInput(Global.Emulator.Frame - 1)); s = new StringBuilder(Global.MovieSession.Movie.GetInput(Global.Emulator.Frame - 1));
} }
s.Replace(".", " ").Replace("|", "").Replace(" 000, 000", " "); s.Replace(".", " ").Replace("|", "").Replace(" 000, 000", " ");
@ -499,9 +499,9 @@ namespace BizHawk.MultiClient
public string MakeRerecordCount() public string MakeRerecordCount()
{ {
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
return "Rerecord Count: " + GlobalWinF.MovieSession.Movie.Rerecords.ToString(); return "Rerecord Count: " + Global.MovieSession.Movie.Rerecords.ToString();
} }
else else
{ {
@ -528,7 +528,7 @@ namespace BizHawk.MultiClient
Color c; Color c;
float x = GetX(g, Global.Config.DispInpx, Global.Config.DispInpanchor, MessageFont, input); float x = GetX(g, Global.Config.DispInpx, Global.Config.DispInpanchor, MessageFont, input);
float y = GetY(g, Global.Config.DispInpy, Global.Config.DispInpanchor, MessageFont, input); float y = GetY(g, Global.Config.DispInpy, Global.Config.DispInpanchor, MessageFont, input);
if (GlobalWinF.MovieSession.Movie.IsPlaying && !GlobalWinF.MovieSession.Movie.IsRecording) if (Global.MovieSession.Movie.IsPlaying && !Global.MovieSession.Movie.IsRecording)
{ {
c = Color.FromArgb(Global.Config.MovieInput); c = Color.FromArgb(Global.Config.MovieInput);
} }
@ -540,7 +540,7 @@ namespace BizHawk.MultiClient
g.DrawString(input, MessageFont, Color.Black, x+1,y+1); g.DrawString(input, MessageFont, Color.Black, x+1,y+1);
g.DrawString(input, MessageFont, c, x,y); g.DrawString(input, MessageFont, c, x,y);
} }
if (GlobalWinF.MovieSession.MultiTrack.IsActive) if (Global.MovieSession.MultiTrack.IsActive)
{ {
float x = GetX(g, Global.Config.DispMultix, Global.Config.DispMultianchor, MessageFont, MT); float x = GetX(g, Global.Config.DispMultix, Global.Config.DispMultianchor, MessageFont, MT);
float y = GetY(g, Global.Config.DispMultiy, Global.Config.DispMultianchor, MessageFont, MT); float y = GetY(g, Global.Config.DispMultiy, Global.Config.DispMultianchor, MessageFont, MT);
@ -624,9 +624,9 @@ namespace BizHawk.MultiClient
// //g.DrawEllipse(new Pen(new SolidBrush(Color.Pink)), new Rectangle((int)g.ClipBounds.Width - 22, 2, 20, 20)); // //g.DrawEllipse(new Pen(new SolidBrush(Color.Pink)), new Rectangle((int)g.ClipBounds.Width - 22, 2, 20, 20));
//} //}
if (GlobalWinF.MovieSession.Movie.IsActive && Global.Config.DisplaySubtitles) if (Global.MovieSession.Movie.IsActive && Global.Config.DisplaySubtitles)
{ {
List<Subtitle> s = GlobalWinF.MovieSession.Movie.Subtitles.GetSubtitles(Global.Emulator.Frame); List<Subtitle> s = Global.MovieSession.Movie.Subtitles.GetSubtitles(Global.Emulator.Frame);
if (s == null) if (s == null)
{ {
return; return;

View File

@ -31,13 +31,6 @@ namespace BizHawk.MultiClient
public static CopyControllerAdapter MovieInputSourceAdapter = new CopyControllerAdapter(); public static CopyControllerAdapter MovieInputSourceAdapter = new CopyControllerAdapter();
public static CopyControllerAdapter MovieOutputHardpoint = new CopyControllerAdapter(); public static CopyControllerAdapter MovieOutputHardpoint = new CopyControllerAdapter();
/// <summary>
/// the global MovieSession can use this to deal with multitrack player remapping (should this be here? maybe it should be in MovieSession)
/// </summary>
public static MultitrackRewiringControllerAdapter MultitrackRewiringControllerAdapter = new MultitrackRewiringControllerAdapter();
public static MovieSession MovieSession = new MovieSession();
//dont take my word for it, since the final word is actually in RewireInputChain, but here is a guide... //dont take my word for it, since the final word is actually in RewireInputChain, but here is a guide...
//user -> Input -> ActiveController -> UDLR -> StickyXORPlayerInputAdapter -> TurboAdapter(TBD) -> Lua(?TBD?) -> .. //user -> Input -> ActiveController -> UDLR -> StickyXORPlayerInputAdapter -> TurboAdapter(TBD) -> Lua(?TBD?) -> ..
//.. -> MultitrackRewiringControllerAdapter -> MovieInputSourceAdapter -> (MovieSession) -> MovieOutputAdapter -> ControllerOutput(1) -> Game //.. -> MultitrackRewiringControllerAdapter -> MovieInputSourceAdapter -> (MovieSession) -> MovieOutputAdapter -> ControllerOutput(1) -> Game

View File

@ -858,9 +858,9 @@ namespace BizHawk.MultiClient
s.DisableFrame(); s.DisableFrame();
int index = -1; int index = -1;
Subtitle sub = new Subtitle(); Subtitle sub = new Subtitle();
for (int x = 0; x < GlobalWinF.MovieSession.Movie.Subtitles.Count; x++) for (int x = 0; x < Global.MovieSession.Movie.Subtitles.Count; x++)
{ {
sub = GlobalWinF.MovieSession.Movie.Subtitles[x]; sub = Global.MovieSession.Movie.Subtitles[x];
if (Global.Emulator.Frame == sub.Frame) if (Global.Emulator.Frame == sub.Frame)
{ {
index = x; index = x;
@ -876,8 +876,8 @@ namespace BizHawk.MultiClient
if (s.ShowDialog() == DialogResult.OK) if (s.ShowDialog() == DialogResult.OK)
{ {
if (index >= 0) if (index >= 0)
GlobalWinF.MovieSession.Movie.Subtitles.RemoveAt(index); Global.MovieSession.Movie.Subtitles.RemoveAt(index);
GlobalWinF.MovieSession.Movie.Subtitles.AddSubtitle(s.sub); Global.MovieSession.Movie.Subtitles.AddSubtitle(s.sub);
} }
} }
@ -943,7 +943,7 @@ namespace BizHawk.MultiClient
cmiLoadLastRom.Visible = false; cmiLoadLastRom.Visible = false;
toolStripSeparator_afterRomLoading.Visible = false; toolStripSeparator_afterRomLoading.Visible = false;
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
cmiRecordMovie.Visible = false; cmiRecordMovie.Visible = false;
cmiPlayMovie.Visible = false; cmiPlayMovie.Visible = false;
@ -1030,7 +1030,7 @@ namespace BizHawk.MultiClient
ShowMenuContextMenuSeparator.Visible = cmiShowMenu.Visible = false; ShowMenuContextMenuSeparator.Visible = cmiShowMenu.Visible = false;
} }
ContextMenuStopMovieNoSaving.Visible = GlobalWinF.MovieSession.Movie.IsActive && GlobalWinF.MovieSession.Movie.HasChanges; ContextMenuStopMovieNoSaving.Visible = Global.MovieSession.Movie.IsActive && Global.MovieSession.Movie.HasChanges;
} }
@ -1045,7 +1045,7 @@ namespace BizHawk.MultiClient
private void makeMovieBackupToolStripMenuItem_Click(object sender, EventArgs e) private void makeMovieBackupToolStripMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWinF.OSD.AddMessage("Backup movie saved."); GlobalWinF.OSD.AddMessage("Backup movie saved.");
GlobalWinF.MovieSession.Movie.WriteBackup(); Global.MovieSession.Movie.WriteBackup();
} }
private void automaticallyBackupMoviesToolStripMenuItem_Click(object sender, EventArgs e) private void automaticallyBackupMoviesToolStripMenuItem_Click(object sender, EventArgs e)
@ -1099,20 +1099,20 @@ namespace BizHawk.MultiClient
private void viewCommentsToolStripMenuItem_Click(object sender, EventArgs e) private void viewCommentsToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
EditCommentsForm c = new EditCommentsForm { ReadOnly = ReadOnly }; EditCommentsForm c = new EditCommentsForm { ReadOnly = ReadOnly };
c.GetMovie(GlobalWinF.MovieSession.Movie); c.GetMovie(Global.MovieSession.Movie);
c.ShowDialog(); c.ShowDialog();
} }
} }
private void viewSubtitlesToolStripMenuItem_Click(object sender, EventArgs e) private void viewSubtitlesToolStripMenuItem_Click(object sender, EventArgs e)
{ {
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
EditSubtitlesForm s = new EditSubtitlesForm { ReadOnly = ReadOnly }; EditSubtitlesForm s = new EditSubtitlesForm { ReadOnly = ReadOnly };
s.GetMovie(GlobalWinF.MovieSession.Movie); s.GetMovie(Global.MovieSession.Movie);
s.ShowDialog(); s.ShowDialog();
} }
} }
@ -1161,12 +1161,12 @@ namespace BizHawk.MultiClient
private void movieToolStripMenuItem_DropDownOpened(object sender, EventArgs e) private void movieToolStripMenuItem_DropDownOpened(object sender, EventArgs e)
{ {
fullMovieLoadstatesToolStripMenuItem.Enabled = !GlobalWinF.MovieSession.MultiTrack.IsActive; fullMovieLoadstatesToolStripMenuItem.Enabled = !Global.MovieSession.MultiTrack.IsActive;
stopMovieWithoutSavingToolStripMenuItem.Enabled = GlobalWinF.MovieSession.Movie.IsActive && GlobalWinF.MovieSession.Movie.HasChanges; stopMovieWithoutSavingToolStripMenuItem.Enabled = Global.MovieSession.Movie.IsActive && Global.MovieSession.Movie.HasChanges;
stopMovieToolStripMenuItem.Enabled stopMovieToolStripMenuItem.Enabled
= playFromBeginningToolStripMenuItem.Enabled = playFromBeginningToolStripMenuItem.Enabled
= saveMovieToolStripMenuItem.Enabled = saveMovieToolStripMenuItem.Enabled
= GlobalWinF.MovieSession.Movie.IsActive; = Global.MovieSession.Movie.IsActive;
readonlyToolStripMenuItem.Checked = ReadOnly; readonlyToolStripMenuItem.Checked = ReadOnly;
bindSavestatesToMoviesToolStripMenuItem.Checked = Global.Config.BindSavestatesToMovies; bindSavestatesToMoviesToolStripMenuItem.Checked = Global.Config.BindSavestatesToMovies;
@ -1435,11 +1435,11 @@ namespace BizHawk.MultiClient
rebootCoreToolStripMenuItem.Enabled = !IsNullEmulator(); rebootCoreToolStripMenuItem.Enabled = !IsNullEmulator();
resetToolStripMenuItem.Enabled = Global.Emulator.ControllerDefinition.BoolButtons.Contains("Reset") && resetToolStripMenuItem.Enabled = Global.Emulator.ControllerDefinition.BoolButtons.Contains("Reset") &&
(!GlobalWinF.MovieSession.Movie.IsPlaying || GlobalWinF.MovieSession.Movie.IsFinished); (!Global.MovieSession.Movie.IsPlaying || Global.MovieSession.Movie.IsFinished);
hardResetToolStripMenuItem.Enabled = Global.Emulator.ControllerDefinition.BoolButtons.Contains("Power") && hardResetToolStripMenuItem.Enabled = Global.Emulator.ControllerDefinition.BoolButtons.Contains("Power") &&
(!GlobalWinF.MovieSession.Movie.IsPlaying || GlobalWinF.MovieSession.Movie.IsFinished); (!Global.MovieSession.Movie.IsPlaying || Global.MovieSession.Movie.IsFinished);
pauseToolStripMenuItem.Checked = EmulatorPaused; pauseToolStripMenuItem.Checked = EmulatorPaused;
if (didMenuPause) if (didMenuPause)
@ -2215,7 +2215,7 @@ namespace BizHawk.MultiClient
string errorMsg; string errorMsg;
string warningMsg; string warningMsg;
Movie m = MovieImport.ImportFile(filePaths[0], out errorMsg, out warningMsg); Movie m = MovieImport.ImportFile(filePaths[0], GlobalWinF.MainForm.GetEmuVersion(), out errorMsg, out warningMsg);
if (errorMsg.Length > 0) if (errorMsg.Length > 0)
{ {
MessageBox.Show(errorMsg, "Conversion error", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(errorMsg, "Conversion error", MessageBoxButtons.OK, MessageBoxIcon.Error);

View File

@ -12,9 +12,9 @@ namespace BizHawk.MultiClient
public void ClearFrame() public void ClearFrame()
{ {
if (GlobalWinF.MovieSession.Movie.IsPlaying) if (Global.MovieSession.Movie.IsPlaying)
{ {
GlobalWinF.MovieSession.Movie.ClearFrame(Global.Emulator.Frame); Global.MovieSession.Movie.ClearFrame(Global.Emulator.Frame);
GlobalWinF.OSD.AddMessage("Scrubbed input at frame " + Global.Emulator.Frame.ToString()); GlobalWinF.OSD.AddMessage("Scrubbed input at frame " + Global.Emulator.Frame.ToString());
} }
} }
@ -22,38 +22,38 @@ namespace BizHawk.MultiClient
public void StartNewMovie(Movie m, bool record) public void StartNewMovie(Movie m, bool record)
{ {
//If a movie is already loaded, save it before starting a new movie //If a movie is already loaded, save it before starting a new movie
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
GlobalWinF.MovieSession.Movie.WriteMovie(); Global.MovieSession.Movie.WriteMovie();
} }
GlobalWinF.MovieSession = new MovieSession {Movie = m}; Global.MovieSession = new MovieSession { Movie = m };
RewireInputChain(); RewireInputChain();
if (!record) if (!record)
{ {
GlobalWinF.MovieSession.Movie.LoadMovie(); Global.MovieSession.Movie.LoadMovie();
SetSyncDependentSettings(); SetSyncDependentSettings();
} }
LoadRom(GlobalWinF.MainForm.CurrentlyOpenRom, true, !record); LoadRom(GlobalWinF.MainForm.CurrentlyOpenRom, true, !record);
Global.Config.RecentMovies.Add(m.Filename); Global.Config.RecentMovies.Add(m.Filename);
if (GlobalWinF.MovieSession.Movie.StartsFromSavestate) if (Global.MovieSession.Movie.StartsFromSavestate)
{ {
LoadStateFile(GlobalWinF.MovieSession.Movie.Filename, Path.GetFileName(GlobalWinF.MovieSession.Movie.Filename)); LoadStateFile(Global.MovieSession.Movie.Filename, Path.GetFileName(Global.MovieSession.Movie.Filename));
Global.Emulator.ResetFrameCounter(); Global.Emulator.ResetFrameCounter();
} }
if (record) if (record)
{ {
GlobalWinF.MainForm.ClearSaveRAM(); GlobalWinF.MainForm.ClearSaveRAM();
GlobalWinF.MovieSession.Movie.StartRecording(); Global.MovieSession.Movie.StartRecording();
ReadOnly = false; ReadOnly = false;
} }
else else
{ {
GlobalWinF.MainForm.ClearSaveRAM(); GlobalWinF.MainForm.ClearSaveRAM();
GlobalWinF.MovieSession.Movie.StartPlayback(); Global.MovieSession.Movie.StartPlayback();
} }
SetMainformMovieInfo(); SetMainformMovieInfo();
TAStudio1.Restart(); TAStudio1.Restart();
@ -63,21 +63,21 @@ namespace BizHawk.MultiClient
public void SetMainformMovieInfo() public void SetMainformMovieInfo()
{ {
if (GlobalWinF.MovieSession.Movie.IsPlaying) if (Global.MovieSession.Movie.IsPlaying)
{ {
Text = DisplayNameForSystem(Global.Game.System) + " - " + Global.Game.Name + " - " + Path.GetFileName(GlobalWinF.MovieSession.Movie.Filename); Text = DisplayNameForSystem(Global.Game.System) + " - " + Global.Game.Name + " - " + Path.GetFileName(Global.MovieSession.Movie.Filename);
PlayRecordStatus.Image = Properties.Resources.Play; PlayRecordStatus.Image = Properties.Resources.Play;
PlayRecordStatus.ToolTipText = "Movie is in playback mode"; PlayRecordStatus.ToolTipText = "Movie is in playback mode";
PlayRecordStatus.Visible = true; PlayRecordStatus.Visible = true;
} }
else if (GlobalWinF.MovieSession.Movie.IsRecording) else if (Global.MovieSession.Movie.IsRecording)
{ {
Text = DisplayNameForSystem(Global.Game.System) + " - " + Global.Game.Name + " - " + Path.GetFileName(GlobalWinF.MovieSession.Movie.Filename); Text = DisplayNameForSystem(Global.Game.System) + " - " + Global.Game.Name + " - " + Path.GetFileName(Global.MovieSession.Movie.Filename);
PlayRecordStatus.Image = Properties.Resources.RecordHS; PlayRecordStatus.Image = Properties.Resources.RecordHS;
PlayRecordStatus.ToolTipText = "Movie is in record mode"; PlayRecordStatus.ToolTipText = "Movie is in record mode";
PlayRecordStatus.Visible = true; PlayRecordStatus.Visible = true;
} }
else if (!GlobalWinF.MovieSession.Movie.IsActive) else if (!Global.MovieSession.Movie.IsActive)
{ {
Text = DisplayNameForSystem(Global.Game.System) + " - " + Global.Game.Name; Text = DisplayNameForSystem(Global.Game.System) + " - " + Global.Game.Name;
PlayRecordStatus.Image = Properties.Resources.Blank; PlayRecordStatus.Image = Properties.Resources.Blank;
@ -112,16 +112,16 @@ namespace BizHawk.MultiClient
public void PlayMovieFromBeginning() public void PlayMovieFromBeginning()
{ {
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
LoadRom(CurrentlyOpenRom, true, true); LoadRom(CurrentlyOpenRom, true, true);
if (GlobalWinF.MovieSession.Movie.StartsFromSavestate) if (Global.MovieSession.Movie.StartsFromSavestate)
{ {
LoadStateFile(GlobalWinF.MovieSession.Movie.Filename, Path.GetFileName(GlobalWinF.MovieSession.Movie.Filename)); LoadStateFile(Global.MovieSession.Movie.Filename, Path.GetFileName(Global.MovieSession.Movie.Filename));
Global.Emulator.ResetFrameCounter(); Global.Emulator.ResetFrameCounter();
} }
GlobalWinF.MainForm.ClearSaveRAM(); GlobalWinF.MainForm.ClearSaveRAM();
GlobalWinF.MovieSession.Movie.StartPlayback(); Global.MovieSession.Movie.StartPlayback();
SetMainformMovieInfo(); SetMainformMovieInfo();
GlobalWinF.OSD.AddMessage("Replaying movie file in read-only mode"); GlobalWinF.OSD.AddMessage("Replaying movie file in read-only mode");
GlobalWinF.MainForm.ReadOnly = true; GlobalWinF.MainForm.ReadOnly = true;
@ -131,23 +131,23 @@ namespace BizHawk.MultiClient
public void StopMovie(bool abortchanges = false) public void StopMovie(bool abortchanges = false)
{ {
string message = "Movie "; string message = "Movie ";
if (GlobalWinF.MovieSession.Movie.IsRecording) if (Global.MovieSession.Movie.IsRecording)
{ {
message += "recording "; message += "recording ";
} }
else if (GlobalWinF.MovieSession.Movie.IsPlaying) else if (Global.MovieSession.Movie.IsPlaying)
{ {
message += "playback "; message += "playback ";
} }
message += "stopped."; message += "stopped.";
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
GlobalWinF.MovieSession.Movie.Stop(abortchanges); Global.MovieSession.Movie.Stop(abortchanges);
if (!abortchanges) if (!abortchanges)
{ {
GlobalWinF.OSD.AddMessage(Path.GetFileName(GlobalWinF.MovieSession.Movie.Filename) + " written to disk."); GlobalWinF.OSD.AddMessage(Path.GetFileName(Global.MovieSession.Movie.Filename) + " written to disk.");
} }
GlobalWinF.OSD.AddMessage(message); GlobalWinF.OSD.AddMessage(message);
GlobalWinF.MainForm.ReadOnly = true; GlobalWinF.MainForm.ReadOnly = true;
@ -176,20 +176,20 @@ namespace BizHawk.MultiClient
{ {
string ErrorMSG = String.Empty; string ErrorMSG = String.Empty;
//Note, some of the situations in these IF's may be identical and could be combined but I intentionally separated it out for clarity //Note, some of the situations in these IF's may be identical and could be combined but I intentionally separated it out for clarity
if (!GlobalWinF.MovieSession.Movie.IsActive) if (!Global.MovieSession.Movie.IsActive)
{ {
return true; return true;
} }
else if (GlobalWinF.MovieSession.Movie.IsRecording) else if (Global.MovieSession.Movie.IsRecording)
{ {
if (ReadOnly) if (ReadOnly)
{ {
var result = GlobalWinF.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: false, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG); var result = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: false, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG);
if (result == Movie.LoadStateResult.Pass) if (result == Movie.LoadStateResult.Pass)
{ {
GlobalWinF.MovieSession.Movie.WriteMovie(); Global.MovieSession.Movie.WriteMovie();
GlobalWinF.MovieSession.Movie.SwitchToPlay(); Global.MovieSession.Movie.SwitchToPlay();
SetMainformMovieInfo(); SetMainformMovieInfo();
return true; return true;
} }
@ -202,11 +202,11 @@ namespace BizHawk.MultiClient
MessageBoxButtons.YesNo, MessageBoxIcon.Question); MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dresult == DialogResult.Yes) if (dresult == DialogResult.Yes)
{ {
var newresult = GlobalWinF.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: false, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG); var newresult = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: false, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG);
if (newresult == Movie.LoadStateResult.Pass) if (newresult == Movie.LoadStateResult.Pass)
{ {
GlobalWinF.MovieSession.Movie.WriteMovie(); Global.MovieSession.Movie.WriteMovie();
GlobalWinF.MovieSession.Movie.SwitchToPlay(); Global.MovieSession.Movie.SwitchToPlay();
SetMainformMovieInfo(); SetMainformMovieInfo();
return true; return true;
} }
@ -230,12 +230,12 @@ namespace BizHawk.MultiClient
} }
else else
{ {
var result = GlobalWinF.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: true, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG); var result = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: true, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG);
if (result == Movie.LoadStateResult.Pass) if (result == Movie.LoadStateResult.Pass)
{ {
reader.BaseStream.Position = 0; reader.BaseStream.Position = 0;
reader.DiscardBufferedData(); reader.DiscardBufferedData();
GlobalWinF.MovieSession.Movie.LoadLogFromSavestateText(reader, GlobalWinF.MovieSession.MultiTrack.IsActive); Global.MovieSession.Movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive);
} }
else else
{ {
@ -246,12 +246,12 @@ namespace BizHawk.MultiClient
MessageBoxButtons.YesNo, MessageBoxIcon.Question); MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dresult == DialogResult.Yes) if (dresult == DialogResult.Yes)
{ {
var newresult = GlobalWinF.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: false, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG); var newresult = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: false, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG);
if (newresult == Movie.LoadStateResult.Pass) if (newresult == Movie.LoadStateResult.Pass)
{ {
reader.BaseStream.Position = 0; reader.BaseStream.Position = 0;
reader.DiscardBufferedData(); reader.DiscardBufferedData();
GlobalWinF.MovieSession.Movie.LoadLogFromSavestateText(reader, GlobalWinF.MovieSession.MultiTrack.IsActive); Global.MovieSession.Movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive);
return true; return true;
} }
else else
@ -274,11 +274,11 @@ namespace BizHawk.MultiClient
} }
} }
else if (GlobalWinF.MovieSession.Movie.IsPlaying && !GlobalWinF.MovieSession.Movie.IsFinished) else if (Global.MovieSession.Movie.IsPlaying && !Global.MovieSession.Movie.IsFinished)
{ {
if (ReadOnly) if (ReadOnly)
{ {
var result = GlobalWinF.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG); var result = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG);
if (result == Movie.LoadStateResult.Pass) if (result == Movie.LoadStateResult.Pass)
{ {
//Frame loop automatically handles the rewinding effect based on Global.Emulator.Frame so nothing else is needed here //Frame loop automatically handles the rewinding effect based on Global.Emulator.Frame so nothing else is needed here
@ -293,7 +293,7 @@ namespace BizHawk.MultiClient
MessageBoxButtons.YesNo, MessageBoxIcon.Question); MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dresult == DialogResult.Yes) if (dresult == DialogResult.Yes)
{ {
var newresult = GlobalWinF.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG); var newresult = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG);
if (newresult == Movie.LoadStateResult.Pass) if (newresult == Movie.LoadStateResult.Pass)
{ {
return true; return true;
@ -318,14 +318,14 @@ namespace BizHawk.MultiClient
} }
else else
{ {
var result = GlobalWinF.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG); var result = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG);
if (result == Movie.LoadStateResult.Pass) if (result == Movie.LoadStateResult.Pass)
{ {
GlobalWinF.MovieSession.Movie.SwitchToRecord(); Global.MovieSession.Movie.SwitchToRecord();
SetMainformMovieInfo(); SetMainformMovieInfo();
reader.BaseStream.Position = 0; reader.BaseStream.Position = 0;
reader.DiscardBufferedData(); reader.DiscardBufferedData();
GlobalWinF.MovieSession.Movie.LoadLogFromSavestateText(reader, GlobalWinF.MovieSession.MultiTrack.IsActive); Global.MovieSession.Movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive);
return true; return true;
} }
else else
@ -337,14 +337,14 @@ namespace BizHawk.MultiClient
MessageBoxButtons.YesNo, MessageBoxIcon.Question); MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dresult == DialogResult.Yes) if (dresult == DialogResult.Yes)
{ {
var newresult = GlobalWinF.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG); var newresult = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG);
if (newresult == Movie.LoadStateResult.Pass) if (newresult == Movie.LoadStateResult.Pass)
{ {
GlobalWinF.MovieSession.Movie.SwitchToRecord(); Global.MovieSession.Movie.SwitchToRecord();
SetMainformMovieInfo(); SetMainformMovieInfo();
reader.BaseStream.Position = 0; reader.BaseStream.Position = 0;
reader.DiscardBufferedData(); reader.DiscardBufferedData();
GlobalWinF.MovieSession.Movie.LoadLogFromSavestateText(reader, GlobalWinF.MovieSession.MultiTrack.IsActive); Global.MovieSession.Movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive);
return true; return true;
} }
else else
@ -366,11 +366,11 @@ namespace BizHawk.MultiClient
} }
} }
} }
else if (GlobalWinF.MovieSession.Movie.IsFinished) else if (Global.MovieSession.Movie.IsFinished)
{ {
if (ReadOnly) if (ReadOnly)
{ {
var result = GlobalWinF.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG); var result = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG);
if (result != Movie.LoadStateResult.Pass) if (result != Movie.LoadStateResult.Pass)
{ {
if (result == Movie.LoadStateResult.GuidMismatch) if (result == Movie.LoadStateResult.GuidMismatch)
@ -380,10 +380,10 @@ namespace BizHawk.MultiClient
MessageBoxButtons.YesNo, MessageBoxIcon.Question); MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dresult == DialogResult.Yes) if (dresult == DialogResult.Yes)
{ {
var newresult = GlobalWinF.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG); var newresult = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG);
if (newresult == Movie.LoadStateResult.Pass) if (newresult == Movie.LoadStateResult.Pass)
{ {
GlobalWinF.MovieSession.Movie.SwitchToPlay(); Global.MovieSession.Movie.SwitchToPlay();
SetMainformMovieInfo(); SetMainformMovieInfo();
return true; return true;
} }
@ -404,27 +404,27 @@ namespace BizHawk.MultiClient
return false; return false;
} }
} }
else if (GlobalWinF.MovieSession.Movie.IsFinished) //TimeLine check can change a movie to finished, hence the check here (not a good design) else if (Global.MovieSession.Movie.IsFinished) //TimeLine check can change a movie to finished, hence the check here (not a good design)
{ {
GlobalWinF.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter);
} }
else else
{ {
GlobalWinF.MovieSession.Movie.SwitchToPlay(); Global.MovieSession.Movie.SwitchToPlay();
SetMainformMovieInfo(); SetMainformMovieInfo();
} }
} }
else else
{ {
var result = GlobalWinF.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG); var result = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: false, ErrorMessage: out ErrorMSG);
if (result == Movie.LoadStateResult.Pass) if (result == Movie.LoadStateResult.Pass)
{ {
GlobalWinF.MainForm.ClearSaveRAM(); GlobalWinF.MainForm.ClearSaveRAM();
GlobalWinF.MovieSession.Movie.StartRecording(); Global.MovieSession.Movie.StartRecording();
SetMainformMovieInfo(); SetMainformMovieInfo();
reader.BaseStream.Position = 0; reader.BaseStream.Position = 0;
reader.DiscardBufferedData(); reader.DiscardBufferedData();
GlobalWinF.MovieSession.Movie.LoadLogFromSavestateText(reader, GlobalWinF.MovieSession.MultiTrack.IsActive); Global.MovieSession.Movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive);
return true; return true;
} }
else else
@ -436,15 +436,15 @@ namespace BizHawk.MultiClient
MessageBoxButtons.YesNo, MessageBoxIcon.Question); MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dresult == DialogResult.Yes) if (dresult == DialogResult.Yes)
{ {
var newresult = GlobalWinF.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG); var newresult = Global.MovieSession.Movie.CheckTimeLines(reader, OnlyGUID: !ReadOnly, IgnoreGuidMismatch: true, ErrorMessage: out ErrorMSG);
if (newresult == Movie.LoadStateResult.Pass) if (newresult == Movie.LoadStateResult.Pass)
{ {
GlobalWinF.MainForm.ClearSaveRAM(); GlobalWinF.MainForm.ClearSaveRAM();
GlobalWinF.MovieSession.Movie.StartRecording(); Global.MovieSession.Movie.StartRecording();
SetMainformMovieInfo(); SetMainformMovieInfo();
reader.BaseStream.Position = 0; reader.BaseStream.Position = 0;
reader.DiscardBufferedData(); reader.DiscardBufferedData();
GlobalWinF.MovieSession.Movie.LoadLogFromSavestateText(reader, GlobalWinF.MovieSession.MultiTrack.IsActive); Global.MovieSession.Movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive);
return true; return true;
} }
else else
@ -472,88 +472,88 @@ namespace BizHawk.MultiClient
private void HandleMovieSaveState(StreamWriter writer) private void HandleMovieSaveState(StreamWriter writer)
{ {
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
GlobalWinF.MovieSession.Movie.DumpLogIntoSavestateText(writer); Global.MovieSession.Movie.DumpLogIntoSavestateText(writer);
} }
} }
private void HandleMovieOnFrameLoop() private void HandleMovieOnFrameLoop()
{ {
if (!GlobalWinF.MovieSession.Movie.IsActive) if (!Global.MovieSession.Movie.IsActive)
{ {
GlobalWinF.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter);
} }
else if (GlobalWinF.MovieSession.Movie.IsFinished) else if (Global.MovieSession.Movie.IsFinished)
{ {
if (Global.Emulator.Frame < GlobalWinF.MovieSession.Movie.Frames) //This scenario can happen from rewinding (suddenly we are back in the movie, so hook back up to the movie if (Global.Emulator.Frame < Global.MovieSession.Movie.Frames) //This scenario can happen from rewinding (suddenly we are back in the movie, so hook back up to the movie
{ {
GlobalWinF.MovieSession.Movie.SwitchToPlay(); Global.MovieSession.Movie.SwitchToPlay();
GlobalWinF.MovieSession.LatchInputFromLog(); Global.MovieSession.LatchInputFromLog();
} }
else else
{ {
GlobalWinF.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter);
} }
} }
else if (GlobalWinF.MovieSession.Movie.IsPlaying) else if (Global.MovieSession.Movie.IsPlaying)
{ {
if (Global.Emulator.Frame >= GlobalWinF.MovieSession.Movie.Frames) if (Global.Emulator.Frame >= Global.MovieSession.Movie.Frames)
{ {
if (TAStudio1.IsHandleCreated && !TAStudio1.IsDisposed) if (TAStudio1.IsHandleCreated && !TAStudio1.IsDisposed)
{ {
GlobalWinF.MovieSession.Movie.CaptureState(); Global.MovieSession.Movie.CaptureState();
GlobalWinF.MovieSession.LatchInputFromLog(); Global.MovieSession.LatchInputFromLog();
GlobalWinF.MovieSession.Movie.CommitFrame(Global.Emulator.Frame, GlobalWinF.MovieOutputHardpoint); Global.MovieSession.Movie.CommitFrame(Global.Emulator.Frame, GlobalWinF.MovieOutputHardpoint);
} }
else else
{ {
GlobalWinF.MovieSession.Movie.Finish(); Global.MovieSession.Movie.Finish();
} }
} }
else else
{ {
GlobalWinF.MovieSession.Movie.CaptureState(); Global.MovieSession.Movie.CaptureState();
GlobalWinF.MovieSession.LatchInputFromLog(); Global.MovieSession.LatchInputFromLog();
if (GlobalWinF.ClientControls["ClearFrame"]) if (GlobalWinF.ClientControls["ClearFrame"])
{ {
GlobalWinF.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter);
ClearFrame(); ClearFrame();
} }
else if (TAStudio1.IsHandleCreated && !TAStudio1.IsDisposed || Global.Config.MoviePlaybackPokeMode) else if (TAStudio1.IsHandleCreated && !TAStudio1.IsDisposed || Global.Config.MoviePlaybackPokeMode)
{ {
GlobalWinF.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter);
MnemonicsGenerator mg = new MnemonicsGenerator(); MnemonicsGenerator mg = new MnemonicsGenerator();
mg.SetSource( GlobalWinF.MovieOutputHardpoint); mg.SetSource( GlobalWinF.MovieOutputHardpoint);
if (!mg.IsEmpty) if (!mg.IsEmpty)
{ {
GlobalWinF.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter);
GlobalWinF.MovieSession.Movie.PokeFrame(Global.Emulator.Frame, mg.GetControllersAsMnemonic()); Global.MovieSession.Movie.PokeFrame(Global.Emulator.Frame, mg.GetControllersAsMnemonic());
} }
else else
{ {
GlobalWinF.MovieSession.LatchInputFromLog(); Global.MovieSession.LatchInputFromLog();
} }
} }
} }
} }
else if (GlobalWinF.MovieSession.Movie.IsRecording) else if (Global.MovieSession.Movie.IsRecording)
{ {
GlobalWinF.MovieSession.Movie.CaptureState(); Global.MovieSession.Movie.CaptureState();
if (GlobalWinF.MovieSession.MultiTrack.IsActive) if (Global.MovieSession.MultiTrack.IsActive)
{ {
GlobalWinF.MovieSession.LatchMultitrackPlayerInput(GlobalWinF.MovieInputSourceAdapter, GlobalWinF.MultitrackRewiringControllerAdapter); Global.MovieSession.LatchMultitrackPlayerInput(GlobalWinF.MovieInputSourceAdapter, Global.MultitrackRewiringControllerAdapter);
} }
else else
{ {
GlobalWinF.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter); Global.MovieSession.LatchInputFromPlayer(GlobalWinF.MovieInputSourceAdapter);
} }
//the movie session makes sure that the correct input has been read and merged to its MovieControllerAdapter; //the movie session makes sure that the correct input has been read and merged to its MovieControllerAdapter;
//this has been wired to Global.MovieOutputHardpoint in RewireInputChain //this has been wired to Global.MovieOutputHardpoint in RewireInputChain
GlobalWinF.MovieSession.Movie.CommitFrame(Global.Emulator.Frame, GlobalWinF.MovieOutputHardpoint); Global.MovieSession.Movie.CommitFrame(Global.Emulator.Frame, GlobalWinF.MovieOutputHardpoint);
} }
} }
@ -563,7 +563,7 @@ namespace BizHawk.MultiClient
switch (Global.Emulator.SystemId) switch (Global.Emulator.SystemId)
{ {
case "Coleco": case "Coleco":
string str = GlobalWinF.MovieSession.Movie.Header.GetHeaderLine(MovieHeader.SKIPBIOS); string str = Global.MovieSession.Movie.Header.GetHeaderLine(MovieHeader.SKIPBIOS);
if (!String.IsNullOrWhiteSpace(str)) if (!String.IsNullOrWhiteSpace(str))
{ {
if (str.ToLower() == "true") if (str.ToLower() == "true")

View File

@ -603,7 +603,7 @@ namespace BizHawk.MultiClient
{ {
for (int i = 0; i < frames; i++) for (int i = 0; i < frames; i++)
{ {
if (RewindBuf.Count == 0 || (GlobalWinF.MovieSession.Movie.Loaded && 0 == GlobalWinF.MovieSession.Movie.Frames)) if (RewindBuf.Count == 0 || (Global.MovieSession.Movie.Loaded && 0 == Global.MovieSession.Movie.Frames))
return; return;
if (LastState.Length < 0x10000) if (LastState.Length < 0x10000)

View File

@ -180,7 +180,7 @@ namespace BizHawk.MultiClient
public MainForm(string[] args) public MainForm(string[] args)
{ {
GlobalWinF.MainForm = this; GlobalWinF.MainForm = this;
GlobalWinF.MovieSession = new MovieSession { Movie = new Movie(GlobalWinF.MainForm.GetEmuVersion()) }; Global.MovieSession = new MovieSession { Movie = new Movie(GlobalWinF.MainForm.GetEmuVersion()) };
MainWait = new AutoResetEvent(false); MainWait = new AutoResetEvent(false);
Icon = Properties.Resources.logo; Icon = Properties.Resources.logo;
InitializeComponent(); InitializeComponent();
@ -226,7 +226,7 @@ namespace BizHawk.MultiClient
{ {
Global.CheatList.SaveOnClose(); Global.CheatList.SaveOnClose();
CloseGame(); CloseGame();
GlobalWinF.MovieSession.Movie.Stop(); Global.MovieSession.Movie.Stop();
CloseTools(); CloseTools();
SaveConfig(); SaveConfig();
}; };
@ -938,7 +938,7 @@ namespace BizHawk.MultiClient
{ {
if (Global.Emulator.ControllerDefinition.BoolButtons.Contains(button)) if (Global.Emulator.ControllerDefinition.BoolButtons.Contains(button))
{ {
if (!GlobalWinF.MovieSession.Movie.IsPlaying || GlobalWinF.MovieSession.Movie.IsFinished) if (!Global.MovieSession.Movie.IsPlaying || Global.MovieSession.Movie.IsFinished)
{ {
GlobalWinF.ClickyVirtualPadController.Click(button); GlobalWinF.ClickyVirtualPadController.Click(button);
GlobalWinF.OSD.AddMessage(msg); GlobalWinF.OSD.AddMessage(msg);
@ -1057,19 +1057,19 @@ namespace BizHawk.MultiClient
GlobalWinF.StickyXORAdapter.Source = GlobalWinF.UD_LR_ControllerAdapter; GlobalWinF.StickyXORAdapter.Source = GlobalWinF.UD_LR_ControllerAdapter;
GlobalWinF.AutofireStickyXORAdapter.Source = GlobalWinF.StickyXORAdapter; GlobalWinF.AutofireStickyXORAdapter.Source = GlobalWinF.StickyXORAdapter;
GlobalWinF.MultitrackRewiringControllerAdapter.Source = GlobalWinF.AutofireStickyXORAdapter; Global.MultitrackRewiringControllerAdapter.Source = GlobalWinF.AutofireStickyXORAdapter;
GlobalWinF.ForceOffAdaptor.Source = GlobalWinF.MultitrackRewiringControllerAdapter; GlobalWinF.ForceOffAdaptor.Source = Global.MultitrackRewiringControllerAdapter;
GlobalWinF.MovieInputSourceAdapter.Source = GlobalWinF.ForceOffAdaptor; GlobalWinF.MovieInputSourceAdapter.Source = GlobalWinF.ForceOffAdaptor;
GlobalWinF.ControllerOutput.Source = GlobalWinF.MovieOutputHardpoint; GlobalWinF.ControllerOutput.Source = GlobalWinF.MovieOutputHardpoint;
Global.Emulator.Controller = GlobalWinF.ControllerOutput; Global.Emulator.Controller = GlobalWinF.ControllerOutput;
GlobalWinF.MovieSession.MovieControllerAdapter.Type = GlobalWinF.MovieInputSourceAdapter.Type; Global.MovieSession.MovieControllerAdapter.Type = GlobalWinF.MovieInputSourceAdapter.Type;
//connect the movie session before MovieOutputHardpoint if it is doing anything //connect the movie session before MovieOutputHardpoint if it is doing anything
//otherwise connect the MovieInputSourceAdapter to it, effectively bypassing the movie session //otherwise connect the MovieInputSourceAdapter to it, effectively bypassing the movie session
if (GlobalWinF.MovieSession.Movie != null) if (Global.MovieSession.Movie != null)
GlobalWinF.MovieOutputHardpoint.Source = GlobalWinF.MovieSession.MovieControllerAdapter; GlobalWinF.MovieOutputHardpoint.Source = Global.MovieSession.MovieControllerAdapter;
else else
GlobalWinF.MovieOutputHardpoint.Source = GlobalWinF.MovieInputSourceAdapter; GlobalWinF.MovieOutputHardpoint.Source = GlobalWinF.MovieInputSourceAdapter;
} }
@ -1343,7 +1343,7 @@ namespace BizHawk.MultiClient
} }
} }
NES nes = new NES(nextComm, game, rom.FileData, bios, GlobalWinF.MovieSession.Movie.Header.BoardProperties) NES nes = new NES(nextComm, game, rom.FileData, bios, Global.MovieSession.Movie.Header.BoardProperties)
{ {
SoundOn = Global.Config.SoundEnabled, SoundOn = Global.Config.SoundEnabled,
NTSC_FirstDrawLine = Global.Config.NTSC_NESTopLine, NTSC_FirstDrawLine = Global.Config.NTSC_NESTopLine,
@ -2046,7 +2046,7 @@ namespace BizHawk.MultiClient
case "Play from beginning": PlayMovieFromBeginning(); break; case "Play from beginning": PlayMovieFromBeginning(); break;
case "Save Movie": SaveMovie(); break; case "Save Movie": SaveMovie(); break;
case "Toggle MultiTrack": case "Toggle MultiTrack":
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
if (Global.Config.VBAStyleMovieLoadState) if (Global.Config.VBAStyleMovieLoadState)
@ -2055,8 +2055,8 @@ namespace BizHawk.MultiClient
} }
else else
{ {
GlobalWinF.MovieSession.MultiTrack.IsActive = !GlobalWinF.MovieSession.MultiTrack.IsActive; Global.MovieSession.MultiTrack.IsActive = !Global.MovieSession.MultiTrack.IsActive;
if (GlobalWinF.MovieSession.MultiTrack.IsActive) if (Global.MovieSession.MultiTrack.IsActive)
{ {
GlobalWinF.OSD.AddMessage("MultiTrack Enabled"); GlobalWinF.OSD.AddMessage("MultiTrack Enabled");
GlobalWinF.OSD.MT = "Recording None"; GlobalWinF.OSD.MT = "Recording None";
@ -2065,8 +2065,8 @@ namespace BizHawk.MultiClient
{ {
GlobalWinF.OSD.AddMessage("MultiTrack Disabled"); GlobalWinF.OSD.AddMessage("MultiTrack Disabled");
} }
GlobalWinF.MovieSession.MultiTrack.RecordAll = false; Global.MovieSession.MultiTrack.RecordAll = false;
GlobalWinF.MovieSession.MultiTrack.CurrentPlayer = 0; Global.MovieSession.MultiTrack.CurrentPlayer = 0;
} }
} }
else else
@ -2076,35 +2076,35 @@ namespace BizHawk.MultiClient
GlobalWinF.DisplayManager.NeedsToPaint = true; GlobalWinF.DisplayManager.NeedsToPaint = true;
break; break;
case "MT Select All": case "MT Select All":
GlobalWinF.MovieSession.MultiTrack.CurrentPlayer = 0; Global.MovieSession.MultiTrack.CurrentPlayer = 0;
GlobalWinF.MovieSession.MultiTrack.RecordAll = true; Global.MovieSession.MultiTrack.RecordAll = true;
GlobalWinF.OSD.MT = "Recording All"; GlobalWinF.OSD.MT = "Recording All";
GlobalWinF.DisplayManager.NeedsToPaint = true; GlobalWinF.DisplayManager.NeedsToPaint = true;
break; break;
case "MT Select None": case "MT Select None":
GlobalWinF.MovieSession.MultiTrack.CurrentPlayer = 0; Global.MovieSession.MultiTrack.CurrentPlayer = 0;
GlobalWinF.MovieSession.MultiTrack.RecordAll = false; Global.MovieSession.MultiTrack.RecordAll = false;
GlobalWinF.OSD.MT = "Recording None"; GlobalWinF.OSD.MT = "Recording None";
GlobalWinF.DisplayManager.NeedsToPaint = true; GlobalWinF.DisplayManager.NeedsToPaint = true;
break; break;
case "MT Increment Player": case "MT Increment Player":
GlobalWinF.MovieSession.MultiTrack.CurrentPlayer++; Global.MovieSession.MultiTrack.CurrentPlayer++;
GlobalWinF.MovieSession.MultiTrack.RecordAll = false; Global.MovieSession.MultiTrack.RecordAll = false;
if (GlobalWinF.MovieSession.MultiTrack.CurrentPlayer > 5) //TODO: Replace with console's maximum or current maximum players??! if (Global.MovieSession.MultiTrack.CurrentPlayer > 5) //TODO: Replace with console's maximum or current maximum players??!
{ {
GlobalWinF.MovieSession.MultiTrack.CurrentPlayer = 1; Global.MovieSession.MultiTrack.CurrentPlayer = 1;
} }
GlobalWinF.OSD.MT = "Recording Player " + GlobalWinF.MovieSession.MultiTrack.CurrentPlayer.ToString(); GlobalWinF.OSD.MT = "Recording Player " + Global.MovieSession.MultiTrack.CurrentPlayer.ToString();
GlobalWinF.DisplayManager.NeedsToPaint = true; GlobalWinF.DisplayManager.NeedsToPaint = true;
break; break;
case "MT Decrement Player": case "MT Decrement Player":
GlobalWinF.MovieSession.MultiTrack.CurrentPlayer--; Global.MovieSession.MultiTrack.CurrentPlayer--;
GlobalWinF.MovieSession.MultiTrack.RecordAll = false; Global.MovieSession.MultiTrack.RecordAll = false;
if (GlobalWinF.MovieSession.MultiTrack.CurrentPlayer < 1) if (Global.MovieSession.MultiTrack.CurrentPlayer < 1)
{ {
GlobalWinF.MovieSession.MultiTrack.CurrentPlayer = 5;//TODO: Replace with console's maximum or current maximum players??! Global.MovieSession.MultiTrack.CurrentPlayer = 5;//TODO: Replace with console's maximum or current maximum players??!
} }
GlobalWinF.OSD.MT = "Recording Player " + GlobalWinF.MovieSession.MultiTrack.CurrentPlayer.ToString(); GlobalWinF.OSD.MT = "Recording Player " + Global.MovieSession.MultiTrack.CurrentPlayer.ToString();
GlobalWinF.DisplayManager.NeedsToPaint = true; GlobalWinF.DisplayManager.NeedsToPaint = true;
break; break;
case "Movie Poke": ToggleModePokeMode(); break; case "Movie Poke": ToggleModePokeMode(); break;
@ -2211,7 +2211,7 @@ namespace BizHawk.MultiClient
runFrame = true; runFrame = true;
} }
bool ReturnToRecording = GlobalWinF.MovieSession.Movie.IsRecording; bool ReturnToRecording = Global.MovieSession.Movie.IsRecording;
if (RewindActive && (GlobalWinF.ClientControls["Rewind"] || PressRewind)) if (RewindActive && (GlobalWinF.ClientControls["Rewind"] || PressRewind))
{ {
Rewind(1); Rewind(1);
@ -2225,17 +2225,17 @@ namespace BizHawk.MultiClient
runFrame = true; runFrame = true;
} }
//we don't want to capture input when rewinding, even in record mode //we don't want to capture input when rewinding, even in record mode
if (GlobalWinF.MovieSession.Movie.IsRecording) if (Global.MovieSession.Movie.IsRecording)
{ {
GlobalWinF.MovieSession.Movie.SwitchToPlay(); Global.MovieSession.Movie.SwitchToPlay();
} }
} }
if (UpdateFrame) if (UpdateFrame)
{ {
runFrame = true; runFrame = true;
if (GlobalWinF.MovieSession.Movie.IsRecording) if (Global.MovieSession.Movie.IsRecording)
{ {
GlobalWinF.MovieSession.Movie.SwitchToPlay(); Global.MovieSession.Movie.SwitchToPlay();
} }
} }
@ -2319,7 +2319,7 @@ namespace BizHawk.MultiClient
UpdateToolsAfter(); UpdateToolsAfter();
if (ReturnToRecording) if (ReturnToRecording)
{ {
GlobalWinF.MovieSession.Movie.SwitchToRecord(); Global.MovieSession.Movie.SwitchToRecord();
} }
PressRewind = false; PressRewind = false;
} }
@ -2327,7 +2327,7 @@ namespace BizHawk.MultiClient
{ {
if (ReturnToRecording) if (ReturnToRecording)
{ {
GlobalWinF.MovieSession.Movie.SwitchToRecord(); Global.MovieSession.Movie.SwitchToRecord();
} }
UpdateFrame = false; UpdateFrame = false;
} }
@ -2535,7 +2535,7 @@ namespace BizHawk.MultiClient
bw.Flush(); bw.Flush();
}); });
} }
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
bs.PutInputLog( bs.PutInputLog(
delegate(Stream s) delegate(Stream s)
@ -2589,7 +2589,7 @@ namespace BizHawk.MultiClient
{ {
bool succeed = false; bool succeed = false;
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
bw.GetInputLogRequired( bw.GetInputLogRequired(
delegate(Stream s) delegate(Stream s)
@ -3011,9 +3011,9 @@ namespace BizHawk.MultiClient
{ {
string PluginToUse = ""; string PluginToUse = "";
if (hasmovie && GlobalWinF.MovieSession.Movie.Header.HeaderParams[MovieHeader.PLATFORM] == "N64" && GlobalWinF.MovieSession.Movie.Header.HeaderParams.ContainsKey(MovieHeader.VIDEOPLUGIN)) if (hasmovie && Global.MovieSession.Movie.Header.HeaderParams[MovieHeader.PLATFORM] == "N64" && Global.MovieSession.Movie.Header.HeaderParams.ContainsKey(MovieHeader.VIDEOPLUGIN))
{ {
PluginToUse = GlobalWinF.MovieSession.Movie.Header.HeaderParams[MovieHeader.VIDEOPLUGIN]; PluginToUse = Global.MovieSession.Movie.Header.HeaderParams[MovieHeader.VIDEOPLUGIN];
} }
if (PluginToUse == "" || (PluginToUse != "Rice" && PluginToUse != "Glide64")) if (PluginToUse == "" || (PluginToUse != "Rice" && PluginToUse != "Glide64"))
@ -3039,14 +3039,14 @@ namespace BizHawk.MultiClient
video_settings.Parameters = Global.Config.Glide64mk2Plugin.GetPluginSettings(); video_settings.Parameters = Global.Config.Glide64mk2Plugin.GetPluginSettings();
} }
if (hasmovie && GlobalWinF.MovieSession.Movie.Header.HeaderParams[MovieHeader.PLATFORM] == "N64" && GlobalWinF.MovieSession.Movie.Header.HeaderParams.ContainsKey(MovieHeader.VIDEOPLUGIN)) if (hasmovie && Global.MovieSession.Movie.Header.HeaderParams[MovieHeader.PLATFORM] == "N64" && Global.MovieSession.Movie.Header.HeaderParams.ContainsKey(MovieHeader.VIDEOPLUGIN))
{ {
List<string> settings = new List<string>(video_settings.Parameters.Keys); List<string> settings = new List<string>(video_settings.Parameters.Keys);
foreach (string setting in settings) foreach (string setting in settings)
{ {
if (GlobalWinF.MovieSession.Movie.Header.HeaderParams.ContainsKey(setting)) if (Global.MovieSession.Movie.Header.HeaderParams.ContainsKey(setting))
{ {
string Value = GlobalWinF.MovieSession.Movie.Header.HeaderParams[setting]; string Value = Global.MovieSession.Movie.Header.HeaderParams[setting];
if (video_settings.Parameters[setting] is bool) if (video_settings.Parameters[setting] is bool)
{ {
try try
@ -3325,7 +3325,7 @@ namespace BizHawk.MultiClient
Global.Emulator = new NullEmulator(GlobalWinF.CoreComm); Global.Emulator = new NullEmulator(GlobalWinF.CoreComm);
GlobalWinF.ActiveController = GlobalWinF.NullControls; GlobalWinF.ActiveController = GlobalWinF.NullControls;
GlobalWinF.AutoFireController = GlobalWinF.AutofireNullControls; GlobalWinF.AutoFireController = GlobalWinF.AutofireNullControls;
GlobalWinF.MovieSession.Movie.Stop(); Global.MovieSession.Movie.Stop();
NeedsReboot = false; NeedsReboot = false;
SetRebootIconStatus(); SetRebootIconStatus();
} }
@ -3450,7 +3450,7 @@ namespace BizHawk.MultiClient
public void ToggleReadOnly() public void ToggleReadOnly()
{ {
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
ReadOnly ^= true; ReadOnly ^= true;
if (ReadOnly) if (ReadOnly)
@ -3527,7 +3527,7 @@ namespace BizHawk.MultiClient
//is it enough to run this for one frame? maybe.. //is it enough to run this for one frame? maybe..
if (Global.Emulator.ControllerDefinition.BoolButtons.Contains("Reset")) if (Global.Emulator.ControllerDefinition.BoolButtons.Contains("Reset"))
{ {
if (!GlobalWinF.MovieSession.Movie.IsPlaying || GlobalWinF.MovieSession.Movie.IsFinished) if (!Global.MovieSession.Movie.IsPlaying || Global.MovieSession.Movie.IsFinished)
{ {
GlobalWinF.ClickyVirtualPadController.Click("Reset"); GlobalWinF.ClickyVirtualPadController.Click("Reset");
GlobalWinF.OSD.AddMessage("Reset button pressed."); GlobalWinF.OSD.AddMessage("Reset button pressed.");
@ -3540,7 +3540,7 @@ namespace BizHawk.MultiClient
//is it enough to run this for one frame? maybe.. //is it enough to run this for one frame? maybe..
if (Global.Emulator.ControllerDefinition.BoolButtons.Contains("Power")) if (Global.Emulator.ControllerDefinition.BoolButtons.Contains("Power"))
{ {
if (!GlobalWinF.MovieSession.Movie.IsPlaying || GlobalWinF.MovieSession.Movie.IsFinished) if (!Global.MovieSession.Movie.IsPlaying || Global.MovieSession.Movie.IsFinished)
{ {
GlobalWinF.ClickyVirtualPadController.Click("Power"); GlobalWinF.ClickyVirtualPadController.Click("Power");
GlobalWinF.OSD.AddMessage("Power button pressed."); GlobalWinF.OSD.AddMessage("Power button pressed.");
@ -3982,7 +3982,7 @@ namespace BizHawk.MultiClient
string d = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPath, null); string d = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPath, null);
string errorMsg; string errorMsg;
string warningMsg; string warningMsg;
Movie m = MovieImport.ImportFile(fn, out errorMsg, out warningMsg); Movie m = MovieImport.ImportFile(fn, GlobalWinF.MainForm.GetEmuVersion(), out errorMsg, out warningMsg);
if (errorMsg.Length > 0) if (errorMsg.Length > 0)
MessageBox.Show(errorMsg, "Conversion error", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(errorMsg, "Conversion error", MessageBoxButtons.OK, MessageBoxIcon.Error);
if (warningMsg.Length > 0) if (warningMsg.Length > 0)
@ -4202,10 +4202,10 @@ namespace BizHawk.MultiClient
private void SaveMovie() private void SaveMovie()
{ {
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
GlobalWinF.MovieSession.Movie.WriteMovie(); Global.MovieSession.Movie.WriteMovie();
GlobalWinF.OSD.AddMessage(GlobalWinF.MovieSession.Movie.Filename + " saved."); GlobalWinF.OSD.AddMessage(Global.MovieSession.Movie.Filename + " saved.");
} }
} }

View File

@ -230,9 +230,9 @@ namespace BizHawk.MultiClient
public static string SaveRamPath(GameInfo game) public static string SaveRamPath(GameInfo game)
{ {
string name = FilesystemSafeName(game); string name = FilesystemSafeName(game);
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
name += "." + Path.GetFileNameWithoutExtension(GlobalWinF.MovieSession.Movie.Filename); name += "." + Path.GetFileNameWithoutExtension(Global.MovieSession.Movie.Filename);
} }
PathEntry pathEntry = Global.Config.PathEntries[game.System, "Save RAM"]; PathEntry pathEntry = Global.Config.PathEntries[game.System, "Save RAM"];
@ -261,9 +261,9 @@ namespace BizHawk.MultiClient
{ {
string name = FilesystemSafeName(game); string name = FilesystemSafeName(game);
if (Global.Config.BindSavestatesToMovies && GlobalWinF.MovieSession.Movie.IsActive) if (Global.Config.BindSavestatesToMovies && Global.MovieSession.Movie.IsActive)
{ {
name += "." + Path.GetFileNameWithoutExtension(GlobalWinF.MovieSession.Movie.Filename); name += "." + Path.GetFileNameWithoutExtension(Global.MovieSession.Movie.Filename);
} }
PathEntry pathEntry = Global.Config.PathEntries[game.System, "Savestates"]; PathEntry pathEntry = Global.Config.PathEntries[game.System, "Savestates"];

View File

@ -33,9 +33,9 @@ namespace BizHawk.MultiClient
public const string UNITCODE = "UnitCode"; public const string UNITCODE = "UnitCode";
// Attempt to import another type of movie file into a movie object. // Attempt to import another type of movie file into a movie object.
public static Movie ImportFile(string path, out string errorMsg, out string warningMsg) public static Movie ImportFile(string path, string bizVersion, out string errorMsg, out string warningMsg)
{ {
Movie m = new Movie(GlobalWinF.MainForm.GetEmuVersion()); Movie m = new Movie(bizVersion);
errorMsg = String.Empty; errorMsg = String.Empty;
warningMsg = String.Empty; warningMsg = String.Empty;

View File

@ -2935,15 +2935,15 @@ namespace BizHawk.MultiClient
public string movie_filename() public string movie_filename()
{ {
return GlobalWinF.MovieSession.Movie.Filename; return Global.MovieSession.Movie.Filename;
} }
public LuaTable movie_getinput(object frame) public LuaTable movie_getinput(object frame)
{ {
LuaTable input = _lua.NewTable(); LuaTable input = _lua.NewTable();
string s = GlobalWinF.MovieSession.Movie.GetInput(LuaInt(frame)); string s = Global.MovieSession.Movie.GetInput(LuaInt(frame));
MovieControllerAdapter m = new MovieControllerAdapter { Type = GlobalWinF.MovieSession.MovieControllerAdapter.Type }; MovieControllerAdapter m = new MovieControllerAdapter { Type = Global.MovieSession.MovieControllerAdapter.Type };
m.SetControllersAsMnemonic(s); m.SetControllersAsMnemonic(s);
foreach (string button in m.Type.BoolButtons) foreach (string button in m.Type.BoolButtons)
input[button] = m[button]; input[button] = m[button];
@ -2958,12 +2958,12 @@ namespace BizHawk.MultiClient
public bool movie_getrerecordcounting() public bool movie_getrerecordcounting()
{ {
return GlobalWinF.MovieSession.Movie.IsCountingRerecords; return Global.MovieSession.Movie.IsCountingRerecords;
} }
public bool movie_isloaded() public bool movie_isloaded()
{ {
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
return true; return true;
} }
@ -2975,9 +2975,9 @@ namespace BizHawk.MultiClient
public int movie_length() public int movie_length()
{ {
if (GlobalWinF.MovieSession.Movie.Frames.HasValue) if (Global.MovieSession.Movie.Frames.HasValue)
{ {
return GlobalWinF.MovieSession.Movie.Frames.Value; return Global.MovieSession.Movie.Frames.Value;
} }
else else
{ {
@ -2987,15 +2987,15 @@ namespace BizHawk.MultiClient
public string movie_mode() public string movie_mode()
{ {
if (GlobalWinF.MovieSession.Movie.IsFinished) if (Global.MovieSession.Movie.IsFinished)
{ {
return "FINISHED"; return "FINISHED";
} }
else if (GlobalWinF.MovieSession.Movie.IsPlaying) else if (Global.MovieSession.Movie.IsPlaying)
{ {
return "PLAY"; return "PLAY";
} }
else if (GlobalWinF.MovieSession.Movie.IsRecording) else if (Global.MovieSession.Movie.IsRecording)
{ {
return "RECORD"; return "RECORD";
} }
@ -3007,7 +3007,7 @@ namespace BizHawk.MultiClient
public string movie_rerecordcount() public string movie_rerecordcount()
{ {
return GlobalWinF.MovieSession.Movie.Rerecords.ToString(); return Global.MovieSession.Movie.Rerecords.ToString();
} }
public void movie_setreadonly(object lua_input) public void movie_setreadonly(object lua_input)
@ -3021,14 +3021,14 @@ namespace BizHawk.MultiClient
public void movie_setrerecordcounting(object lua_input) public void movie_setrerecordcounting(object lua_input)
{ {
if (lua_input.ToString().ToUpper() == "TRUE" || lua_input.ToString() == "1") if (lua_input.ToString().ToUpper() == "TRUE" || lua_input.ToString() == "1")
GlobalWinF.MovieSession.Movie.IsCountingRerecords = true; Global.MovieSession.Movie.IsCountingRerecords = true;
else else
GlobalWinF.MovieSession.Movie.IsCountingRerecords = false; Global.MovieSession.Movie.IsCountingRerecords = false;
} }
public void movie_stop() public void movie_stop()
{ {
GlobalWinF.MovieSession.Movie.Stop(); Global.MovieSession.Movie.Stop();
} }
#endregion #endregion

View File

@ -10,7 +10,7 @@ namespace BizHawk.MultiClient
{ {
public StateVisualizer() public StateVisualizer()
{ {
TimeLine movietimeline = new TimeLine(GlobalWinF.MovieSession.Movie.LogDump); TimeLine movietimeline = new TimeLine(Global.MovieSession.Movie.LogDump);
Timelines = new List<TimeLine> {movietimeline}; Timelines = new List<TimeLine> {movietimeline};
@ -32,7 +32,7 @@ namespace BizHawk.MultiClient
{ {
using (var reader = new StreamReader(path)) using (var reader = new StreamReader(path))
{ {
movie.LoadLogFromSavestateText(reader, GlobalWinF.MovieSession.MultiTrack.IsActive); movie.LoadLogFromSavestateText(reader, Global.MovieSession.MultiTrack.IsActive);
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -62,7 +62,7 @@ namespace BizHawk.MultiClient
{ {
if (!IsHandleCreated || IsDisposed) return; if (!IsHandleCreated || IsDisposed) return;
TASView.BlazingFast = true; TASView.BlazingFast = true;
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
DisplayList(); DisplayList();
} }
@ -71,7 +71,7 @@ namespace BizHawk.MultiClient
TASView.ItemCount = 0; TASView.ItemCount = 0;
} }
if (GlobalWinF.MovieSession.Movie.IsPlaying && !GlobalWinF.MovieSession.Movie.IsFinished) if (Global.MovieSession.Movie.IsPlaying && !Global.MovieSession.Movie.IsFinished)
{ {
TASView.BlazingFast = false; TASView.BlazingFast = false;
} }
@ -99,21 +99,21 @@ namespace BizHawk.MultiClient
private void TASView_QueryItemBkColor(int index, int column, ref Color color) private void TASView_QueryItemBkColor(int index, int column, ref Color color)
{ {
if (index == 0 && GlobalWinF.MovieSession.Movie.StateFirstIndex == 0) if (index == 0 && Global.MovieSession.Movie.StateFirstIndex == 0)
{ {
if (color != Color.LightGreen) if (color != Color.LightGreen)
{ {
color = Color.LightGreen; //special case for frame 0. Normally we need to go back an extra frame, but for frame 0 we can reload the rom. color = Color.LightGreen; //special case for frame 0. Normally we need to go back an extra frame, but for frame 0 we can reload the rom.
} }
} }
else if (GlobalWinF.MovieSession.Movie.FrameLagged(index)) else if (Global.MovieSession.Movie.FrameLagged(index))
{ {
if (color != Color.Pink) if (color != Color.Pink)
{ {
color = Color.Pink; color = Color.Pink;
} }
} }
else if (index > GlobalWinF.MovieSession.Movie.StateFirstIndex && index <= GlobalWinF.MovieSession.Movie.StateLastIndex) else if (index > Global.MovieSession.Movie.StateFirstIndex && index <= Global.MovieSession.Movie.StateLastIndex)
{ {
if (color != Color.LightGreen) if (color != Color.LightGreen)
{ {
@ -134,19 +134,19 @@ namespace BizHawk.MultiClient
text = ""; text = "";
//If this is just for an actual frame and not just the list view cursor at the end //If this is just for an actual frame and not just the list view cursor at the end
if (GlobalWinF.MovieSession.Movie.Frames != index) if (Global.MovieSession.Movie.Frames != index)
{ {
if (column == 0) if (column == 0)
text = String.Format("{0:#,##0}", index); text = String.Format("{0:#,##0}", index);
if (column == 1) if (column == 1)
text = GlobalWinF.MovieSession.Movie.GetInput(index); text = Global.MovieSession.Movie.GetInput(index);
} }
} }
private void DisplayList() private void DisplayList()
{ {
TASView.ItemCount = GlobalWinF.MovieSession.Movie.RawFrames; TASView.ItemCount = Global.MovieSession.Movie.RawFrames;
if (GlobalWinF.MovieSession.Movie.Frames == Global.Emulator.Frame && GlobalWinF.MovieSession.Movie.StateLastIndex == Global.Emulator.Frame - 1) if (Global.MovieSession.Movie.Frames == Global.Emulator.Frame && Global.MovieSession.Movie.StateLastIndex == Global.Emulator.Frame - 1)
{ {
//If we're at the end of the movie add one to show the cursor as a blank frame //If we're at the end of the movie add one to show the cursor as a blank frame
TASView.ItemCount++; TASView.ItemCount++;
@ -168,9 +168,9 @@ namespace BizHawk.MultiClient
GlobalWinF.MainForm.PauseEmulator(); GlobalWinF.MainForm.PauseEmulator();
Engaged = true; Engaged = true;
GlobalWinF.OSD.AddMessage("TAStudio engaged"); GlobalWinF.OSD.AddMessage("TAStudio engaged");
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
GlobalWinF.MovieSession.Movie.StateCapturing = true; Global.MovieSession.Movie.StateCapturing = true;
ReadOnlyCheckBox.Checked = GlobalWinF.MainForm.ReadOnly; ReadOnlyCheckBox.Checked = GlobalWinF.MainForm.ReadOnly;
} }
else else
@ -259,12 +259,12 @@ namespace BizHawk.MultiClient
private void RewindButton_Click(object sender, EventArgs e) private void RewindButton_Click(object sender, EventArgs e)
{ {
stopOnFrame = 0; stopOnFrame = 0;
if (GlobalWinF.MovieSession.Movie.IsFinished || !GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsFinished || !Global.MovieSession.Movie.IsActive)
{ {
GlobalWinF.MainForm.Rewind(1); GlobalWinF.MainForm.Rewind(1);
if (Global.Emulator.Frame <= GlobalWinF.MovieSession.Movie.Frames) if (Global.Emulator.Frame <= Global.MovieSession.Movie.Frames)
{ {
GlobalWinF.MovieSession.Movie.SwitchToPlay(); Global.MovieSession.Movie.SwitchToPlay();
} }
} }
else else
@ -291,9 +291,9 @@ namespace BizHawk.MultiClient
GlobalWinF.MainForm.SetReadOnly(true); GlobalWinF.MainForm.SetReadOnly(true);
ReadOnlyCheckBox.BackColor = SystemColors.Control; ReadOnlyCheckBox.BackColor = SystemColors.Control;
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
GlobalWinF.MovieSession.Movie.SwitchToPlay(); Global.MovieSession.Movie.SwitchToPlay();
toolTip1.SetToolTip(ReadOnlyCheckBox, "Currently Read-Only Mode"); toolTip1.SetToolTip(ReadOnlyCheckBox, "Currently Read-Only Mode");
} }
} }
@ -301,9 +301,9 @@ namespace BizHawk.MultiClient
{ {
GlobalWinF.MainForm.SetReadOnly(false); GlobalWinF.MainForm.SetReadOnly(false);
ReadOnlyCheckBox.BackColor = Color.LightCoral; ReadOnlyCheckBox.BackColor = Color.LightCoral;
if (GlobalWinF.MovieSession.Movie.IsActive) if (Global.MovieSession.Movie.IsActive)
{ {
GlobalWinF.MovieSession.Movie.SwitchToRecord(); Global.MovieSession.Movie.SwitchToRecord();
toolTip1.SetToolTip(ReadOnlyCheckBox, "Currently Read+Write Mode"); toolTip1.SetToolTip(ReadOnlyCheckBox, "Currently Read+Write Mode");
} }
} }
@ -381,7 +381,7 @@ namespace BizHawk.MultiClient
private void saveProjectToolStripMenuItem_Click(object sender, EventArgs e) private void saveProjectToolStripMenuItem_Click(object sender, EventArgs e)
{ {
GlobalWinF.MovieSession.Movie.WriteMovie(); Global.MovieSession.Movie.WriteMovie();
} }
private void saveProjectAsToolStripMenuItem_Click(object sender, EventArgs e) private void saveProjectAsToolStripMenuItem_Click(object sender, EventArgs e)
@ -390,8 +390,8 @@ namespace BizHawk.MultiClient
if ("" != fileName) if ("" != fileName)
{ {
GlobalWinF.MovieSession.Movie.Filename = fileName; Global.MovieSession.Movie.Filename = fileName;
GlobalWinF.MovieSession.Movie.WriteMovie(); Global.MovieSession.Movie.WriteMovie();
} }
} }
@ -424,14 +424,14 @@ namespace BizHawk.MultiClient
private void TASView_DoubleClick(object sender, EventArgs e) private void TASView_DoubleClick(object sender, EventArgs e)
{ {
if (TASView.selectedItem <= GlobalWinF.MovieSession.Movie.StateLastIndex) if (TASView.selectedItem <= Global.MovieSession.Movie.StateLastIndex)
{ {
stopOnFrame = 0; stopOnFrame = 0;
RewindToFrame(TASView.selectedItem); RewindToFrame(TASView.selectedItem);
} }
else else
{ {
RewindToFrame(GlobalWinF.MovieSession.Movie.StateLastIndex); RewindToFrame(Global.MovieSession.Movie.StateLastIndex);
stopOnFrame = TASView.selectedItem; stopOnFrame = TASView.selectedItem;
GlobalWinF.MainForm.PressFrameAdvance = true; GlobalWinF.MainForm.PressFrameAdvance = true;
} }
@ -455,7 +455,7 @@ namespace BizHawk.MultiClient
{ {
InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPath, null), InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPath, null),
DefaultExt = "." + Global.Config.MovieExtension, DefaultExt = "." + Global.Config.MovieExtension,
FileName = GlobalWinF.MovieSession.Movie.Filename FileName = Global.MovieSession.Movie.Filename
}; };
string filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*"; string filter = "Movie Files (*." + Global.Config.MovieExtension + ")|*." + Global.Config.MovieExtension + "|Savestates|*.state|All Files|*.*";
sfd.Filter = filter; sfd.Filter = filter;
@ -537,7 +537,7 @@ namespace BizHawk.MultiClient
ListView.SelectedIndexCollection list = TASView.SelectedIndices; ListView.SelectedIndexCollection list = TASView.SelectedIndices;
for (int index = 0; index < list.Count; index++) for (int index = 0; index < list.Count; index++)
{ {
GlobalWinF.MovieSession.Movie.InsertBlankFrame(list[index]); Global.MovieSession.Movie.InsertBlankFrame(list[index]);
} }
UpdateValues(); UpdateValues();
@ -545,18 +545,18 @@ namespace BizHawk.MultiClient
private void RewindToFrame(int frame) private void RewindToFrame(int frame)
{ {
if (!GlobalWinF.MovieSession.Movie.IsActive || GlobalWinF.MovieSession.Movie.IsFinished) if (!Global.MovieSession.Movie.IsActive || Global.MovieSession.Movie.IsFinished)
{ {
return; return;
} }
else if (frame <= Global.Emulator.Frame) else if (frame <= Global.Emulator.Frame)
{ {
if (frame <= GlobalWinF.MovieSession.Movie.StateFirstIndex) if (frame <= Global.MovieSession.Movie.StateFirstIndex)
{ {
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(GlobalWinF.MovieSession.Movie.InitState))); Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(Global.MovieSession.Movie.InitState)));
if (GlobalWinF.MovieSession.Movie.IsRecording) if (Global.MovieSession.Movie.IsRecording)
{ {
GlobalWinF.MovieSession.Movie.StartPlayback(); Global.MovieSession.Movie.StartPlayback();
GlobalWinF.MainForm.RestoreReadWriteOnStop = true; GlobalWinF.MainForm.RestoreReadWriteOnStop = true;
} }
} }
@ -564,19 +564,19 @@ namespace BizHawk.MultiClient
{ {
if (frame == 0) if (frame == 0)
{ {
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(GlobalWinF.MovieSession.Movie.InitState))); Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(Global.MovieSession.Movie.InitState)));
} }
else else
{ {
//frame-1 because we need to go back an extra frame and then run a frame, otherwise the display doesn't get updated. //frame-1 because we need to go back an extra frame and then run a frame, otherwise the display doesn't get updated.
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(GlobalWinF.MovieSession.Movie.GetState(frame - 1)))); Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(Global.MovieSession.Movie.GetState(frame - 1))));
GlobalWinF.MainForm.UpdateFrame = true; GlobalWinF.MainForm.UpdateFrame = true;
} }
} }
} }
else if (frame <= GlobalWinF.MovieSession.Movie.StateLastIndex) else if (frame <= Global.MovieSession.Movie.StateLastIndex)
{ {
Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(GlobalWinF.MovieSession.Movie.GetState(frame - 1)))); Global.Emulator.LoadStateBinary(new BinaryReader(new MemoryStream(Global.MovieSession.Movie.GetState(frame - 1))));
GlobalWinF.MainForm.UpdateFrame = true; GlobalWinF.MainForm.UpdateFrame = true;
} }
else else
@ -587,9 +587,9 @@ namespace BizHawk.MultiClient
public void DeleteFrame(int frame) public void DeleteFrame(int frame)
{ {
if (frame <= GlobalWinF.MovieSession.Movie.StateLastIndex) if (frame <= Global.MovieSession.Movie.StateLastIndex)
{ {
if (frame <= GlobalWinF.MovieSession.Movie.StateFirstIndex) if (frame <= Global.MovieSession.Movie.StateFirstIndex)
{ {
RewindToFrame(0); RewindToFrame(0);
} }
@ -598,7 +598,7 @@ namespace BizHawk.MultiClient
RewindToFrame(frame); RewindToFrame(frame);
} }
} }
GlobalWinF.MovieSession.Movie.DeleteFrame(frame); Global.MovieSession.Movie.DeleteFrame(frame);
} }
private void DeleteFrames() private void DeleteFrames()
@ -606,7 +606,7 @@ namespace BizHawk.MultiClient
ListView.SelectedIndexCollection list = TASView.SelectedIndices; ListView.SelectedIndexCollection list = TASView.SelectedIndices;
foreach (object t in list) foreach (object t in list)
{ {
GlobalWinF.MovieSession.Movie.DeleteFrame(list[0]); //TODO: this doesn't allow of non-continuous deletion, instead it should iterate from last to first and remove the iterated value Global.MovieSession.Movie.DeleteFrame(list[0]); //TODO: this doesn't allow of non-continuous deletion, instead it should iterate from last to first and remove the iterated value
} }
UpdateValues(); UpdateValues();
@ -617,7 +617,7 @@ namespace BizHawk.MultiClient
ListView.SelectedIndexCollection list = TASView.SelectedIndices; ListView.SelectedIndexCollection list = TASView.SelectedIndices;
for (int index = 0; index < list.Count; index++) for (int index = 0; index < list.Count; index++)
{ {
GlobalWinF.MovieSession.Movie.InsertFrame(GlobalWinF.MovieSession.Movie.GetInput(list[index]), list[index]); Global.MovieSession.Movie.InsertFrame(Global.MovieSession.Movie.GetInput(list[index]), list[index]);
} }
UpdateValues(); UpdateValues();
@ -628,7 +628,7 @@ namespace BizHawk.MultiClient
ListView.SelectedIndexCollection list = TASView.SelectedIndices; ListView.SelectedIndexCollection list = TASView.SelectedIndices;
for (int index = 0; index < list.Count; index++) for (int index = 0; index < list.Count; index++)
{ {
GlobalWinF.MovieSession.Movie.ClearFrame(list[index]); Global.MovieSession.Movie.ClearFrame(list[index]);
} }
UpdateValues(); UpdateValues();
@ -649,7 +649,7 @@ namespace BizHawk.MultiClient
int frames = int.Parse(prompt.UserText); int frames = int.Parse(prompt.UserText);
for (int i = 0; i < frames; i++) for (int i = 0; i < frames; i++)
{ {
GlobalWinF.MovieSession.Movie.InsertBlankFrame(list[0] + i); Global.MovieSession.Movie.InsertBlankFrame(list[0] + i);
} }
} }
} }
@ -694,7 +694,7 @@ namespace BizHawk.MultiClient
ListView.SelectedIndexCollection list = TASView.SelectedIndices; ListView.SelectedIndexCollection list = TASView.SelectedIndices;
if (list.Count > 0) if (list.Count > 0)
{ {
GlobalWinF.MovieSession.Movie.TruncateMovie(list[0]); Global.MovieSession.Movie.TruncateMovie(list[0]);
UpdateValues(); UpdateValues();
} }
} }
@ -715,7 +715,7 @@ namespace BizHawk.MultiClient
ListView.SelectedIndexCollection list = TASView.SelectedIndices; ListView.SelectedIndexCollection list = TASView.SelectedIndices;
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
{ {
ClipboardEntry entry = new ClipboardEntry {Frame = list[i], Inputstr = GlobalWinF.MovieSession.Movie.GetInput(list[i])}; ClipboardEntry entry = new ClipboardEntry {Frame = list[i], Inputstr = Global.MovieSession.Movie.GetInput(list[i])};
Clipboard.Add(entry); Clipboard.Add(entry);
} }
UpdateSlicerDisplay(); UpdateSlicerDisplay();
@ -760,7 +760,7 @@ namespace BizHawk.MultiClient
{ {
for (int i = 0; i < Clipboard.Count; i++) for (int i = 0; i < Clipboard.Count; i++)
{ {
GlobalWinF.MovieSession.Movie.ModifyFrame(Clipboard[i].Inputstr, list[0] + i); Global.MovieSession.Movie.ModifyFrame(Clipboard[i].Inputstr, list[0] + i);
} }
} }
UpdateValues(); UpdateValues();
@ -773,7 +773,7 @@ namespace BizHawk.MultiClient
{ {
for (int i = 0; i < Clipboard.Count; i++) for (int i = 0; i < Clipboard.Count; i++)
{ {
GlobalWinF.MovieSession.Movie.InsertFrame(Clipboard[i].Inputstr, list[0] + i); Global.MovieSession.Movie.InsertFrame(Clipboard[i].Inputstr, list[0] + i);
} }
} }
UpdateValues(); UpdateValues();
@ -797,7 +797,7 @@ namespace BizHawk.MultiClient
Clipboard.Clear(); Clipboard.Clear();
for (int i = 0; i < list.Count; i++) for (int i = 0; i < list.Count; i++)
{ {
ClipboardEntry entry = new ClipboardEntry {Frame = list[i], Inputstr = GlobalWinF.MovieSession.Movie.GetInput(list[i])}; ClipboardEntry entry = new ClipboardEntry {Frame = list[i], Inputstr = Global.MovieSession.Movie.GetInput(list[i])};
Clipboard.Add(entry); Clipboard.Add(entry);
DeleteFrame(list[0]); DeleteFrame(list[0]);
} }

View File

@ -254,9 +254,9 @@ namespace BizHawk.MultiClient
{ {
if (!IsHandleCreated || IsDisposed) return; if (!IsHandleCreated || IsDisposed) return;
if (GlobalWinF.MovieSession.Movie.IsPlaying && !GlobalWinF.MovieSession.Movie.IsFinished) if (Global.MovieSession.Movie.IsPlaying && !Global.MovieSession.Movie.IsFinished)
{ {
string str = GlobalWinF.MovieSession.Movie.GetInput(Global.Emulator.Frame); string str = Global.MovieSession.Movie.GetInput(Global.Emulator.Frame);
if (Global.Config.TASUpdatePads && str != "") if (Global.Config.TASUpdatePads && str != "")
{ {
switch (Global.Emulator.SystemId) switch (Global.Emulator.SystemId)