2014-06-11 02:33:57 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2014-06-12 11:53:25 +00:00
|
|
|
|
using BizHawk.Common;
|
|
|
|
|
|
2014-06-11 02:33:57 +00:00
|
|
|
|
namespace BizHawk.Client.Common
|
|
|
|
|
{
|
2014-06-11 21:14:13 +00:00
|
|
|
|
public static class MovieService
|
2014-06-11 02:33:57 +00:00
|
|
|
|
{
|
2014-06-12 11:53:25 +00:00
|
|
|
|
public static IMovie Get(string path)
|
2014-06-11 02:33:57 +00:00
|
|
|
|
{
|
|
|
|
|
// TODO: open the file and determine the format, and instantiate the appropriate implementation
|
|
|
|
|
// Currently we just assume it is a bkm implementation
|
2014-06-12 11:53:25 +00:00
|
|
|
|
// TODO: change IMovies to take HawkFiles only and not path
|
2014-06-11 02:33:57 +00:00
|
|
|
|
return new Movie(path);
|
|
|
|
|
}
|
2014-06-12 11:53:25 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the file extension for the default movie implementation used in the client
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static string DefaultExtension
|
|
|
|
|
{
|
|
|
|
|
get { return "bkm"; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns a list of extensions for all IMovie implementations
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IEnumerable<string> MovieExtensions
|
|
|
|
|
{
|
|
|
|
|
// Movies 2.0 TODO: consider using reflection to find IMovie implementations
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
yield return "bkm";
|
|
|
|
|
yield return "bk2";
|
|
|
|
|
yield return "tasproj";
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-06-12 21:45:47 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 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
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static IMovie DefaultInstance
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return new Movie();
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-06-11 02:33:57 +00:00
|
|
|
|
}
|
|
|
|
|
}
|