mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 23:53:51 +09:00
Stop PreviewTrack on Completed event
This commit is contained in:
@ -28,6 +28,7 @@ namespace osu.Game.Audio
|
|||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
track = GetTrack();
|
track = GetTrack();
|
||||||
|
track.Completed += Stop;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -50,15 +51,6 @@ namespace osu.Game.Audio
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsRunning => track?.IsRunning ?? false;
|
public bool IsRunning => track?.IsRunning ?? false;
|
||||||
|
|
||||||
protected override void Update()
|
|
||||||
{
|
|
||||||
base.Update();
|
|
||||||
|
|
||||||
// Todo: Track currently doesn't signal its completion, so we have to handle it manually
|
|
||||||
if (hasStarted && track.HasCompleted)
|
|
||||||
Stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
private ScheduledDelegate startDelegate;
|
private ScheduledDelegate startDelegate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Reference in New Issue
Block a user