movie code cleanup
This commit is contained in:
parent
189a47ad3c
commit
dc9fa1acf3
|
@ -325,20 +325,20 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public void StopMovie(bool saveChanges = true)
|
||||
{
|
||||
var message = "Movie ";
|
||||
if (Movie.IsRecording())
|
||||
{
|
||||
message += "recording ";
|
||||
}
|
||||
else if (Movie.IsPlaying())
|
||||
{
|
||||
message += "playback ";
|
||||
}
|
||||
|
||||
message += "stopped.";
|
||||
|
||||
if (Movie.IsActive())
|
||||
{
|
||||
var message = "Movie ";
|
||||
if (Movie.IsRecording())
|
||||
{
|
||||
message += "recording ";
|
||||
}
|
||||
else if (Movie.IsPlaying())
|
||||
{
|
||||
message += "playback ";
|
||||
}
|
||||
|
||||
message += "stopped.";
|
||||
|
||||
var result = Movie.Stop(saveChanges);
|
||||
if (result)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Client.Common
|
||||
|
|
|
@ -61,18 +61,48 @@ namespace BizHawk.Client.EmuHawk
|
|||
UpdateStatusSlots();
|
||||
}
|
||||
|
||||
public void RestartMovie()
|
||||
private void StopMovie(bool saveChanges = true)
|
||||
{
|
||||
if (IsSlave && Master.WantsToControlStopMovie)
|
||||
{
|
||||
Master.StopMovie(!saveChanges);
|
||||
}
|
||||
else
|
||||
{
|
||||
MovieSession.StopMovie(saveChanges);
|
||||
SetMainformMovieInfo();
|
||||
}
|
||||
}
|
||||
|
||||
private void RestartMovie()
|
||||
{
|
||||
if (IsSlave && Master.WantsToControlRestartMovie)
|
||||
{
|
||||
Master.RestartMovie();
|
||||
}
|
||||
else if (MovieSession.Movie.IsActive())
|
||||
{
|
||||
StartNewMovie(MovieSession.Movie, false);
|
||||
AddOnScreenMessage("Replaying movie file in read-only mode");
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleReadOnly()
|
||||
{
|
||||
if (IsSlave && Master.WantsToControlReadOnly)
|
||||
{
|
||||
Master.ToggleReadOnly();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MovieSession.Movie.IsActive())
|
||||
{
|
||||
StartNewMovie(MovieSession.Movie, false);
|
||||
AddOnScreenMessage("Replaying movie file in read-only mode");
|
||||
MovieSession.ReadOnly ^= true;
|
||||
AddOnScreenMessage(MovieSession.ReadOnly ? "Movie read-only mode" : "Movie read+write mode");
|
||||
}
|
||||
else
|
||||
{
|
||||
AddOnScreenMessage("No movie active");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4351,40 +4351,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private void ToggleReadOnly()
|
||||
{
|
||||
if (IsSlave && Master.WantsToControlReadOnly)
|
||||
{
|
||||
Master.ToggleReadOnly();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (MovieSession.Movie.IsActive())
|
||||
{
|
||||
MovieSession.ReadOnly ^= true;
|
||||
AddOnScreenMessage(MovieSession.ReadOnly ? "Movie read-only mode" : "Movie read+write mode");
|
||||
}
|
||||
else
|
||||
{
|
||||
AddOnScreenMessage("No movie active");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void StopMovie(bool saveChanges = true)
|
||||
{
|
||||
if (IsSlave && Master.WantsToControlStopMovie)
|
||||
{
|
||||
Master.StopMovie(!saveChanges);
|
||||
}
|
||||
else
|
||||
{
|
||||
MovieSession.StopMovie(saveChanges);
|
||||
SetMainformMovieInfo();
|
||||
UpdateStatusSlots();
|
||||
}
|
||||
}
|
||||
|
||||
private void CaptureRewind(bool suppressCaptureRewind)
|
||||
{
|
||||
if (IsRewindSlave)
|
||||
|
|
|
@ -756,10 +756,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
_initializing = true;
|
||||
|
||||
if (movie == null)
|
||||
{
|
||||
movie = CurrentTasMovie;
|
||||
}
|
||||
movie ??= CurrentTasMovie;
|
||||
|
||||
SetTasMovieCallbacks(movie as TasMovie);
|
||||
|
||||
|
|
Loading…
Reference in New Issue