-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix #16519: L/R Arrow During Playback Moves From Playhead Current Location #19038
base: master
Are you sure you want to change the base?
Conversation
5caad1b
to
dd35901
Compare
dd35901
to
cc61b0a
Compare
@22justinl please rebase this PR. Thanks! |
cc61b0a
to
2a12b95
Compare
I think this change is problematic with repeats Here is a video from the PR video1399164880.mp4 |
Here is a video from current 4.2 video1231836572.mp4 |
fa1f8d3
to
525a11a
Compare
@22justinl Kind reminder about the comments above :) |
c75a8b5
to
591151f
Compare
d1bb114
to
2fadc4a
Compare
d1f5e88
to
ba0a45e
Compare
ba0a45e
to
f3733e1
Compare
@@ -213,7 +213,7 @@ void PlaybackController::seek(const midi::tick_t tick) | |||
return; | |||
} | |||
|
|||
seek(tickToSecs(tick)); | |||
seek(playedTickToSecs(tick)); |
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.
This method also looks very questionable; it's completely unclear whether it expects raw or played ticks. If you want, you could figure that out and include a fix in a separate commit, but that's absolutely not a must. Perhaps it's better to save that for a different PR.
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.
Would something like seekPlayedTick
be fine?
Also, I made PlaybackController::seek
public again (it was made private in #23011) but I'm now realizing I could instead keep it private and make a new public function (something like PlaybackController::seekBeat
) to be called by NotationActionController::move
. Would that be better?
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.
I'm not per se against making seek
public (it can already be accessed anyway via the more cumbersome way of calling dispatcher()->dispatch("rewind", ………)
). But introducing a seekBeat
method might be even better indeed. Perhaps it's nice to put it just below seekElement
.
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.
Would something like seekPlayedTick be fine?
Judging from how m_currentTicks
is used, it looks like that is actually raw ticks. So I would assume this method is rather seekRawTick
, and thus should use rawTickToSecs
.
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.
Hm, wouldn't it be played ticks since, for example, PlaybackController::seekElement
uses a value from NotationPlayback::playPositionTickByElement
, which returns played ticks?
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.
I researched it a bit more, and found a bug which I logged as #23795.
m_currentTicks
is indeed a raw tick, but this function works with played ticks. However, it turns out that in all cases where this function is called, the value that will become the argument of this function is a raw tick, but it is then converted to a played tick before calling the function.
So, the solution would be to make this function receive raw ticks, and adjust the callers to remove the conversion to played ticks.
There should be exactly three callers: seekElement
, seekListSelection
, and setTempoMultiplier
.
In the current master branch, there is a fourth one though: rewind
. It tries to pass milliseconds, instead of seconds or ticks. There is no overload for milliseconds, so this (wrongly) uses the ticks overload. However, you don't need to worry about this, because I fixed it in #23794.
e9060ee
to
5fd330f
Compare
…from playback cursor location - left/right arrow: move between beats - left/right arrow + ctrl/command: move between measures
5fd330f
to
4ecde07
Compare
Resolves: #16519
Changed so that left and right arrows during playback move the playback cursor instead of the selection (which causes the playback cursor to move back to the selection)