-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shuffle playback order in global playlist by default #29917
Conversation
RFC. Closes ppy#18169. Implements the given proposal of keeping the current stable order but adding a shuffle facility to the now playing overlay, and enabling it by default. There are more changes I want to make here but I'd like this to get discussion first, because I am likely to continue putting this sort of selection logic into `MusicController` and I just want to confirm nobody is going to have a problem with that. In particular this is not sharing the randomisation implementation with beatmap carousel because it doesn't generalise nicely (song select cares about the particular *beatmap difficulties* selected to rewind properly, while the music controller only cares about picking a *beatmap set*).
I think this direction is fine. But I'd consider moving the icon to the left to prefer centering (the pause button should be in the centre): diff --git a/osu.Game/Overlays/NowPlayingOverlay.cs b/osu.Game/Overlays/NowPlayingOverlay.cs
index e1e5aa9426..be0dfb474a 100644
--- a/osu.Game/Overlays/NowPlayingOverlay.cs
+++ b/osu.Game/Overlays/NowPlayingOverlay.cs
@@ -164,15 +164,16 @@ private void load()
Action = () => musicController.NextTrack(),
Icon = FontAwesome.Solid.StepForward,
},
- shuffleButton = new MusicIconButton
- {
- Anchor = Anchor.Centre,
- Origin = Anchor.Centre,
- Action = shuffle.Toggle,
- Icon = FontAwesome.Solid.Random,
- }
}
},
+ shuffleButton = new MusicIconButton
+ {
+ Anchor = Anchor.CentreLeft,
+ Origin = Anchor.Centre,
+ Action = shuffle.Toggle,
+ Position = new Vector2(bottom_black_area_height / 2, 0),
+ Icon = FontAwesome.Solid.Random,
+ },
playlistButton = new MusicIconButton
{
Origin = Anchor.Centre,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As commented.
`SkipWhile()` in this context does not correctly ensure that `ElementAtOrDefault(1)` is not a protected track. An explicit `Where()` does. Spotted accidentally when I noticed that skipping to next track can select a protected track, but skipping to previous cannot.
I figured you might say this 😅 Applied, thanks. Incidentally I noticed a bug in next track selection that was already here in master but I fixed it here anyway (2a214f7) just to reduce noise. See commit message for explanation. |
I'm not sure why this was "fine" for as long as it apparently was, but what `MusicController` was doing was completely incorrect and playing with fire (accessing raw managed realm objects), which went wrong somewhere around - admittedly - ppy#29917, likely because that one started *storing* these raw managed realm objects to fields, and you know what will happen to those after you do a migration and recycle realms. To attempt to circumvent this, (ab)use `DetachedBeatmapStore` instead. Which does necessitate moving it to `OsuGameBase`, but it's the simplest way out I can see. I guess the alternative would be to faff around with `Live<T>` but it's ugly and I'm attempting to fix this relatively quick right now.
I'm not sure why this was "fine" for as long as it apparently was, but what `MusicController` was doing was completely incorrect and playing with fire (accessing raw managed realm objects), which went wrong somewhere around - admittedly - ppy#29917, likely because that one started *storing* these raw managed realm objects to fields, and you know what will happen to those after you do a migration and recycle realms. To attempt to circumvent this, (ab)use `DetachedBeatmapStore` instead. Which does necessitate moving it to `OsuGameBase`, but it's the simplest way out I can see. I guess the alternative would be to faff around with `Live<T>` but it's ugly and I'm attempting to fix this relatively quick right now.
RFC. Closes #18169.
Implements the given proposal of keeping the current stable order but adding a shuffle facility to the now playing overlay, and enabling it by default.
There are more changes I want to make here but I'd like this to get discussion first, because I am likely to continue putting this sort of selection logic into
MusicController
and I just want to confirm nobody is going to have a problem with that.In particular this is not sharing the randomisation implementation with beatmap carousel because it doesn't generalise nicely (song select cares about the particular beatmap difficulties selected to rewind properly, while the music controller only cares about picking a beatmap set).
No automated tests because randomisation is difficult to test, I tested that this does what it's supposed to manually. That said I can try on request.