From 3ea79c720b985260639d6491e26b64d204a38b3d Mon Sep 17 00:00:00 2001 From: adelikat Date: Thu, 12 Jun 2014 21:45:47 +0000 Subject: [PATCH] More movies 2.0 stuff --- BizHawk.Client.Common/movie/HeaderKeys.cs | 3 --- BizHawk.Client.Common/movie/MovieImport.cs | 4 ---- BizHawk.Client.Common/movie/MovieService.cs | 12 ++++++++++++ BizHawk.Client.Common/movie/bkm/MovieHeader.cs | 1 - BizHawk.Client.EmuHawk/MainForm.cs | 14 ++++++-------- BizHawk.Client.EmuHawk/movie/PlayMovie.cs | 6 ------ 6 files changed, 18 insertions(+), 22 deletions(-) diff --git a/BizHawk.Client.Common/movie/HeaderKeys.cs b/BizHawk.Client.Common/movie/HeaderKeys.cs index bbf3fa0bf4..a6f42f73aa 100644 --- a/BizHawk.Client.Common/movie/HeaderKeys.cs +++ b/BizHawk.Client.Common/movie/HeaderKeys.cs @@ -4,9 +4,6 @@ namespace BizHawk.Client.Common { public static class HeaderKeys { - public const string MovieVersion1 = "BizHawk v0.0.1"; - public const string MovieVersion2 = "BizHawk v0.0.2"; - public const string EMULATIONVERSION = "emuVersion"; public const string MOVIEVERSION = "MovieVersion"; public const string PLATFORM = "Platform"; diff --git a/BizHawk.Client.Common/movie/MovieImport.cs b/BizHawk.Client.Common/movie/MovieImport.cs index 85abfe5a5c..446a4a2e43 100644 --- a/BizHawk.Client.Common/movie/MovieImport.cs +++ b/BizHawk.Client.Common/movie/MovieImport.cs @@ -119,10 +119,6 @@ namespace BizHawk.Client.Common m = ImportZMV(path, out errorMsg, out warningMsg); break; } - if (errorMsg == string.Empty) - { - m.Header[HeaderKeys.MOVIEVERSION] = HeaderKeys.MovieVersion1; - } } catch (Exception except) { diff --git a/BizHawk.Client.Common/movie/MovieService.cs b/BizHawk.Client.Common/movie/MovieService.cs index a4279bd146..12db16c250 100644 --- a/BizHawk.Client.Common/movie/MovieService.cs +++ b/BizHawk.Client.Common/movie/MovieService.cs @@ -39,5 +39,17 @@ namespace BizHawk.Client.Common yield return "tasproj"; } } + + /// + /// Creates a default instance of the default implementation, + /// no path is specified so this is in a minimal state that would not be able to be saved + /// + public static IMovie DefaultInstance + { + get + { + return new Movie(); + } + } } } diff --git a/BizHawk.Client.Common/movie/bkm/MovieHeader.cs b/BizHawk.Client.Common/movie/bkm/MovieHeader.cs index ff6b7efed7..31d7a695b5 100644 --- a/BizHawk.Client.Common/movie/bkm/MovieHeader.cs +++ b/BizHawk.Client.Common/movie/bkm/MovieHeader.cs @@ -11,7 +11,6 @@ namespace BizHawk.Client.Common Subtitles = new SubtitleList(); this[HeaderKeys.EMULATIONVERSION] = VersionInfo.GetEmuVersion(); - this[HeaderKeys.MOVIEVERSION] = HeaderKeys.MovieVersion1; this[HeaderKeys.PLATFORM] = Global.Emulator != null ? Global.Emulator.SystemId : string.Empty; this[HeaderKeys.GAMENAME] = string.Empty; this[HeaderKeys.AUTHOR] = string.Empty; diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 47850c897b..9117c3c534 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -78,7 +78,7 @@ namespace BizHawk.Client.EmuHawk Global.FirmwareManager = new FirmwareManager(); Global.MovieSession = new MovieSession { - Movie = new Movie(), + Movie = MovieService.DefaultInstance, MessageCallback = GlobalWin.OSD.AddMessage, AskYesNoCallback = StateErrorAskUser }; @@ -1439,17 +1439,15 @@ namespace BizHawk.Client.EmuHawk private void LoadMoviesFromRecent(string path) { - var movie = MovieService.Get(path); - - // Movies 2.0 TODO - if (!(movie as Movie).Loaded) + if (File.Exists(path)) { - ToolHelpers.HandleLoadError(Global.Config.RecentMovies, path); + var movie = MovieService.Get(path); + Global.MovieSession.ReadOnly = true; + StartNewMovie(movie, false); } else { - Global.MovieSession.ReadOnly = true; - StartNewMovie(movie, false); + ToolHelpers.HandleLoadError(Global.Config.RecentMovies, path); } } diff --git a/BizHawk.Client.EmuHawk/movie/PlayMovie.cs b/BizHawk.Client.EmuHawk/movie/PlayMovie.cs index c13eb97c1c..99cfc458e2 100644 --- a/BizHawk.Client.EmuHawk/movie/PlayMovie.cs +++ b/BizHawk.Client.EmuHawk/movie/PlayMovie.cs @@ -462,12 +462,6 @@ namespace BizHawk.Client.EmuHawk toolTip1.SetToolTip(DetailsView, "Current SHA1: " + Global.Game.Hash); } break; - case HeaderKeys.MOVIEVERSION: - if (kvp.Value != HeaderKeys.MovieVersion1) - { - item.BackColor = Color.Yellow; - } - break; case HeaderKeys.EMULATIONVERSION: if (kvp.Value != VersionInfo.GetEmuVersion()) {