From 30815ace62cc0580f9868999c6cf5a3597110638 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 27 Feb 2019 16:52:34 +0900 Subject: [PATCH 1/2] Fix crossthread operations due to Track.Completed --- osu.Game/Audio/PreviewTrack.cs | 2 +- osu.Game/Overlays/MusicController.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Audio/PreviewTrack.cs b/osu.Game/Audio/PreviewTrack.cs index 5de2f2551d..fad4731f18 100644 --- a/osu.Game/Audio/PreviewTrack.cs +++ b/osu.Game/Audio/PreviewTrack.cs @@ -28,7 +28,7 @@ namespace osu.Game.Audio private void load() { track = GetTrack(); - track.Completed += Stop; + track.Completed += () => Schedule(Stop); } /// diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 6a71e91de9..7fbb7ec41e 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -351,11 +351,11 @@ namespace osu.Game.Overlays queuedDirection = null; } - private void currentTrackCompleted() + private void currentTrackCompleted() => Schedule(() => { if (!beatmap.Disabled && beatmapSets.Any()) next(); - } + }); private ScheduledDelegate pendingBeatmapSwitch; From 1006c539be2dff48cef6fb506bb6fbff1669c3b3 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 27 Feb 2019 17:03:09 +0900 Subject: [PATCH 2/2] Fix looping not being checked --- osu.Game/Overlays/MusicController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index 7fbb7ec41e..6ac597451d 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -353,7 +353,7 @@ namespace osu.Game.Overlays private void currentTrackCompleted() => Schedule(() => { - if (!beatmap.Disabled && beatmapSets.Any()) + if (!current.Track.Looping && !beatmap.Disabled && beatmapSets.Any()) next(); });