diff --git a/osu.Game.Tests/Visual/Menus/TestSceneMusicActionHandling.cs b/osu.Game.Tests/Visual/Menus/TestSceneMusicActionHandling.cs index 4cad2b19d5..b34e027e9c 100644 --- a/osu.Game.Tests/Visual/Menus/TestSceneMusicActionHandling.cs +++ b/osu.Game.Tests/Visual/Menus/TestSceneMusicActionHandling.cs @@ -22,9 +22,9 @@ namespace osu.Game.Tests.Visual.Menus { 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] diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index d78f387b30..3a9a6261ba 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -45,7 +45,10 @@ namespace osu.Game.Overlays private readonly BindableList beatmapSets = new BindableList(); - public bool IsUserPaused { get; private set; } + /// + /// Whether the user has requested the track to be paused. Use to determine whether the track is still playing. + /// + public bool UserPauseRequested { get; private set; } /// /// Fired when the global has changed. @@ -148,7 +151,7 @@ namespace osu.Game.Overlays /// public void EnsurePlayingSomething() { - if (IsUserPaused) return; + if (UserPauseRequested) return; if (CurrentTrack.IsDummyDevice || beatmap.Value.BeatmapSetInfo.DeletePending) { @@ -176,7 +179,7 @@ namespace osu.Game.Overlays public bool Play(bool restart = false, bool requestedByUser = false) { if (requestedByUser) - IsUserPaused = false; + UserPauseRequested = false; if (restart) CurrentTrack.Restart(); @@ -196,7 +199,7 @@ namespace osu.Game.Overlays /// public void Stop(bool requestedByUser = false) { - IsUserPaused |= requestedByUser; + UserPauseRequested |= requestedByUser; if (CurrentTrack.IsRunning) CurrentTrack.Stop(); } diff --git a/osu.Game/Screens/Select/SongSelect.cs b/osu.Game/Screens/Select/SongSelect.cs index 0473efd404..def620462f 100644 --- a/osu.Game/Screens/Select/SongSelect.cs +++ b/osu.Game/Screens/Select/SongSelect.cs @@ -682,7 +682,7 @@ namespace osu.Game.Screens.Select 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);