Some more Movies 2.0 work
This commit is contained in:
parent
525871d6e4
commit
54c9c2c0a0
|
@ -6,7 +6,7 @@ using System.Text;
|
|||
|
||||
namespace BizHawk.Client.Common
|
||||
{
|
||||
public static class MovieLoader
|
||||
public static class MovieService
|
||||
{
|
||||
public static IMovie Load(string path)
|
||||
{
|
|
@ -40,6 +40,11 @@ namespace BizHawk.Client.Common
|
|||
public string PreferredExtension { get { return "bk2"; } }
|
||||
public bool IsCountingRerecords { get; set; }
|
||||
|
||||
public bool PreLoadText(HawkFile hawkFile)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public SubtitleList Subtitles
|
||||
{
|
||||
get { throw new NotImplementedException(); }
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using BizHawk.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
|
@ -64,6 +65,8 @@ namespace BizHawk.Client.Common
|
|||
string GameName { get; set; }
|
||||
string SystemID { get; set; }
|
||||
string Hash { get; set; }
|
||||
bool PreLoadText(HawkFile hawkFile); // Movies 2.0 TODO: find a better way to not need this
|
||||
|
||||
#endregion
|
||||
|
||||
#region File Handling API
|
||||
|
|
|
@ -3,6 +3,8 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using BizHawk.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
|
@ -69,6 +71,11 @@ namespace BizHawk.Client.Common
|
|||
|
||||
#region IMovie Implementation
|
||||
|
||||
public bool PreLoadText(HawkFile hawkFile)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public TasMovie(string filename, bool startsFromSavestate = false)
|
||||
: this(startsFromSavestate)
|
||||
{
|
||||
|
|
|
@ -2192,7 +2192,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
else if (MovieSession.IsValidMovieExtension(ext))
|
||||
{
|
||||
StartNewMovie(MovieLoader.Load(filePaths[0]), false);
|
||||
StartNewMovie(MovieService.Get(filePaths[0]), false);
|
||||
}
|
||||
else if (ext.ToUpper() == ".STATE")
|
||||
{
|
||||
|
@ -2232,7 +2232,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
string errorMsg;
|
||||
string warningMsg;
|
||||
var movie = MovieImport.ImportFile(filePaths[0], out errorMsg, out warningMsg);
|
||||
if (!String.IsNullOrEmpty(errorMsg))
|
||||
if (!string.IsNullOrEmpty(errorMsg))
|
||||
{
|
||||
MessageBox.Show(errorMsg, "Conversion error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
|
|
|
@ -265,7 +265,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
else
|
||||
{
|
||||
var movie = MovieLoader.Load(cmdMovie);
|
||||
var movie = MovieService.Get(cmdMovie);
|
||||
Global.MovieSession.ReadOnly = true;
|
||||
|
||||
// if user is dumping and didnt supply dump length, make it as long as the loaded movie
|
||||
|
@ -286,7 +286,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
else
|
||||
{
|
||||
StartNewMovie(MovieLoader.Load(Global.Config.RecentMovies.MostRecent), false);
|
||||
StartNewMovie(MovieService.Get(Global.Config.RecentMovies.MostRecent), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1439,7 +1439,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private void LoadMoviesFromRecent(string path)
|
||||
{
|
||||
var movie = MovieLoader.Load(path);
|
||||
var movie = MovieService.Get(path);
|
||||
|
||||
// Movies 2.0 TODO
|
||||
if (!(movie as Movie).Loaded)
|
||||
|
|
|
@ -125,8 +125,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
private IMovie PreLoadMovieFile(HawkFile hf, bool force)
|
||||
{
|
||||
// Movies 2.0 TODO: don't cast and find a way to load this stuff with only IMovie!
|
||||
var movie = (MovieLoader.Load(hf.CanonicalFullPath) as Movie);
|
||||
var movie = MovieService.Get(hf.CanonicalFullPath);
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -188,10 +187,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
var tas = new List<int>();
|
||||
for (var i = 0; i < indices.Count; i++)
|
||||
{
|
||||
// Movies 2.0 TODO: MovieLoader could have a list of valid extensiosn to match
|
||||
if (Path.GetExtension(_movieList[indices[i]].Filename).ToUpper() == "." + Movie.Extension)
|
||||
foreach (var ext in MovieService.MovieExtensions)
|
||||
{
|
||||
tas.Add(i);
|
||||
if (Path.GetExtension(_movieList[indices[i]].Filename).ToUpper() == "." + ext)
|
||||
{
|
||||
tas.Add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -296,9 +297,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
var filePaths = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||
|
||||
// Movies 2.0 TODO: MovieLoader could have a list of valid extensiosn to match
|
||||
filePaths
|
||||
.Where(path => Path.GetExtension(path) == "." + Movie.Extension)
|
||||
.Where(path => MovieService.MovieExtensions.Contains(Path.GetExtension(path).Replace(".", "")))
|
||||
.ToList()
|
||||
.ForEach(path => AddMovieToList(path, force: true));
|
||||
|
||||
|
@ -607,8 +607,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
var ofd = new OpenFileDialog
|
||||
{
|
||||
// Movies 2.0 TODO
|
||||
Filter = "Movie Files (*." + Movie.Extension + ")|*." + Movie.Extension + "|Savestates|*.state|All Files|*.*",
|
||||
// Movies 2.0 TODO - add tasproj in addition to default, hardcoded is fine in this case
|
||||
Filter = "Movie Files (*." + Movie.Extension + ")|*." + MovieService.DefaultExtension + "|All Files|*.*",
|
||||
InitialDirectory = PathManager.MakeAbsolutePath(Global.Config.PathEntries.MoviesPathFragment, null)
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue