Skip to content

Fix seeking to previous bookmark not working when song is playing#36616

Merged
peppy merged 1 commit intoppy:masterfrom
Joehuu:fix-left-bookmark-seek-when-playing
Feb 8, 2026
Merged

Fix seeking to previous bookmark not working when song is playing#36616
peppy merged 1 commit intoppy:masterfrom
Joehuu:fix-left-bookmark-seek-when-playing

Conversation

@Joehuu
Copy link
Copy Markdown
Member

@Joehuu Joehuu commented Feb 7, 2026

Same as:

private void seekControlPoint(int direction)
{
// In the case of a backwards seek while playing, it can be hard to jump before a timing point.
// Adding some lenience here makes it more user-friendly.
double seekLenience = clock.IsRunning ? 1000 * ((IAdjustableClock)clock).Rate : 0;
ControlPoint found = direction < 1
? editorBeatmap.ControlPointInfo.AllControlPoints.LastOrDefault(p => p.Time < clock.CurrentTime - seekLenience)

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

@Joehuu Joehuu added area:editor type/behavioural An issue with actual UI or game behaviour. Has a real world impact causing something to not work. labels Feb 7, 2026
@peppy
Copy link
Copy Markdown
Member

peppy commented Feb 7, 2026

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;
                }
            }
        }

@Joehuu
Copy link
Copy Markdown
Member Author

Joehuu commented Feb 7, 2026

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.

@hiderikzki
Copy link
Copy Markdown

would also (partially?) close #31792

@peppy
Copy link
Copy Markdown
Member

peppy commented Feb 8, 2026

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.

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".

@peppy peppy self-requested a review February 8, 2026 14:47
@peppy
Copy link
Copy Markdown
Member

peppy commented Feb 8, 2026

Actually this matches the one other usage we have so let's go with it.

@peppy peppy merged commit 239951e into ppy:master Feb 8, 2026
7 of 10 checks passed
@Joehuu Joehuu deleted the fix-left-bookmark-seek-when-playing branch February 8, 2026 19:11
minetoblend pushed a commit to minetoblend/osu that referenced this pull request Feb 9, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:editor size/XS type/behavioural An issue with actual UI or game behaviour. Has a real world impact causing something to not work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot alt+← to move to the previous bookmark when song's playing

3 participants