Fix audio preview muting game audio indefinitely when beatmap panel is off-screen

This commit is contained in:
Dean Herbert
2019-11-06 15:58:47 +09:00
parent e4ad657353
commit c1a6cb1def
2 changed files with 8 additions and 5 deletions

View File

@ -46,18 +46,18 @@ namespace osu.Game.Audio
{
var track = CreatePreviewTrack(beatmapSetInfo, trackStore);
track.Started += () =>
track.Started += () => Schedule(() =>
{
current?.Stop();
current = track;
audio.Tracks.AddAdjustment(AdjustableProperty.Volume, muteBindable);
};
});
track.Stopped += () =>
track.Stopped += () => Schedule(() =>
{
current = null;
audio.Tracks.RemoveAdjustment(AdjustableProperty.Volume, muteBindable);
};
});
return track;
}