Add activeBeatmapPreview variable for tracking beatmap preview playback

This commit is contained in:
TocoToucan 2018-04-29 15:32:22 +03:00
parent 306f05b7bd
commit eda9f83836
1 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,7 @@ namespace osu.Game.Overlays.Direct
{
public class PlayButton : Container
{
private static PlayButton activeBeatmapPreview;
public readonly Bindable<bool> Playing = new Bindable<bool>();
public Track Preview { get; private set; }
@ -131,6 +132,9 @@ private void updatePreviewTrack(bool playing)
if (playing)
{
if (activeBeatmapPreview != null)
activeBeatmapPreview.Playing.Value = false;
if (Preview == null)
{
beginAudioLoad();
@ -140,6 +144,7 @@ private void updatePreviewTrack(bool playing)
Preview.Restart();
audio.Track.AddAdjustment(AdjustableProperty.Volume, muteBindable);
activeBeatmapPreview = this;
}
else
{