1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 21:17:25 +08:00
Commit Graph

425 Commits

Author SHA1 Message Date
Bartłomiej Dach
8cec318c1f
Loop track even if shuffling if there is only one available
Co-authored-by: Dean Herbert <pe@ppy.sh>
2024-10-14 15:28:32 +02:00
Bartłomiej Dach
17aed26f85
Fix shuffle not actually changing the track sometimes
See https://github.com/ppy/osu/pull/30215#issuecomment-2407775408 for
context.

Turns out the test failures were more correct than I'd thought. The
long-and-short of it is that both in "pure random" mode and in
"permutation" mode, when running out of track history to fall
back on, it was possible for the random algorithm to pick the same song
twice in a row - which is probably not desired, and which this explicit
exclude should make impossible.
2024-10-14 13:18:45 +02:00
Bartłomiej Dach
4a16341a94
Fix crash when switching tracks back and forth with shuffle on 2024-10-11 12:45:14 +02:00
Bartłomiej Dach
47cb696b69
Fix switching direction when changing tracks with shuffle on restarting the same track
Closes https://github.com/ppy/osu/issues/30190.
2024-10-11 12:40:45 +02:00
Bartłomiej Dach
baa64d1486
Migrate MusicController to Live<T> to fix broken migrations instead 2024-10-09 11:59:04 +02:00
Bartłomiej Dach
081d87fe6d
Revert 'Fix any and all migration attempts dying on MusicController'
This reverts commit 310eec69fc.

Way to try and "fix" stuff and screw stuff up even harder instead, me.
Great job, well done.
2024-10-09 11:55:59 +02:00
Dean Herbert
48dacd1c15
Remove unused property 2024-10-09 13:45:35 +09:00
Bartłomiej Dach
310eec69fc
Fix any and all migration attempts dying on MusicController
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 -
https://github.com/ppy/osu/pull/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.
2024-10-08 23:16:10 +02:00
Bartłomiej Dach
2a214f7c9f
Fix incorrect implementation of next track choice
`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.
2024-10-01 10:19:59 +02:00
Bartłomiej Dach
12bd516a57
Shuffle playback order in global playlist by default
RFC. Closes https://github.com/ppy/osu/issues/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*).
2024-09-18 14:19:55 +02:00
Dean Herbert
2a479a84dc
Remove conditional inhibiting seek when beatmap change is not allowed
In testing I can't find a reason for this to exist. Blaming back shows
that it existed before we had `AllowTrackControl` and was likely being
used as a stop-gap measure to achieve the same thing. It's existed since
over 6 years ago.

Let's give removing it a try to fix some usability concerns?

Closes https://github.com/ppy/osu/issues/29563.
2024-08-23 18:21:31 +09:00
Dean Herbert
4a3f4c3a55
Don't duck music when effect volume is set to zero
Addresses https://github.com/ppy/osu/discussions/28984.
2024-08-19 14:46:50 +09:00
Bartłomiej Dach
9fe6354afc
Fix backwards conditional 2024-07-19 07:32:36 +02:00
Bartłomiej Dach
e4ff6b5c8b
Add flags allowing excluding protected beatmaps from consideration in music controller
This means that the protected beatmap can not be skipped forward/back
to.

Incidentally closes https://github.com/ppy/osu/issues/23199.
2024-07-17 12:46:24 +02:00
Dean Herbert
3650f3c479
Allow multiple ducks with same parameters 2024-07-08 13:52:40 +09:00
Dean Herbert
0067450b22
Change volume parameter to double 2024-07-08 13:47:57 +09:00
Dean Herbert
5907e0d1eb
Make DuckDuration non-zero by default 2024-07-05 18:39:13 +09:00
Dean Herbert
7efb4ce30a
Fix multiple disposals resulting in assert being hit 2024-07-05 18:39:12 +09:00
Dean Herbert
717f7ba9f0
Better support multiple concurrent ducking operations 2024-07-05 18:12:40 +09:00
Dean Herbert
20ba6ca867
Add mention of return type for Duck method 2024-07-05 15:11:11 +09:00
Dean Herbert
554740af10
Adjust ducking API to use a parameters record 2024-07-05 15:04:40 +09:00
Dean Herbert
0d858ce8f8
Change default easings to In/Out for all ducking operations 2024-07-05 13:51:41 +09:00
Dean Herbert
0696e2df32
Apply nullability to ducking methods 2024-07-05 12:58:34 +09:00
Dean Herbert
7f84e377ab
Merge branch 'music-controller-nullability' into audio-ducking-fx 2024-07-05 12:57:39 +09:00
Dean Herbert
d21eec9542
Apply nullability to MusicController 2024-07-05 12:50:15 +09:00
Jamie Taylor
a5077fcb3f
Rename TimedDuck -> DuckMomentarily 2024-07-04 17:22:33 +09:00
Jamie Taylor
82e4e884d7
Change overlapping Duck() usages to be a noop instead of a throw 2024-07-04 15:51:50 +09:00
Jamie Taylor
d948193757
Change Duck() to be IDisposable and prevent overlapping usages 2024-07-04 14:23:35 +09:00
Jamie Taylor
b972632e4f
Change default easing to match prior behaviour 2024-07-03 13:50:35 +09:00
Jamie Taylor
153138cdac
Use null to disable audio filter instead 2024-07-03 13:47:59 +09:00
Jamie Taylor
a56751511e
Apply a ducking effect to the currently playing track when switching ruleset 2024-06-22 01:36:30 +09:00
Dean Herbert
7138291636 Adjust xmldoc to explicitly metnion it only affects end user control 2023-07-30 13:52:58 +09:00
Dean Herbert
6146f30541 Allow screens to change the ability to interact with the global track 2023-07-25 20:20:53 +09:00
Dean Herbert
157b1f301b Rename AllowTrackAdjustments to more understandable ApplyModTrackAdjustments 2023-07-25 20:20:53 +09:00
Dean Herbert
2e02b4a85b Apply more correct fix for double-playing menu track 2023-06-20 18:35:51 +09:00
Dan Balasescu
7bc8908ca9 Partial everything 2022-11-27 00:00:27 +09:00
Dean Herbert
4e9b25d8b0 Move MusicController binds to LoadComplete for added thread safety 2022-09-26 15:42:37 +09:00
Dean Herbert
2f60f91a0e Fix editor potentially using a track post-disposal
This changes the editor to track the current track as it is *loaded* by
`MusicController`, rather than haphazardly following the current global
`WorkingBeatmap` (with a potentially unloaded track) or relying on local
immediate-load behaviour (as implemented in `ResourcesSection`).
2022-08-01 16:53:49 +09:00
Dean Herbert
7ef03dd2cb Use fire-and-forget async operations on global track
This avoids any blocking overhead caused by a backlogged audio thread.
Test seem to pass so might be okay?

Note that order is still guaranteed due to the `ensureUpdateThread`
queueing system framework-side.
2022-07-07 17:15:45 +09:00
Dan Balasescu
6c6de9ce53
Fix typo 2022-06-27 20:40:02 +09:00
Dean Herbert
50c1c066de Add various logging of global WorkingBeatmap state changes 2022-06-27 18:41:31 +09:00
Dan Balasescu
f8830c6850 Automated #nullable processing 2022-06-17 16:37:17 +09:00
Salman Ahmed
abf9039109 Use == instead of ?? 2022-05-20 16:08:31 +03:00
Salman Ahmed
c78d90ccbd Refactor track transferring logic for ability to override and disallow 2022-05-20 14:43:07 +03:00
Salman Ahmed
9446be2511 Remove unnecessary UnbindAdjustments call
It is not necessary given that `CurrentTrack` already removes all adjustments first.
2022-05-10 20:49:44 +03:00
Salman Ahmed
36a7644164 Reinstantiate mod adjustments layer for safety against previous mods 2022-05-10 20:46:33 +03:00
Salman Ahmed
725ff93f34 Define local adjustments component for mods in MusicController
Isolates `CurrentTrack` from being directly adjusted by the mod, which could lead to issues depending on how the mod adds adjustments (i.e. `ModTimeRamp`, which adds adjustments based on changes to a setting bindable).
2022-05-10 18:24:29 +03:00
Dean Herbert
1a776a9587 Completely remove subscription from MusicController 2022-01-25 16:53:02 +09:00
Dean Herbert
958cfde608 Stop detaching and exposing beatmaps from MusicController 2022-01-25 16:51:21 +09:00
Dean Herbert
d7342880f5 Update remaining cases of clashes with realm.Write and realm.RegisterForNotifications 2022-01-25 13:09:48 +09:00