예제 #1
0
        public BeatmapPanelDownloadButton(IBeatmapSetInfo beatmapSet)
        {
            this.beatmapSet = beatmapSet;

            InternalChildren = new Drawable[]
            {
                shakeContainer = new ShakeContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Child            = button = new DownloadButton
                    {
                        RelativeSizeAxes = Axes.Both,
                        State            = { BindTarget = State }
                    },
                },
                DownloadTracker = new BeatmapDownloadTracker(beatmapSet)
                {
                    State = { BindTarget = State }
                }
            };

            button.Add(new DownloadProgressBar(beatmapSet)
            {
                Anchor = Anchor.BottomLeft,
                Origin = Anchor.BottomLeft,
                Depth  = -1,
            });
        }
예제 #2
0
        public void TestNotificationMessage(IBeatmapSetInfo model)
        {
            AddStep("clear recent notification", () => recentNotification = null);
            AddStep("download beatmap", () => beatmaps.Download(model));

            AddUntilStep("wait for notification", () => recentNotification != null);
            AddUntilStep("notification text correct", () => recentNotification.Text.ToString() == "Downloading test author - test title (mapper)");
        }
예제 #3
0
 private void createButtonWithBeatmap(IBeatmapSetInfo beatmap)
 {
     AddStep("create button", () =>
     {
         Child = downloadButton = new TestDownloadButton(beatmap)
         {
             Anchor = Anchor.Centre,
             Origin = Anchor.Centre,
             Size   = new Vector2(75, 50),
         };
     });
 }
예제 #4
0
        public DownloadProgressBar(IBeatmapSetInfo beatmapSet)
        {
            InternalChildren = new Drawable[]
            {
                progressBar = new ProgressBar(false)
                {
                    Height = 0,
                    Alpha  = 0,
                },
                downloadTracker = new BeatmapDownloadTracker(beatmapSet),
            };

            AutoSizeAxes     = Axes.Y;
            RelativeSizeAxes = Axes.X;
        }
예제 #5
0
        public PlayButton(IBeatmapSetInfo beatmapSetInfo)
        {
            this.beatmapSetInfo = beatmapSetInfo;

            Anchor = Origin = Anchor.Centre;

            Children = new Drawable[]
            {
                icon = new SpriteIcon
                {
                    Anchor = Anchor.Centre,
                    Origin = Anchor.Centre,
                    Icon   = FontAwesome.Solid.Play,
                    Size   = new Vector2(14)
                },
                loadingSpinner = new LoadingSpinner
                {
                    Size = new Vector2(14)
                }
            };

            Action = () => Playing.Toggle();
        }
예제 #6
0
        public BeatmapCardDifficultyList(IBeatmapSetInfo beatmapSetInfo)
        {
            RelativeSizeAxes = Axes.X;
            AutoSizeAxes     = Axes.Y;

            FillFlowContainer flow;

            InternalChild = flow = new FillFlowContainer
            {
                RelativeSizeAxes = Axes.X,
                AutoSizeAxes     = Axes.Y,
                Direction        = FillDirection.Vertical,
                Spacing          = new Vector2(0, 3)
            };

            bool firstGroup = true;

            foreach (var group in beatmapSetInfo.Beatmaps.GroupBy(beatmap => beatmap.Ruleset.OnlineID).OrderBy(group => group.Key))
            {
                if (!firstGroup)
                {
                    flow.Add(Empty().With(s =>
                    {
                        s.RelativeSizeAxes = Axes.X;
                        s.Height           = 4;
                    }));
                }

                foreach (var difficulty in group.OrderBy(b => b.StarRating))
                {
                    flow.Add(new BeatmapCardDifficultyRow(difficulty));
                }

                firstGroup = false;
            }
        }
예제 #7
0
        /// <summary>
        /// Retrieves a <see cref="PreviewTrack"/> for a <see cref="IBeatmapSetInfo"/>.
        /// </summary>
        /// <param name="beatmapSetInfo">The <see cref="IBeatmapSetInfo"/> to retrieve the preview track for.</param>
        /// <returns>The playable <see cref="PreviewTrack"/>.</returns>
        public PreviewTrack Get(IBeatmapSetInfo beatmapSetInfo)
        {
            var track = CreatePreviewTrack(beatmapSetInfo, trackStore);

            track.Started += () => Schedule(() =>
            {
                CurrentTrack?.Stop();
                CurrentTrack = track;
                audio.Tracks.AddAdjustment(AdjustableProperty.Volume, muteBindable);
            });

            track.Stopped += () => Schedule(() =>
            {
                if (CurrentTrack != track)
                {
                    return;
                }

                CurrentTrack = null;
                audio.Tracks.RemoveAdjustment(AdjustableProperty.Volume, muteBindable);
            });

            return(track);
        }
예제 #8
0
 protected override ArchiveDownloadRequest <IBeatmapSetInfo> CreateDownloadRequest(IBeatmapSetInfo set, bool minimiseDownloadSize)
 => new TestDownloadRequest(set);
예제 #9
0
 /// <summary>
 /// Creates the <see cref="TrackManagerPreviewTrack"/>.
 /// </summary>
 protected virtual TrackManagerPreviewTrack CreatePreviewTrack(IBeatmapSetInfo beatmapSetInfo, ITrackStore trackStore) =>
 new TrackManagerPreviewTrack(beatmapSetInfo, trackStore);
예제 #10
0
 public TrackManagerPreviewTrack(IBeatmapSetInfo beatmapSetInfo, ITrackStore trackManager)
 {
     this.beatmapSetInfo = beatmapSetInfo;
     this.trackManager   = trackManager;
 }
예제 #11
0
 public TestPreviewTrack(IBeatmapSetInfo beatmapSetInfo, ITrackStore trackManager)
     : base(beatmapSetInfo, trackManager)
 {
     this.trackManager = trackManager;
 }
예제 #12
0
 protected override TrackManagerPreviewTrack CreatePreviewTrack(IBeatmapSetInfo beatmapSetInfo, ITrackStore trackStore) => new TestPreviewTrack(beatmapSetInfo, trackStore);
예제 #13
0
 public BundledBeatmapDownloadRequest(IBeatmapSetInfo beatmapSetInfo, bool minimiseDownloadSize)
     : base(beatmapSetInfo, minimiseDownloadSize)
 {
 }
예제 #14
0
 public TestDownloadButton(IBeatmapSetInfo beatmapSet)
     : base(beatmapSet)
 {
 }