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, }); }
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)"); }
private void createButtonWithBeatmap(IBeatmapSetInfo beatmap) { AddStep("create button", () => { Child = downloadButton = new TestDownloadButton(beatmap) { Anchor = Anchor.Centre, Origin = Anchor.Centre, Size = new Vector2(75, 50), }; }); }
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; }
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(); }
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; } }
/// <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); }
protected override ArchiveDownloadRequest <IBeatmapSetInfo> CreateDownloadRequest(IBeatmapSetInfo set, bool minimiseDownloadSize) => new TestDownloadRequest(set);
/// <summary> /// Creates the <see cref="TrackManagerPreviewTrack"/>. /// </summary> protected virtual TrackManagerPreviewTrack CreatePreviewTrack(IBeatmapSetInfo beatmapSetInfo, ITrackStore trackStore) => new TrackManagerPreviewTrack(beatmapSetInfo, trackStore);
public TrackManagerPreviewTrack(IBeatmapSetInfo beatmapSetInfo, ITrackStore trackManager) { this.beatmapSetInfo = beatmapSetInfo; this.trackManager = trackManager; }
public TestPreviewTrack(IBeatmapSetInfo beatmapSetInfo, ITrackStore trackManager) : base(beatmapSetInfo, trackManager) { this.trackManager = trackManager; }
protected override TrackManagerPreviewTrack CreatePreviewTrack(IBeatmapSetInfo beatmapSetInfo, ITrackStore trackStore) => new TestPreviewTrack(beatmapSetInfo, trackStore);
public BundledBeatmapDownloadRequest(IBeatmapSetInfo beatmapSetInfo, bool minimiseDownloadSize) : base(beatmapSetInfo, minimiseDownloadSize) { }
public TestDownloadButton(IBeatmapSetInfo beatmapSet) : base(beatmapSet) { }