More movies 2.0 stuff

This commit is contained in:
adelikat 2014-06-12 21:45:47 +00:00
parent 05b3f369eb
commit 3ea79c720b
6 changed files with 18 additions and 22 deletions

View File

@ -4,9 +4,6 @@ namespace BizHawk.Client.Common
{ {
public static class HeaderKeys 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 EMULATIONVERSION = "emuVersion";
public const string MOVIEVERSION = "MovieVersion"; public const string MOVIEVERSION = "MovieVersion";
public const string PLATFORM = "Platform"; public const string PLATFORM = "Platform";

View File

@ -119,10 +119,6 @@ namespace BizHawk.Client.Common
m = ImportZMV(path, out errorMsg, out warningMsg); m = ImportZMV(path, out errorMsg, out warningMsg);
break; break;
} }
if (errorMsg == string.Empty)
{
m.Header[HeaderKeys.MOVIEVERSION] = HeaderKeys.MovieVersion1;
}
} }
catch (Exception except) catch (Exception except)
{ {

View File

@ -39,5 +39,17 @@ namespace BizHawk.Client.Common
yield return "tasproj"; yield return "tasproj";
} }
} }
/// <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();
}
}
} }
} }

View File

@ -11,7 +11,6 @@ namespace BizHawk.Client.Common
Subtitles = new SubtitleList(); Subtitles = new SubtitleList();
this[HeaderKeys.EMULATIONVERSION] = VersionInfo.GetEmuVersion(); this[HeaderKeys.EMULATIONVERSION] = VersionInfo.GetEmuVersion();
this[HeaderKeys.MOVIEVERSION] = HeaderKeys.MovieVersion1;
this[HeaderKeys.PLATFORM] = Global.Emulator != null ? Global.Emulator.SystemId : string.Empty; this[HeaderKeys.PLATFORM] = Global.Emulator != null ? Global.Emulator.SystemId : string.Empty;
this[HeaderKeys.GAMENAME] = string.Empty; this[HeaderKeys.GAMENAME] = string.Empty;
this[HeaderKeys.AUTHOR] = string.Empty; this[HeaderKeys.AUTHOR] = string.Empty;

View File

@ -78,7 +78,7 @@ namespace BizHawk.Client.EmuHawk
Global.FirmwareManager = new FirmwareManager(); Global.FirmwareManager = new FirmwareManager();
Global.MovieSession = new MovieSession Global.MovieSession = new MovieSession
{ {
Movie = new Movie(), Movie = MovieService.DefaultInstance,
MessageCallback = GlobalWin.OSD.AddMessage, MessageCallback = GlobalWin.OSD.AddMessage,
AskYesNoCallback = StateErrorAskUser AskYesNoCallback = StateErrorAskUser
}; };
@ -1439,17 +1439,15 @@ namespace BizHawk.Client.EmuHawk
private void LoadMoviesFromRecent(string path) private void LoadMoviesFromRecent(string path)
{ {
var movie = MovieService.Get(path); if (File.Exists(path))
// Movies 2.0 TODO
if (!(movie as Movie).Loaded)
{ {
ToolHelpers.HandleLoadError(Global.Config.RecentMovies, path); var movie = MovieService.Get(path);
Global.MovieSession.ReadOnly = true;
StartNewMovie(movie, false);
} }
else else
{ {
Global.MovieSession.ReadOnly = true; ToolHelpers.HandleLoadError(Global.Config.RecentMovies, path);
StartNewMovie(movie, false);
} }
} }

View File

@ -462,12 +462,6 @@ namespace BizHawk.Client.EmuHawk
toolTip1.SetToolTip(DetailsView, "Current SHA1: " + Global.Game.Hash); toolTip1.SetToolTip(DetailsView, "Current SHA1: " + Global.Game.Hash);
} }
break; break;
case HeaderKeys.MOVIEVERSION:
if (kvp.Value != HeaderKeys.MovieVersion1)
{
item.BackColor = Color.Yellow;
}
break;
case HeaderKeys.EMULATIONVERSION: case HeaderKeys.EMULATIONVERSION:
if (kvp.Value != VersionInfo.GetEmuVersion()) if (kvp.Value != VersionInfo.GetEmuVersion())
{ {