Cleanup external PlayButton.Playing usage

This commit is contained in:
Roman Kapustin
2018-05-25 22:35:15 +03:00
parent 498244a308
commit a24589f583
6 changed files with 37 additions and 65 deletions

View File

@ -37,14 +37,17 @@ namespace osu.Game.Audio
CurrentTrack?.Stop();
audio.Track.AddAdjustment(AdjustableProperty.Volume, muteBindable);
CurrentTrack = track;
CurrentTrack.Stopped += () => CurrentTrack = null;
};
onTrackStop = () => audio.Track.RemoveAdjustment(AdjustableProperty.Volume, muteBindable);
onTrackStop = () =>
{
audio.Track.RemoveAdjustment(AdjustableProperty.Volume, muteBindable);
CurrentTrack = null;
};
}
public PreviewTrack Get(BeatmapSetInfo beatmapSetInfo) =>
new PreviewTrack(
trackManager.Get($"https://b.ppy.sh/preview/{beatmapSetInfo.OnlineBeatmapSetID}.mp3"),
trackManager.Get($"https://b.ppy.sh/preview/{beatmapSetInfo?.OnlineBeatmapSetID}.mp3"),
onTrackStart,
onTrackStop);