1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 12:23:21 +08:00

Add flag parameter to allow non-user-pause via music controller

This commit is contained in:
Bartłomiej Dach 2020-10-31 16:06:53 +01:00
parent ea007af572
commit 941e8525af

View File

@ -182,9 +182,14 @@ namespace osu.Game.Overlays
/// <summary> /// <summary>
/// Stop playing the current track and pause at the current position. /// Stop playing the current track and pause at the current position.
/// </summary> /// </summary>
public void Stop() /// <param name="requestedByUser">
/// Whether the request to stop was issued by the user rather than internally.
/// Specifying <c>true</c> will ensure that other methods like <see cref="EnsurePlayingSomething"/>
/// will not resume music playback until the next explicit call to <see cref="Play"/>.
/// </param>
public void Stop(bool requestedByUser = true)
{ {
IsUserPaused = true; IsUserPaused |= requestedByUser;
if (CurrentTrack.IsRunning) if (CurrentTrack.IsRunning)
CurrentTrack.Stop(); CurrentTrack.Stop();
} }