Rename IsUserPaused -> UserPauseRequested

This commit is contained in:
smoogipoo 2020-11-02 16:08:59 +09:00
parent 8adf146f53
commit 6f623d8cca
3 changed files with 10 additions and 7 deletions

View File

@ -22,9 +22,9 @@ public void TestMusicPlayAction()
{
AddStep("ensure playing something", () => Game.MusicController.EnsurePlayingSomething());
AddStep("toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay));
AddAssert("music paused", () => !Game.MusicController.IsPlaying && Game.MusicController.IsUserPaused);
AddAssert("music paused", () => !Game.MusicController.IsPlaying && Game.MusicController.UserPauseRequested);
AddStep("toggle playback", () => globalActionContainer.TriggerPressed(GlobalAction.MusicPlay));
AddAssert("music resumed", () => Game.MusicController.IsPlaying && !Game.MusicController.IsUserPaused);
AddAssert("music resumed", () => Game.MusicController.IsPlaying && !Game.MusicController.UserPauseRequested);
}
[Test]

View File

@ -45,7 +45,10 @@ public IBindableList<BeatmapSetInfo> BeatmapSets
private readonly BindableList<BeatmapSetInfo> beatmapSets = new BindableList<BeatmapSetInfo>();
public bool IsUserPaused { get; private set; }
/// <summary>
/// Whether the user has requested the track to be paused. Use <see cref="IsPlaying"/> to determine whether the track is still playing.
/// </summary>
public bool UserPauseRequested { get; private set; }
/// <summary>
/// Fired when the global <see cref="WorkingBeatmap"/> has changed.
@ -148,7 +151,7 @@ public void SeekTo(double position)
/// </summary>
public void EnsurePlayingSomething()
{
if (IsUserPaused) return;
if (UserPauseRequested) return;
if (CurrentTrack.IsDummyDevice || beatmap.Value.BeatmapSetInfo.DeletePending)
{
@ -176,7 +179,7 @@ public void EnsurePlayingSomething()
public bool Play(bool restart = false, bool requestedByUser = false)
{
if (requestedByUser)
IsUserPaused = false;
UserPauseRequested = false;
if (restart)
CurrentTrack.Restart();
@ -196,7 +199,7 @@ public bool Play(bool restart = false, bool requestedByUser = false)
/// </param>
public void Stop(bool requestedByUser = false)
{
IsUserPaused |= requestedByUser;
UserPauseRequested |= requestedByUser;
if (CurrentTrack.IsRunning)
CurrentTrack.Stop();
}

View File

@ -682,7 +682,7 @@ private void ensurePlayingSelected()
track.RestartPoint = Beatmap.Value.Metadata.PreviewTime;
if (!track.IsRunning && (music.IsUserPaused != true || isNewTrack))
if (!track.IsRunning && (music.UserPauseRequested != true || isNewTrack))
music.Play(true);
lastTrack.SetTarget(track);