Skip to content

Allow the playback pointer to be held off-centre when following - #4

Open
novikov-alexander wants to merge 1 commit into
sonic-visualiser:defaultfrom
novikov-alexander:alnovi/playbackFollowAnchor
Open

Allow the playback pointer to be held off-centre when following#4
novikov-alexander wants to merge 1 commit into
sonic-visualiser:defaultfrom
novikov-alexander:alnovi/playbackFollowAnchor

Conversation

@novikov-alexander

Copy link
Copy Markdown

PlaybackScrollContinuous holds the playback pointer at the centre of the
view. That is the right place when following playback, but not when
following a recording as it is being made: everything of interest is
behind the pointer, and the half of the view ahead of it is empty.

This adds a follow anchor — a fraction of the view width at which the
pointer is held — defaulting to 0.5, so existing behaviour is unchanged
for every current caller.

Near the start of a recording, where the anchor would place the centre
frame before the beginning of the audio, the view holds still and the
pointer travels across to meet it, rather than scrolling into empty
space.

2 files changed, +56 −1. The only behavioural change to existing code is
that PlaybackScrollContinuous now routes through
getCentreFrameForAnchoredPointer(), which returns m_playPointerFrame
unchanged at the default anchor.

Used by Tony to follow a recording as it is made.

PlaybackScrollContinuous holds the playback pointer at the centre of the
view. That is the right place when following playback, but not when
following a recording as it is made: everything of interest is behind
the pointer, and the half of the view ahead of it is empty.

Add a follow anchor, as a fraction of the view width, defaulting to 0.5
so that existing behaviour is unchanged. Near the start, where the
anchor would put the centre frame before the beginning of the audio, the
view holds still and the pointer travels across to meet it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant