Remove SaveAs from IMovie, the only usage it had in that context was to make backups and was erroneously named in that context. Made is a Movie.cs implementation only and disabled the menu item option if the movie is a TasMovie (TAStudio will be in charge of backup logic)

This commit is contained in:
adelikat 2013-12-10 17:59:04 +00:00
parent e95d7b8cd7
commit 18c50a55fe
4 changed files with 18 additions and 17 deletions

View File

@ -52,7 +52,6 @@ namespace BizHawk.Client.Common
string Filename { get; set; } string Filename { get; set; }
bool Load(); bool Load();
void Save(); void Save();
void SaveAs();
string GetInputLog(); string GetInputLog();
bool CheckTimeLines(TextReader reader, out string errorMessage); bool CheckTimeLines(TextReader reader, out string errorMessage);
bool ExtractInputLog(TextReader reader, out string errorMessage); bool ExtractInputLog(TextReader reader, out string errorMessage);

View File

@ -103,7 +103,7 @@ namespace BizHawk.Client.Common
_mode = Moviemode.Record; _mode = Moviemode.Record;
if (Global.Config.EnableBackupMovies && MakeBackup && _log.Length > 0) if (Global.Config.EnableBackupMovies && MakeBackup && _log.Length > 0)
{ {
SaveAs(); SaveBackup();
MakeBackup = false; MakeBackup = false;
} }
@ -158,6 +158,7 @@ namespace BizHawk.Client.Common
public void SaveAs(string path) public void SaveAs(string path)
{ {
Filename = path;
if (!Loaded) if (!Loaded)
{ {
return; return;
@ -183,7 +184,7 @@ namespace BizHawk.Client.Common
_changes = false; _changes = false;
} }
public void SaveAs() public void SaveBackup()
{ {
if (!Loaded || String.IsNullOrWhiteSpace(Filename)) if (!Loaded || String.IsNullOrWhiteSpace(Filename))
{ {
@ -407,7 +408,7 @@ namespace BizHawk.Client.Common
{ {
if (Global.Config.EnableBackupMovies && MakeBackup && _log.Length > 0) if (Global.Config.EnableBackupMovies && MakeBackup && _log.Length > 0)
{ {
SaveAs(); SaveBackup();
MakeBackup = false; MakeBackup = false;
} }

View File

@ -99,7 +99,7 @@ namespace BizHawk.Client.Common
public bool IsPlaying public bool IsPlaying
{ {
get { return _mode == Moviemode.Play || _mode == Moviemode.Finished; } get { return _mode == Moviemode.Play; }
} }
public bool IsRecording public bool IsRecording
@ -109,7 +109,7 @@ namespace BizHawk.Client.Common
public bool IsFinished public bool IsFinished
{ {
get { return _mode == Moviemode.Finished; } get { return false; } //a TasMovie is never in this mode.
} }
public bool IsCountingRerecords { get; set; } public bool IsCountingRerecords { get; set; }
@ -256,12 +256,15 @@ namespace BizHawk.Client.Common
} }
} }
// TODO:
public double Fps public double Fps
{ {
get get
{ {
throw new NotImplementedException(); var system = Header[HeaderKeys.PLATFORM];
var pal = Header.ContainsKey(HeaderKeys.PAL) &&
Header[HeaderKeys.PAL] == "1";
return _frameRates[system, pal];
} }
} }
@ -386,12 +389,6 @@ namespace BizHawk.Client.Common
Changes = false; Changes = false;
} }
public void SaveAs()
{
Changes = false;
throw new NotImplementedException();
}
public bool CheckTimeLines(TextReader reader, out string errorMessage) public bool CheckTimeLines(TextReader reader, out string errorMessage)
{ {
throw new NotImplementedException(); throw new NotImplementedException();

View File

@ -1746,12 +1746,13 @@ namespace BizHawk.Client.EmuHawk
RestartMovieContextMenuItem.Visible = RestartMovieContextMenuItem.Visible =
StopMovieContextMenuItem.Visible = StopMovieContextMenuItem.Visible =
BackupMovieContextMenuItem.Visible =
ViewSubtitlesContextMenuItem.Visible = ViewSubtitlesContextMenuItem.Visible =
ViewCommentsContextMenuItem.Visible = ViewCommentsContextMenuItem.Visible =
SaveMovieContextMenuItem.Visible = SaveMovieContextMenuItem.Visible =
Global.MovieSession.Movie.IsActive; Global.MovieSession.Movie.IsActive;
BackupMovieContextMenuItem.Visible = Global.MovieSession.Movie is Movie && Global.MovieSession.Movie.IsActive;
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.MovieSession.ReadOnly; AddSubtitleContextMenuItem.Visible = !(Global.Emulator is NullEmulator) && Global.MovieSession.Movie.IsActive && Global.MovieSession.ReadOnly;
@ -1832,9 +1833,12 @@ namespace BizHawk.Client.EmuHawk
} }
private void BackupMovieContextMenuItem_Click(object sender, EventArgs e) private void BackupMovieContextMenuItem_Click(object sender, EventArgs e)
{
if (Global.MovieSession.Movie is Movie)
{ {
GlobalWin.OSD.AddMessage("Backup movie saved."); GlobalWin.OSD.AddMessage("Backup movie saved.");
Global.MovieSession.Movie.SaveAs(); (Global.MovieSession.Movie as Movie).SaveBackup();
}
} }
private void ViewSubtitlesContextMenuItem_Click(object sender, EventArgs e) private void ViewSubtitlesContextMenuItem_Click(object sender, EventArgs e)