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; }
bool Load();
void Save();
void SaveAs();
string GetInputLog();
bool CheckTimeLines(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;
if (Global.Config.EnableBackupMovies && MakeBackup && _log.Length > 0)
{
SaveAs();
SaveBackup();
MakeBackup = false;
}
@ -158,6 +158,7 @@ namespace BizHawk.Client.Common
public void SaveAs(string path)
{
Filename = path;
if (!Loaded)
{
return;
@ -183,7 +184,7 @@ namespace BizHawk.Client.Common
_changes = false;
}
public void SaveAs()
public void SaveBackup()
{
if (!Loaded || String.IsNullOrWhiteSpace(Filename))
{
@ -407,7 +408,7 @@ namespace BizHawk.Client.Common
{
if (Global.Config.EnableBackupMovies && MakeBackup && _log.Length > 0)
{
SaveAs();
SaveBackup();
MakeBackup = false;
}

View File

@ -99,7 +99,7 @@ namespace BizHawk.Client.Common
public bool IsPlaying
{
get { return _mode == Moviemode.Play || _mode == Moviemode.Finished; }
get { return _mode == Moviemode.Play; }
}
public bool IsRecording
@ -109,7 +109,7 @@ namespace BizHawk.Client.Common
public bool IsFinished
{
get { return _mode == Moviemode.Finished; }
get { return false; } //a TasMovie is never in this mode.
}
public bool IsCountingRerecords { get; set; }
@ -256,12 +256,15 @@ namespace BizHawk.Client.Common
}
}
// TODO:
public double Fps
{
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;
}
public void SaveAs()
{
Changes = false;
throw new NotImplementedException();
}
public bool CheckTimeLines(TextReader reader, out string errorMessage)
{
throw new NotImplementedException();

View File

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