mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 22:26:41 +09:00
Fix audio preview muting game audio indefinitely when beatmap panel is off-screen
This commit is contained in:
@ -13,11 +13,13 @@ namespace osu.Game.Audio
|
||||
{
|
||||
/// <summary>
|
||||
/// Invoked when this <see cref="PreviewTrack"/> has stopped playing.
|
||||
/// Not invoked in a thread-safe context.
|
||||
/// </summary>
|
||||
public event Action Stopped;
|
||||
|
||||
/// <summary>
|
||||
/// Invoked when this <see cref="PreviewTrack"/> has started playing.
|
||||
/// Not invoked in a thread-safe context.
|
||||
/// </summary>
|
||||
public event Action Started;
|
||||
|
||||
@ -29,7 +31,7 @@ namespace osu.Game.Audio
|
||||
{
|
||||
track = GetTrack();
|
||||
if (track != null)
|
||||
track.Completed += () => Schedule(Stop);
|
||||
track.Completed += Stop;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -93,6 +95,7 @@ namespace osu.Game.Audio
|
||||
hasStarted = false;
|
||||
|
||||
track.Stop();
|
||||
|
||||
Stopped?.Invoke();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user