Move the readonly flag from Global to MovieSession
This commit is contained in:
parent
a03213e0e4
commit
b7d553cb4e
|
@ -20,7 +20,6 @@ namespace BizHawk.Client.Common
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static MultitrackRewiringControllerAdapter MultitrackRewiringControllerAdapter = new MultitrackRewiringControllerAdapter();
|
public static MultitrackRewiringControllerAdapter MultitrackRewiringControllerAdapter = new MultitrackRewiringControllerAdapter();
|
||||||
public static MovieSession MovieSession = new MovieSession();
|
public static MovieSession MovieSession = new MovieSession();
|
||||||
public static bool ReadOnly = true; //Global Movie Read only setting
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// whether throttling is force-disabled by use of fast forward
|
/// whether throttling is force-disabled by use of fast forward
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public static bool movie_getreadonly()
|
public static bool movie_getreadonly()
|
||||||
{
|
{
|
||||||
return Global.ReadOnly;
|
return Global.MovieSession.ReadOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool movie_getrerecordcounting()
|
public static bool movie_getrerecordcounting()
|
||||||
|
@ -103,7 +103,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
public static void movie_setreadonly(object lua_input)
|
public static void movie_setreadonly(object lua_input)
|
||||||
{
|
{
|
||||||
Global.ReadOnly = (lua_input.ToString().ToUpper() == "TRUE"
|
Global.MovieSession.ReadOnly = (lua_input.ToString().ToUpper() == "TRUE"
|
||||||
|| lua_input.ToString() == "1");
|
|| lua_input.ToString() == "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,8 @@ namespace BizHawk.Client.Common
|
||||||
#region Dubious, should reconsider
|
#region Dubious, should reconsider
|
||||||
|
|
||||||
LoadStateResult CheckTimeLines(TextReader reader, bool onlyGuid, bool ignoreGuidMismatch, out string errorMessage); // No need to return a status, no reason to have hacky flags, no need to pass a textreader
|
LoadStateResult CheckTimeLines(TextReader reader, bool onlyGuid, bool ignoreGuidMismatch, out string errorMessage); // No need to return a status, no reason to have hacky flags, no need to pass a textreader
|
||||||
void ExtractInputLog(TextReader reader, bool isMultitracking); // how about the movie know if it is multi-tracking rather than having to pass it in
|
|
||||||
|
void ExtractInputLog(TextReader reader); //Is passing a textreader the only reasonable way to do this?
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
|
@ -407,12 +407,12 @@ namespace BizHawk.Client.Common
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ExtractInputLog(TextReader reader, bool isMultitracking)
|
public void ExtractInputLog(TextReader reader)
|
||||||
{
|
{
|
||||||
int? stateFrame = null;
|
int? stateFrame = null;
|
||||||
|
|
||||||
// We are in record mode so replace the movie log with the one from the savestate
|
// We are in record mode so replace the movie log with the one from the savestate
|
||||||
if (!isMultitracking)
|
if (!Global.MovieSession.MultiTrack.IsActive)
|
||||||
{
|
{
|
||||||
if (Global.Config.EnableBackupMovies && MakeBackup && _log.Length > 0)
|
if (Global.Config.EnableBackupMovies && MakeBackup && _log.Length > 0)
|
||||||
{
|
{
|
||||||
|
@ -816,7 +816,7 @@ namespace BizHawk.Client.Common
|
||||||
var pal = Header.ContainsKey(HeaderKeys.PAL) &&
|
var pal = Header.ContainsKey(HeaderKeys.PAL) &&
|
||||||
Header[HeaderKeys.PAL] == "1";
|
Header[HeaderKeys.PAL] == "1";
|
||||||
|
|
||||||
return frames / FrameRates[system, pal];
|
return frames / _frameRates[system, pal];
|
||||||
}
|
}
|
||||||
|
|
||||||
public double Fps
|
public double Fps
|
||||||
|
@ -827,16 +827,12 @@ namespace BizHawk.Client.Common
|
||||||
var pal = Header.ContainsKey(HeaderKeys.PAL) &&
|
var pal = Header.ContainsKey(HeaderKeys.PAL) &&
|
||||||
Header[HeaderKeys.PAL] == "1";
|
Header[HeaderKeys.PAL] == "1";
|
||||||
|
|
||||||
return FrameRates[system, pal];
|
return _frameRates[system, pal];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private readonly PlatformFrameRates _frameRates = new PlatformFrameRates();
|
private readonly PlatformFrameRates _frameRates = new PlatformFrameRates();
|
||||||
public PlatformFrameRates FrameRates
|
|
||||||
{
|
|
||||||
get { return _frameRates; }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -13,6 +13,8 @@ namespace BizHawk.Client.Common
|
||||||
public Action<string> MessageCallback; //Not Required
|
public Action<string> MessageCallback; //Not Required
|
||||||
public Func<string, string, bool> AskYesNoCallback; //Not Required
|
public Func<string, string, bool> AskYesNoCallback; //Not Required
|
||||||
|
|
||||||
|
public bool ReadOnly = true;
|
||||||
|
|
||||||
private void Output(string message)
|
private void Output(string message)
|
||||||
{
|
{
|
||||||
if (MessageCallback != null)
|
if (MessageCallback != null)
|
||||||
|
@ -69,9 +71,7 @@ namespace BizHawk.Client.Common
|
||||||
// Attempting to get a frame past the end of a movie changes the mode to finished
|
// Attempting to get a frame past the end of a movie changes the mode to finished
|
||||||
if (!Movie.IsFinished)
|
if (!Movie.IsFinished)
|
||||||
{
|
{
|
||||||
MovieControllerAdapter.SetControllersAsMnemonic(
|
MovieControllerAdapter.SetControllersAsMnemonic(input);
|
||||||
Movie.GetInput(Global.Emulator.Frame)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ namespace BizHawk.Client.Common
|
||||||
Output(Path.GetFileName(Movie.Filename) + " written to disk.");
|
Output(Path.GetFileName(Movie.Filename) + " written to disk.");
|
||||||
}
|
}
|
||||||
Output(message);
|
Output(message);
|
||||||
Global.ReadOnly = true;
|
ReadOnly = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ namespace BizHawk.Client.Common
|
||||||
if (Movie.IsPlaying)
|
if (Movie.IsPlaying)
|
||||||
{
|
{
|
||||||
Movie.ClearFrame(Global.Emulator.Frame);
|
Movie.ClearFrame(Global.Emulator.Frame);
|
||||||
Output("Scrubbed input at frame " + Global.Emulator.Frame.ToString());
|
Output("Scrubbed input at frame " + Global.Emulator.Frame);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,8 +179,9 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
LatchInputFromPlayer(Global.MovieInputSourceAdapter);
|
LatchInputFromPlayer(Global.MovieInputSourceAdapter);
|
||||||
}
|
}
|
||||||
//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
|
// 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
|
||||||
var mg = new MnemonicsGenerator();
|
var mg = new MnemonicsGenerator();
|
||||||
mg.SetSource(Global.MovieOutputHardpoint);
|
mg.SetSource(Global.MovieOutputHardpoint);
|
||||||
Movie.RecordFrame(Global.Emulator.Frame, mg);
|
Movie.RecordFrame(Global.Emulator.Frame, mg);
|
||||||
|
@ -191,7 +192,7 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
using (var sr = new StreamReader(path))
|
using (var sr = new StreamReader(path))
|
||||||
{
|
{
|
||||||
return Global.MovieSession.HandleMovieLoadState(sr);
|
return HandleMovieLoadState(sr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +208,7 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
else if (Movie.IsRecording)
|
else if (Movie.IsRecording)
|
||||||
{
|
{
|
||||||
if (Global.ReadOnly)
|
if (ReadOnly)
|
||||||
{
|
{
|
||||||
var result = Movie.CheckTimeLines(reader, onlyGuid: false, ignoreGuidMismatch: false, errorMessage: out ErrorMSG);
|
var result = Movie.CheckTimeLines(reader, onlyGuid: false, ignoreGuidMismatch: false, errorMessage: out ErrorMSG);
|
||||||
if (result == LoadStateResult.Pass)
|
if (result == LoadStateResult.Pass)
|
||||||
|
@ -255,7 +256,7 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
reader.BaseStream.Position = 0;
|
reader.BaseStream.Position = 0;
|
||||||
reader.DiscardBufferedData();
|
reader.DiscardBufferedData();
|
||||||
Movie.ExtractInputLog(reader, MultiTrack.IsActive);
|
Movie.ExtractInputLog(reader);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -268,7 +269,7 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
reader.BaseStream.Position = 0;
|
reader.BaseStream.Position = 0;
|
||||||
reader.DiscardBufferedData();
|
reader.DiscardBufferedData();
|
||||||
Movie.ExtractInputLog(reader, MultiTrack.IsActive);
|
Movie.ExtractInputLog(reader);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -293,9 +294,9 @@ namespace BizHawk.Client.Common
|
||||||
|
|
||||||
else if (Movie.IsPlaying && !Movie.IsFinished)
|
else if (Movie.IsPlaying && !Movie.IsFinished)
|
||||||
{
|
{
|
||||||
if (Global.ReadOnly)
|
if (ReadOnly)
|
||||||
{
|
{
|
||||||
var result = Movie.CheckTimeLines(reader, onlyGuid: !Global.ReadOnly, ignoreGuidMismatch: false, errorMessage: out ErrorMSG);
|
var result = Movie.CheckTimeLines(reader, onlyGuid: !ReadOnly, ignoreGuidMismatch: false, errorMessage: out ErrorMSG);
|
||||||
if (result == LoadStateResult.Pass)
|
if (result == 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
|
||||||
|
@ -307,7 +308,7 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
if (HandleGuidError())
|
if (HandleGuidError())
|
||||||
{
|
{
|
||||||
var newresult = Movie.CheckTimeLines(reader, onlyGuid: !Global.ReadOnly, ignoreGuidMismatch: true, errorMessage: out ErrorMSG);
|
var newresult = Movie.CheckTimeLines(reader, onlyGuid: !ReadOnly, ignoreGuidMismatch: true, errorMessage: out ErrorMSG);
|
||||||
if (newresult == LoadStateResult.Pass)
|
if (newresult == LoadStateResult.Pass)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -332,13 +333,13 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var result = Movie.CheckTimeLines(reader, onlyGuid: !Global.ReadOnly, ignoreGuidMismatch: false, errorMessage: out ErrorMSG);
|
var result = Movie.CheckTimeLines(reader, onlyGuid: !ReadOnly, ignoreGuidMismatch: false, errorMessage: out ErrorMSG);
|
||||||
if (result == LoadStateResult.Pass)
|
if (result == LoadStateResult.Pass)
|
||||||
{
|
{
|
||||||
Movie.SwitchToRecord();
|
Movie.SwitchToRecord();
|
||||||
reader.BaseStream.Position = 0;
|
reader.BaseStream.Position = 0;
|
||||||
reader.DiscardBufferedData();
|
reader.DiscardBufferedData();
|
||||||
Movie.ExtractInputLog(reader, MultiTrack.IsActive);
|
Movie.ExtractInputLog(reader);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -347,13 +348,13 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
if (HandleGuidError())
|
if (HandleGuidError())
|
||||||
{
|
{
|
||||||
var newresult = Movie.CheckTimeLines(reader, onlyGuid: !Global.ReadOnly, ignoreGuidMismatch: true, errorMessage: out ErrorMSG);
|
var newresult = Movie.CheckTimeLines(reader, onlyGuid: !ReadOnly, ignoreGuidMismatch: true, errorMessage: out ErrorMSG);
|
||||||
if (newresult == LoadStateResult.Pass)
|
if (newresult == LoadStateResult.Pass)
|
||||||
{
|
{
|
||||||
Movie.SwitchToRecord();
|
Movie.SwitchToRecord();
|
||||||
reader.BaseStream.Position = 0;
|
reader.BaseStream.Position = 0;
|
||||||
reader.DiscardBufferedData();
|
reader.DiscardBufferedData();
|
||||||
Movie.ExtractInputLog(reader, MultiTrack.IsActive);
|
Movie.ExtractInputLog(reader);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -377,7 +378,7 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
else if (Movie.IsFinished)
|
else if (Movie.IsFinished)
|
||||||
{
|
{
|
||||||
if (Global.ReadOnly)
|
if (ReadOnly)
|
||||||
{
|
{
|
||||||
var result = Movie.CheckTimeLines(reader, onlyGuid: false, ignoreGuidMismatch: false, errorMessage: out ErrorMSG);
|
var result = Movie.CheckTimeLines(reader, onlyGuid: false, ignoreGuidMismatch: false, errorMessage: out ErrorMSG);
|
||||||
if (result != LoadStateResult.Pass)
|
if (result != LoadStateResult.Pass)
|
||||||
|
@ -420,14 +421,14 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var result = Movie.CheckTimeLines(reader, onlyGuid: !Global.ReadOnly, ignoreGuidMismatch: false, errorMessage: out ErrorMSG);
|
var result = Movie.CheckTimeLines(reader, onlyGuid: !ReadOnly, ignoreGuidMismatch: false, errorMessage: out ErrorMSG);
|
||||||
if (result == LoadStateResult.Pass)
|
if (result == LoadStateResult.Pass)
|
||||||
{
|
{
|
||||||
Global.Emulator.ClearSaveRam();
|
Global.Emulator.ClearSaveRam();
|
||||||
Movie.StartNewRecording();
|
Movie.StartNewRecording();
|
||||||
reader.BaseStream.Position = 0;
|
reader.BaseStream.Position = 0;
|
||||||
reader.DiscardBufferedData();
|
reader.DiscardBufferedData();
|
||||||
Movie.ExtractInputLog(reader, MultiTrack.IsActive);
|
Movie.ExtractInputLog(reader);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -436,14 +437,14 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
if (HandleGuidError())
|
if (HandleGuidError())
|
||||||
{
|
{
|
||||||
var newresult = Movie.CheckTimeLines(reader, onlyGuid: !Global.ReadOnly, ignoreGuidMismatch: true, errorMessage: out ErrorMSG);
|
var newresult = Movie.CheckTimeLines(reader, onlyGuid: !ReadOnly, ignoreGuidMismatch: true, errorMessage: out ErrorMSG);
|
||||||
if (newresult == LoadStateResult.Pass)
|
if (newresult == LoadStateResult.Pass)
|
||||||
{
|
{
|
||||||
Global.Emulator.ClearSaveRam();
|
Global.Emulator.ClearSaveRam();
|
||||||
Movie.StartNewRecording();
|
Movie.StartNewRecording();
|
||||||
reader.BaseStream.Position = 0;
|
reader.BaseStream.Position = 0;
|
||||||
reader.DiscardBufferedData();
|
reader.DiscardBufferedData();
|
||||||
Movie.ExtractInputLog(reader, MultiTrack.IsActive);
|
Movie.ExtractInputLog(reader);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -65,7 +65,6 @@ namespace BizHawk.Client.Common
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return new TimeSpan();
|
|
||||||
double dblseconds = GetSeconds(_records.Count);
|
double dblseconds = GetSeconds(_records.Count);
|
||||||
int seconds = (int)(dblseconds % 60);
|
int seconds = (int)(dblseconds % 60);
|
||||||
int days = seconds / 86400;
|
int days = seconds / 86400;
|
||||||
|
@ -139,34 +138,6 @@ namespace BizHawk.Client.Common
|
||||||
_records.Truncate(frame);
|
_records.Truncate(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO:
|
|
||||||
|
|
||||||
public void StartNewRecording()
|
|
||||||
{
|
|
||||||
SwitchToRecord();
|
|
||||||
if (Global.Config.EnableBackupMovies && true/*TODO*/ && _records.Any())
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Load()
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Save()
|
|
||||||
{
|
|
||||||
Changes = false;
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SaveAs()
|
|
||||||
{
|
|
||||||
Changes = false;
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ClearFrame(int frame)
|
public void ClearFrame(int frame)
|
||||||
{
|
{
|
||||||
if (frame < _records.Count)
|
if (frame < _records.Count)
|
||||||
|
@ -211,12 +182,40 @@ namespace BizHawk.Client.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO:
|
||||||
|
|
||||||
|
public void StartNewRecording()
|
||||||
|
{
|
||||||
|
SwitchToRecord();
|
||||||
|
if (Global.Config.EnableBackupMovies && true/*TODO*/ && _records.Any())
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Load()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Save()
|
||||||
|
{
|
||||||
|
Changes = false;
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SaveAs()
|
||||||
|
{
|
||||||
|
Changes = false;
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
public LoadStateResult CheckTimeLines(System.IO.TextReader reader, bool onlyGuid, bool ignoreGuidMismatch, out string errorMessage)
|
public LoadStateResult CheckTimeLines(System.IO.TextReader reader, bool onlyGuid, bool ignoreGuidMismatch, out string errorMessage)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ExtractInputLog(System.IO.TextReader reader, bool isMultitracking)
|
public void ExtractInputLog(System.IO.TextReader reader)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
= SaveMovieMenuItem.Enabled
|
= SaveMovieMenuItem.Enabled
|
||||||
= Global.MovieSession.Movie.IsActive;
|
= Global.MovieSession.Movie.IsActive;
|
||||||
|
|
||||||
ReadonlyMenuItem.Checked = Global.ReadOnly;
|
ReadonlyMenuItem.Checked = Global.MovieSession.ReadOnly;
|
||||||
BindSavestatesToMoviesMenuItem.Checked = Global.Config.BindSavestatesToMovies;
|
BindSavestatesToMoviesMenuItem.Checked = Global.Config.BindSavestatesToMovies;
|
||||||
AutomaticallyBackupMoviesMenuItem.Checked = Global.Config.EnableBackupMovies;
|
AutomaticallyBackupMoviesMenuItem.Checked = Global.Config.EnableBackupMovies;
|
||||||
FullMovieLoadstatesMenuItem.Checked = Global.Config.VBAStyleMovieLoadState;
|
FullMovieLoadstatesMenuItem.Checked = Global.Config.VBAStyleMovieLoadState;
|
||||||
|
@ -1760,7 +1760,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
StopNoSaveContextMenuItem.Visible = Global.MovieSession.Movie.IsActive && Global.MovieSession.Movie.Changes;
|
StopNoSaveContextMenuItem.Visible = Global.MovieSession.Movie.IsActive && Global.MovieSession.Movie.Changes;
|
||||||
|
|
||||||
AddSubtitleContextMenuItem.Visible = !(Global.Emulator is NullEmulator) && Global.MovieSession.Movie.IsActive && Global.ReadOnly;
|
AddSubtitleContextMenuItem.Visible = !(Global.Emulator is NullEmulator) && Global.MovieSession.Movie.IsActive && Global.MovieSession.ReadOnly;
|
||||||
|
|
||||||
ConfigContextMenuItem.Visible = _inFullscreen;
|
ConfigContextMenuItem.Visible = _inFullscreen;
|
||||||
|
|
||||||
|
@ -1773,7 +1773,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
if (Global.MovieSession.Movie.IsActive)
|
if (Global.MovieSession.Movie.IsActive)
|
||||||
{
|
{
|
||||||
if (Global.ReadOnly)
|
if (Global.MovieSession.ReadOnly)
|
||||||
{
|
{
|
||||||
ViewSubtitlesContextMenuItem.Text = "View Subtitles";
|
ViewSubtitlesContextMenuItem.Text = "View Subtitles";
|
||||||
ViewCommentsContextMenuItem.Text = "View Comments";
|
ViewCommentsContextMenuItem.Text = "View Comments";
|
||||||
|
@ -1847,7 +1847,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (Global.MovieSession.Movie.IsActive)
|
if (Global.MovieSession.Movie.IsActive)
|
||||||
{
|
{
|
||||||
var form = new EditSubtitlesForm { ReadOnly = Global.ReadOnly };
|
var form = new EditSubtitlesForm { ReadOnly = Global.MovieSession.ReadOnly };
|
||||||
form.GetMovie(Global.MovieSession.Movie);
|
form.GetMovie(Global.MovieSession.Movie);
|
||||||
form.ShowDialog();
|
form.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,16 +43,17 @@ namespace BizHawk.Client.EmuHawk
|
||||||
LoadStateFile(Global.MovieSession.Movie.Filename, Path.GetFileName(Global.MovieSession.Movie.Filename));
|
LoadStateFile(Global.MovieSession.Movie.Filename, Path.GetFileName(Global.MovieSession.Movie.Filename));
|
||||||
Global.Emulator.ResetCounters();
|
Global.Emulator.ResetCounters();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (record)
|
if (record)
|
||||||
{
|
{
|
||||||
Global.Emulator.ClearSaveRam();
|
|
||||||
Global.MovieSession.Movie.StartNewRecording();
|
Global.MovieSession.Movie.StartNewRecording();
|
||||||
Global.ReadOnly = false;
|
Global.MovieSession.ReadOnly = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Global.MovieSession.Movie.StartNewPlayback();
|
Global.MovieSession.Movie.StartNewPlayback();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetMainformMovieInfo();
|
SetMainformMovieInfo();
|
||||||
GlobalWin.Tools.Restart<TAStudio>();
|
GlobalWin.Tools.Restart<TAStudio>();
|
||||||
GlobalWin.Tools.Restart<VirtualPadForm>();
|
GlobalWin.Tools.Restart<VirtualPadForm>();
|
||||||
|
@ -117,10 +118,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
LoadStateFile(Global.MovieSession.Movie.Filename, Path.GetFileName(Global.MovieSession.Movie.Filename));
|
LoadStateFile(Global.MovieSession.Movie.Filename, Path.GetFileName(Global.MovieSession.Movie.Filename));
|
||||||
Global.Emulator.ResetCounters();
|
Global.Emulator.ResetCounters();
|
||||||
}
|
}
|
||||||
|
|
||||||
Global.MovieSession.Movie.StartNewPlayback();
|
Global.MovieSession.Movie.StartNewPlayback();
|
||||||
SetMainformMovieInfo();
|
SetMainformMovieInfo();
|
||||||
GlobalWin.OSD.AddMessage("Replaying movie file in read-only mode");
|
GlobalWin.OSD.AddMessage("Replaying movie file in read-only mode");
|
||||||
Global.ReadOnly = true;
|
Global.MovieSession.ReadOnly = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var movie = new Movie(cmdMovie);
|
var movie = new Movie(cmdMovie);
|
||||||
Global.ReadOnly = true;
|
Global.MovieSession.ReadOnly = true;
|
||||||
// if user is dumping and didnt supply dump length, make it as long as the loaded movie
|
// if user is dumping and didnt supply dump length, make it as long as the loaded movie
|
||||||
if (_autoDumpLength == 0)
|
if (_autoDumpLength == 0)
|
||||||
{
|
{
|
||||||
|
@ -1548,7 +1548,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Global.ReadOnly = true;
|
Global.MovieSession.ReadOnly = true;
|
||||||
StartNewMovie(movie, false);
|
StartNewMovie(movie, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2074,8 +2074,8 @@ namespace BizHawk.Client.EmuHawk
|
||||||
{
|
{
|
||||||
if (Global.MovieSession.Movie.IsActive)
|
if (Global.MovieSession.Movie.IsActive)
|
||||||
{
|
{
|
||||||
Global.ReadOnly ^= true;
|
Global.MovieSession.ReadOnly ^= true;
|
||||||
if (Global.ReadOnly)
|
if (Global.MovieSession.ReadOnly)
|
||||||
{
|
{
|
||||||
GlobalWin.OSD.AddMessage("Movie read-only mode");
|
GlobalWin.OSD.AddMessage("Movie read-only mode");
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void EditCommentsForm_Load(object sender, EventArgs e)
|
private void EditCommentsForm_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (Global.ReadOnly)
|
if (Global.MovieSession.ReadOnly)
|
||||||
{
|
{
|
||||||
CommentGrid.Columns[0].ReadOnly = true;
|
CommentGrid.Columns[0].ReadOnly = true;
|
||||||
Text = "View Comments";
|
Text = "View Comments";
|
||||||
|
@ -36,7 +36,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void OK_Click(object sender, EventArgs e)
|
private void OK_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!Global.ReadOnly)
|
if (!Global.MovieSession.ReadOnly)
|
||||||
{
|
{
|
||||||
_selectedMovie.Header.Comments.Clear();
|
_selectedMovie.Header.Comments.Clear();
|
||||||
for (int i = 0; i < CommentGrid.Rows.Count - 1; i++)
|
for (int i = 0; i < CommentGrid.Rows.Count - 1; i++)
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
|
|
||||||
private void OK_Click(object sender, EventArgs e)
|
private void OK_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Global.ReadOnly = ReadOnlyCheckBox.Checked;
|
Global.MovieSession.ReadOnly = ReadOnlyCheckBox.Checked;
|
||||||
Run();
|
Run();
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue