Fix seeking to previous bookmark not working when song is playing#36616
Fix seeking to previous bookmark not working when song is playing#36616peppy merged 1 commit intoppy:masterfrom
Conversation
|
Stable uses -500 / +50 for bookmark seeks, regardless of playback state. We should probably copy this to match: private void bookmarkPrev_OnClick(object sender, EventArgs e)
{
int f = -1;
foreach (int i in hitObjectManager.Bookmarks)
{
if (i >= AudioEngine.Time - 500)
break;
f = i;
}
if (f >= 0)
AudioEngine.SeekTo(f);
}
private void bookmarkNext_OnClick(object sender, EventArgs e)
{
foreach (int i in hitObjectManager.Bookmarks)
{
if (i > AudioEngine.Time + 50)
{
AudioEngine.SeekTo(i);
break;
}
}
} |
|
Just because or is there a reason to copy? And adding 50 ms leniency for seeking to next bookmark seems unnecessary unless you can play in reverse? Even then, it would be the same lenience as seeking to prev bookmark. |
|
would also (partially?) close #31792 |
It was more likely to avoid floating point issues. I'd still match the backwards one, because yes "just because" aka "it's worked until now". |
|
Actually this matches the one other usage we have so let's go with it. |
…y#36616) - Closes ppy#35389 Same as: https://github.com/ppy/osu/blob/2efe0c95e63817f312f5fb12cc60dd56bee0023b/osu.Game/Screens/Edit/Editor.cs#L1173-L1180 There's also seeking hit objects and sample points, but the seeks are relatively close to each other and probably useless when playing(?). If we want to make those cases not stuck at the same point in time, I believe the leniency should be lower than 1000 ms. With the above, that is why I just copy-pasted the code, as we may want to have different leniencies. Edit: forgot the automated label thing, will not label next time
Same as:
osu/osu.Game/Screens/Edit/Editor.cs
Lines 1173 to 1180 in 2efe0c9
There's also seeking hit objects and sample points, but the seeks are relatively close to each other and probably useless when playing(?). If we want to make those cases not stuck at the same point in time, I believe the leniency should be lower than 1000 ms.
With the above, that is why I just copy-pasted the code, as we may want to have different leniencies.
Edit: forgot the automated label thing, will not label next time