From 18d0a598690faa642af001b68f38055f6c1c93cf Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 14 Jun 2014 14:09:55 +0000 Subject: [PATCH] another small Movies 2.0 todo --- BizHawk.Client.Common/movie/MovieService.cs | 10 ++++++++++ BizHawk.Client.Common/movie/MovieSession.cs | 17 ++--------------- BizHawk.Client.EmuHawk/MainForm.Events.cs | 2 +- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/BizHawk.Client.Common/movie/MovieService.cs b/BizHawk.Client.Common/movie/MovieService.cs index c741401676..5a27e9bcbc 100644 --- a/BizHawk.Client.Common/movie/MovieService.cs +++ b/BizHawk.Client.Common/movie/MovieService.cs @@ -40,6 +40,16 @@ namespace BizHawk.Client.Common } } + public static bool IsValidMovieExtension(string ext) + { + if (MovieExtensions.Contains(ext.ToLower().Replace(".", ""))) + { + return true; + } + + return false; + } + /// /// 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 diff --git a/BizHawk.Client.Common/movie/MovieSession.cs b/BizHawk.Client.Common/movie/MovieSession.cs index c4c6eb17cc..4189c41efb 100644 --- a/BizHawk.Client.Common/movie/MovieSession.cs +++ b/BizHawk.Client.Common/movie/MovieSession.cs @@ -1,4 +1,6 @@ using System; +using System.Collections.Generic; +using System.Linq; using System.IO; using BizHawk.Emulation.Common; @@ -31,21 +33,6 @@ namespace BizHawk.Client.Common } } - public static bool IsValidMovieExtension(string ext) - { - // Movies 2.0 TODO - if (ext.ToUpper() == "." + Global.MovieSession.Movie.PreferredExtension) - { - return true; - } - else if (ext.ToUpper() == ".TAS" || ext.ToUpper() == ".BKM") - { - return true; - } - - return false; - } - public void LatchMultitrackPlayerInput(IController playerSource, MultitrackRewiringControllerAdapter rewiredSource) { if (_multiTrack.IsActive) diff --git a/BizHawk.Client.EmuHawk/MainForm.Events.cs b/BizHawk.Client.EmuHawk/MainForm.Events.cs index 524cf40e59..8913d24ed7 100644 --- a/BizHawk.Client.EmuHawk/MainForm.Events.cs +++ b/BizHawk.Client.EmuHawk/MainForm.Events.cs @@ -2185,7 +2185,7 @@ namespace BizHawk.Client.EmuHawk GlobalWin.Tools.LuaConsole.LoadLuaSession(filePaths[0]); } } - else if (MovieSession.IsValidMovieExtension(ext)) + else if (MovieService.IsValidMovieExtension(ext)) { StartNewMovie(MovieService.Get(filePaths[0]), false); }